Skip to content

Commit

Permalink
enable data exchange new backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mgarciaLKS committed Nov 7, 2024
1 parent d6e1b49 commit 75535a7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 43 deletions.
48 changes: 20 additions & 28 deletions docs/api/curl/UmbrellaConnectorDataExchange.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

In order to start exchanging data, it will be necessary to install the subset with the necessary components for data exchange with the [Data Exchange Subset](https://github.com/eclipse-tractusx/tractus-x-umbrella/blob/umbrella-2.0.0/charts/umbrella/README.md#option-2-1):

#### Prerequisites

As a Backend Service, we are using [Webhook.site](https://webhook.site/), as it is easier to work with. In the variables {{webhook}}, use your own one.
> But you can also use the one given in the MXD [Backend-service](https://github.com/eclipse-tractusx/tutorial-resources/tree/main/mxd/backend-service)
### Steps

Once the data space has been launched, we will execute the following calls to perform the communication between the components
Expand All @@ -15,21 +10,21 @@ Once the data space has been launched, we will execute the following calls to pe
1. Create Asset
```
curl -L -X POST "http://dataprovider-controlplane.tx.test/management/v3/assets" \
-H "X-Api-Key: TEST2" \
-H "Content-Type: application/json" \
--data-raw '{
"@context": {},
"@id": "200",
"properties": {
"description": "Product EDC Demo Asset"
},
"dataAddress": {
"@type": "DataAddress",
"type": "HttpData",
"baseUrl": "{{webhook}}/api/v1/contents"
}
}'
curl -L -X POST 'http://dataprovider-controlplane.tx.test/management/v3/assets' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: TEST2' \
--data-raw '{
"@context": {},
"@id": "200",
"properties": {
"description": "Product EDC Demo Asset"
},
"dataAddress": {
"@type": "DataAddress",
"type": "HttpData",
"baseUrl": "http://dataprovider-submodelserver.tx.test/200"
}
}'
```

2. Get Asset by ID
Expand Down Expand Up @@ -144,7 +139,7 @@ curl -L -X POST 'http://dataconsumer-1-controlplane.tx.test/management/v2/contra
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@type": "odrl:Offer",
"@id": "{{offer_id}}",
"@id": "",
"assigner": "BPNL00000003AYRE",
"permission": {
"odrl:target": "200",
Expand All @@ -171,7 +166,7 @@ We get {{negotiation_id}} from the response.

9. Get Negotiation By ID
```
curl -L -X GET 'http://dataconsumer-1-controlplane.tx.test/management/v2/contractnegotiations/{{negotiation_id}} \
curl -L -X GET 'http://dataconsumer-1-controlplane.tx.test/management/v2/contractnegotiations/' \
-H 'X-Api-Key: TEST1'
```
You should be able to see in the response, that the _state_ value is equal to _FINALIZED_.
Expand All @@ -190,7 +185,7 @@ curl -L -X POST 'http://dataconsumer-1-controlplane.tx.test/management/v2/transf
"@type": "TransferRequest",
"protocol": "dataspace-protocol-http",
"counterPartyAddress": "http://dataprovider-controlplane.tx.test/api/v1/dsp",
"contractId": "{{contractagreement_id}}",
"contractId": "",
"assetId": "200",
"transferType": "HttpData-PULL",
"dataDestination": {
Expand All @@ -200,7 +195,7 @@ curl -L -X POST 'http://dataconsumer-1-controlplane.tx.test/management/v2/transf
"callbackAddresses": [
{
"transactional": true,
"uri": "{{webhook}}/api/v1/transfers"
"uri": "http://dataprovider-submodelserver.tx.test/api/v1/transfers"
}
]
}'
Expand All @@ -216,8 +211,5 @@ You should be able to see in the response that the _state_ value is equal to _ST

12. Validate Transfer
```
curl -L -X POST 'http://webhook.site/e443ea0e-365a-436e-8f84-fad002e630e1/api/v1/contents' \
-H 'Content-Type: application/json' \
-H 'Cookie: XSRF-TOKEN=eyJpdiI6IjRyVklnVGltRE1XT3Jsbk03Yng1dnc9PSIsInZhbHVlIjoidHFCTSt0b1N3TzBkZmwvaGpmRTlCNEpNa3Z3TXRFa29jMmtwZ083RU1GV3h5MHlweWFPbjFDajNJMnFpSTdvV2hZY2tXSVpBQ05Vb29ueG5VM05mNHhEUzNwemZrcnMvRWxsOEtXZng1L1UraVNZYnhiTndXTFlkSDNlUHBHOFIiLCJtYWMiOiJjOTVkY2YzOTYyMDE2MTVhNGY2Zjc1NGU3NzUxZGQzMDVhYzIzY2E4NDNiNmJiMTY4MjFjMGRjYjM0MDBlYjEwIiwidGFnIjoiIn0%3D; webhooksite_session=Bm6cSCI0WnXRAoVUByiyoJrZiVlMrVPfYvqkkVXG' \
-d '{"userId": 918704604,"title": "agwng","text": "oz"}'
curl -L -X GET 'http://dataprovider-submodelserver.tx.test/api/v1/transfers/TEST1/contents'
```
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"info": {
"_postman_id": "973c3d8e-28f2-4667-95bf-f75a9492b425",
"name": "Umbrella Connector Data-Exchange",
"_postman_id": "f50a31fa-39cd-476b-a0f4-25b77299da8e",
"name": "Tractus-X Connector Data Exchange",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "31338309",
"_collection_link": "https://web.postman.co/workspace/LKSNext-Umbrella~f4be5514-1d11-45aa-8480-95f8eaef5027/collection/31338309-973c3d8e-28f2-4667-95bf-f75a9492b425?action=share&source=collection_link&creator=31338309"
"_collection_link": "https://bold-desert-566723.postman.co/workspace/LKSNext-Umbrella~f4be5514-1d11-45aa-8480-95f8eaef5027/collection/31338309-f50a31fa-39cd-476b-a0f4-25b77299da8e?action=share&source=collection_link&creator=31338309"
},
"item": [
{
Expand Down Expand Up @@ -42,14 +42,12 @@
}
},
"url": {
"raw": "{{BACKEND_SERVICE}}/api/v1/contents",
"raw": "{{BACKEND_SERVICE}}/{{CONTENT_ID}}",
"host": [
"{{BACKEND_SERVICE}}"
],
"path": [
"api",
"v1",
"contents"
"{{CONTENT_ID}}"
]
}
},
Expand Down Expand Up @@ -106,7 +104,7 @@
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"@context\": {},\n \"@id\": \"{{ASSET_ID}}\",\n \"properties\": {\n \"description\": \"Product EDC Demo Asset\"\n },\n \"dataAddress\": {\n \"@type\": \"DataAddress\",\n \"type\": \"HttpData\",\n \"baseUrl\": \"{{BACKEND_SERVICE_PROTOCOL}}/api/v1/contents/{{CONTENT_ID}}\"\n }\n}",
"raw": "{\n \"@context\": {},\n \"@id\": \"{{ASSET_ID}}\",\n \"properties\": {\n \"description\": \"Product EDC Demo Asset\"\n },\n \"dataAddress\": {\n \"@type\": \"DataAddress\",\n \"type\": \"HttpData\",\n \"baseUrl\": \"{{BACKEND_SERVICE_PROTOCOL}}/{{CONTENT_ID}}\"\n }\n}",
"options": {
"raw": {
"language": "json"
Expand Down Expand Up @@ -438,9 +436,6 @@
}
}
],
"protocolProfileBehavior": {
"disabledSystemHeaders": {}
},
"request": {
"auth": {
"type": "apikey",
Expand Down Expand Up @@ -939,12 +934,12 @@
},
{
"key": "BACKEND_SERVICE",
"value": "https://webhook.site/03e288ed-1045-4a1e-94c9-992677294cdb",
"value": "http://dataprovider-submodelserver.tx.test",
"type": "string"
},
{
"key": "BACKEND_SERVICE_PROTOCOL",
"value": "https://webhook.site/03e288ed-1045-4a1e-94c9-992677294cdb",
"value": "http://dataprovider-submodelserver.tx.test",
"type": "string"
},
{
Expand All @@ -953,7 +948,7 @@
},
{
"key": "CONTENT_ID",
"value": "DATA"
"value": "200"
},
{
"key": "OFFER_ID",
Expand Down Expand Up @@ -981,4 +976,4 @@
"value": "TEST1"
}
]
}
}

0 comments on commit 75535a7

Please sign in to comment.