Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add api collection and update readme for data exchange tutorial #155

Merged
merged 38 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b64a904
Add files and Update README for the Data-Exchange tutorial
mgarciaLKS Nov 4, 2024
61ded26
Merge branch 'eclipse-tractusx:main' into main
mgarciaLKS Nov 5, 2024
7cb2c34
Update Chart version
mgarciaLKS Nov 5, 2024
bd806ba
Update docs/api/curl/UmbrellaConectorDataExchange.md
mgarciaLKS Nov 5, 2024
ff4422b
Update UmbrellaConectorDataExchange.md
mgarciaLKS Nov 5, 2024
dc0b6f3
Update docs/api/curl/UmbrellaConectorDataExchange.md
mgarciaLKS Nov 5, 2024
5818998
Update charts/umbrella/README.md
mgarciaLKS Nov 5, 2024
9fc08a9
Update charts/umbrella/README.md
mgarciaLKS Nov 5, 2024
0255f92
Update charts/umbrella/README.md
mgarciaLKS Nov 5, 2024
4675559
Update charts/umbrella/README.md
mgarciaLKS Nov 5, 2024
f973aea
Update docs/api/curl/UmbrellaConectorDataExchange.md
mgarciaLKS Nov 5, 2024
88fdbf6
Update docs/README.md
mgarciaLKS Nov 5, 2024
adab484
Update docs/README.md
mgarciaLKS Nov 5, 2024
4a55265
Update docs/api/curl/UmbrellaConectorDataExchange.md
mgarciaLKS Nov 5, 2024
7302081
Update docs/api/API_Doc.md
mgarciaLKS Nov 5, 2024
5d23e59
Update README.md
mgarciaLKS Nov 5, 2024
023a40c
Update README.md involved components
mgarciaLKS Nov 5, 2024
3d74cfc
Update README.md get to know the portal
mgarciaLKS Nov 5, 2024
4f43a87
Rename UmbrellaConectorDataExchange.md to UmbrellaConnectorDataExchan…
mgarciaLKS Nov 5, 2024
5ea9152
Update UmbrellaConnectorDataExchange.md
mgarciaLKS Nov 5, 2024
be32060
Merge remote-tracking branch 'upstream/main'
mgarciaLKS Nov 7, 2024
9e572ea
Update charts/umbrella/README.md
mgarciaLKS Nov 7, 2024
6cccd2b
Update charts/umbrella/README.md
mgarciaLKS Nov 7, 2024
db1d96d
Involved components at the end
mgarciaLKS Nov 7, 2024
69c9b55
onboarding componentes enabled and disabled
mgarciaLKS Nov 7, 2024
49e0813
portal list of disabled components
mgarciaLKS Nov 7, 2024
375d959
portal list at the end
mgarciaLKS Nov 7, 2024
d60d46b
Update docs/README.md
mgarciaLKS Nov 7, 2024
b0e6b89
Update docs/api/API_Doc.md
mgarciaLKS Nov 7, 2024
3a68b32
Update docs/README.md
mgarciaLKS Nov 7, 2024
402dde3
Update docs/api/API_Doc.md
mgarciaLKS Nov 7, 2024
ae3a628
Add simple data backend
mgarciaLKS Nov 7, 2024
d6e1b49
Add simpleDataBackend
mgarciaLKS Nov 7, 2024
75535a7
enable data exchange new backend
mgarciaLKS Nov 7, 2024
53aae26
Update API_Doc.md
mgarciaLKS Nov 7, 2024
cfbfba0
docs: do final adjustments
evegufy Nov 7, 2024
393ee2c
docs: add footer
evegufy Nov 7, 2024
65d85a3
docs: fix bold
evegufy Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/umbrella/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sources:
- https://github.com/eclipse-tractusx/tractus-x-umbrella

type: application
version: 2.0.2
version: 2.0.3

# when adding or updating versions of dependencies, also update list under README.md#Install
dependencies:
Expand Down
48 changes: 41 additions & 7 deletions charts/umbrella/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ The Chart aims for a completely automated setup of a fully functional network, t

The versions of integrated components correspond to the **overarching [Release 24.05](https://github.com/eclipse-tractusx/tractus-x-release/blob/24.05/CHANGELOG.md#2405---2024-05-29)**.

:warning: The 24.05 Release does not include a Managed Identity Wallet (MIW) - aka the FOSS Wallet of Tractus-X - as it was not yet able to cover functionalities required for the Self-Sovereign Identity Flow introduced with R24.05. To test and ship R24.05, a commercial solution was used: the Decentralized Identity Management (DIM) Wallet. To cover the wallet functionalities in the [E2E Adopter Journey Data exchange](#data-exchange) the [iatp-mock](https://github.com/eclipse-tractusx/tractus-x-umbrella/tree/main/charts/umbrella/charts/iatpmock/Chart.yaml) was added to the umbrella helm chart, please also see [Precondition for IATP Mock](#precondition-for-iatp-mock). For the [E2E Adopter Journey Portal](#portal), there isn't a mock available yet to cover the wallet functionalities.
:warning: The 24.05 Release does not include a Managed Identity Wallet (MIW) - aka the FOSS Wallet of Eclipse Tractus-X - as it was not - yet - able to cover functionalities required for the Self-Sovereign Identity Flow introduced with R24.05. To test and ship R24.05, a commercial solution was used: the Decentralized Identity Management (DIM) Wallet. To cover the wallet functionalities in the [E2E Adopter Journey Data exchange](#data-exchange) and [E2E Adopter Journey Portal](#portal), the [SSI DIM Wallet Stub](https://github.com/eclipse-tractusx/ssi-dim-wallet-stub) was added to the umbrella helm chart.

As an intermediate solution - before the SSI DIM Wallet Stub - the [iatp-mock](https://github.com/eclipse-tractusx/tractus-x-umbrella/tree/main/charts/umbrella/charts/iatpmock/Chart.yaml) was added, please see [Precondition for IATP Mock](#precondition-for-iatp-mock) if you'd still like to use it. Please be aware that it doesn't cover the wallet functionalities needed for the [E2E Adopter Journey Portal](#portal) for instance during the onboarding process of a company.

## Usage

Expand Down Expand Up @@ -467,16 +469,33 @@ helm install -f values-adopter-portal.yaml umbrella . --namespace umbrella --cre

#### Data exchange

:warning: Please be aware of [Note for R24.05](#note-for-r2405)
To start the Data Exchange, it is necessary to execute the [Data Exchange Subset](https://github.com/eclipse-tractusx/tractus-x-umbrella/blob/umbrella-2.0.0/charts/umbrella/README.md#option-2-1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought again and I think we don't need that part:

Suggested change
To start the Data Exchange, it is necessary to execute the [Data Exchange Subset](https://github.com/eclipse-tractusx/tractus-x-umbrella/blob/umbrella-2.0.0/charts/umbrella/README.md#option-2-1)


Involved components:
There are two ways to test and execute the Data Exchange tutorial:

**1. Postman**

You can import the Umbrella [Postman Collection](../../docs/api/postman/UmbrellaConnectorData-Exchange.postman_collection.json)

EDC, MIW, DTR, Vault (data provider and consumer in tx-data-provider), CentralIdP.
**2. Curl**

You can follow the [Curl Steps](../../docs/api/curl/UmbrellaConectorDataExchange.md)

Involved components:

TBD.
- Data Provider
- Data Consumer 1
- Data Consumer 2 (Optional)
- BDRS Server Memory
- BPN-DID-Resolution-Service (BDRS)
- SSI DIM Wallet Stub
- SSI Credential Issuer
- pgadmin4

mgarciaLKS marked this conversation as resolved.
Show resolved Hide resolved
#### Get to know the Portal

To start the Portal, it is necessary to execute the [Portal Subset](https://github.com/eclipse-tractusx/tractus-x-umbrella/blob/umbrella-2.0.0/charts/umbrella/README.md#option-2-1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought again and I think we don't need that part:

Suggested change
To start the Portal, it is necessary to execute the [Portal Subset](https://github.com/eclipse-tractusx/tractus-x-umbrella/blob/umbrella-2.0.0/charts/umbrella/README.md#option-2-1)


Perform first login and send out an invitation to a company to join the network (SMTP account required to be configured in custom values.yaml file).

Proceed with the login to the <http://portal.tx.test> to verify that everything is setup as expected.
Expand Down Expand Up @@ -516,6 +535,23 @@ tractusx-umbr3lla!
linkStyle 0,1 stroke:lightblue
```

Involved components:

- Portal
- CentralIdP (Keycloak)
- SharedIdP (Keycloak)
- pgadmin4

Some components are disabled, as they are not necessary for the exclusive use of the portal. If you want to perform the onboarding of a participant, it would be necessary to enable the following components:

- BPDM
- SSI DIM Wallet Stub
- BPN-DID-Resolution-Service (BDRS)
- SSI-Credential-Issuer
- Self Description Factory
- Discovery Finder
- BPN Discovery

The relevant hosts are the following:

- <http://centralidp.tx.test/auth/>
Expand All @@ -530,8 +566,6 @@ In case that you have TLS enabled (see [Self-signed TLS setup (Optional)](#self-
- <https://portal-backend.tx.test>
- <https://portal.tx.test>

:warning: Please be aware of [Note for R24.05](#note-for-r2405)

##### Note for onboarding process

Since the onboarding process requires the [Clearinghouse](https://github.com/eclipse-tractusx/portal-assets/blob/v2.1.0/docs/developer/Technical%20Documentation/Interface%20Contracts/Clearinghouse.md) to work properly, but ClearingHouse currently isn't available as a FOSS application you can skip the step with the following SQL Script which must be executed against the portal database.
Expand Down
2 changes: 1 addition & 1 deletion charts/umbrella/values-adopter-data-exchange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ ssi-credential-issuer:
enabled: false

ssi-dim-wallet-stub:
enabled: true
enabled: true
5 changes: 5 additions & 0 deletions charts/umbrella/values-adopter-portal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ pgadmin4:
bpdm:
enabled: false

# Set 'enabled' to true if onboarding is required
bdrs-server-memory:
enabled: true

# Set 'enabled' to true if onboarding is required
selfdescription:
enabled: false

Expand Down
8 changes: 7 additions & 1 deletion charts/umbrella/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,13 @@ tx-data-provider:
simple-data-backend:
nameOverride: dataprovider-submodelserver
ingress:
enabled: false
enabled: true
className: "nginx"
hosts:
- host: "dataprovider-submodelserver.tx.test"
paths:
- path: "/"
pathType: "Prefix"

semantic-hub:
enabled: false
Expand Down
17 changes: 17 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Introduction

This repository provides the API requests to provide a tutorial for the Data Exchange.

The following table links you to the respective documentations.

| Documentation | Purpose |
|------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| [API Requests](api/API_Doc.md) | API Requests for Data Exchange. |

## NOTICE

This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0).

- SPDX-License-Identifier: Apache-2.0
- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation
- Source URL: <https://github.com/eclipse-tractusx/tractus-x-umbrella>
21 changes: 21 additions & 0 deletions docs/api/API_Doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# API Requests for Data Exchange

This document provides about API requests for the Data Exchange.

## Postman

There is a [postman collection](./postman) containing information on how to exchange data between provider and consumer.

⚠️ _Change de webhook.site variable value to your respective one._
evegufy marked this conversation as resolved.
Show resolved Hide resolved

## Curl

There is a [curl tutorial](./curl) containing step by step tutorial on how to exchange data between provider and consumer, using the console.

## NOTICE

This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0).

* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation
* Source URL: <https://github.com/eclipse-tractusx/tractus-x-umbrella>
215 changes: 215 additions & 0 deletions docs/api/curl/UmbrellaConnectorDataExchange.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
## Data Exchange Tutorial
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Data Exchange Tutorial
## Data Exchange Tutorial with curl


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):

### Steps

Once the data space has been launched, we will execute the following calls to perform the communication between the components

> Variables enclosed in {{ }} mean that they are whose content has been obtained from the answers of previous calls.

1. Create Asset
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Create Asset
```
1. Create Asset

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
To check if the asset is correctly created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Get Asset by ID
To check if the asset is correctly created.
2. Get Asset by ID
To check if the asset is correctly created.

```
curl -L -X GET 'http://dataprovider-controlplane.tx.test/management/v3/assets/200' \
-H 'X-Api-Key: TEST2'
```

3. Create Policy
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Create Policy
```
3. Create Policy

curl -L -X POST 'http://dataprovider-controlplane.tx.test/management/v2/policydefinitions' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: TEST2' \
--data-raw '{
"@context": {
"odrl": "http://www.w3.org/ns/odrl/2/"
},
"@type": "PolicyDefinitionRequestDto",
"@id": "200",
"policy": {
"@type": "odrl:Set",
"odrl:permission": [
{
"odrl:action": "USE",
"odrl:constraint": {
"@type": "LogicalConstraint",
"odrl:or": [
{
"@type": "Constraint",
"odrl:leftOperand": "BusinessPartnerNumber",
"odrl:operator": {
"@id": "odrl:eq"
},
"odrl:rightOperand": "BPNL00000003AZQP"
}
]
}
}
]
}
}'
```

4. Get Policies by ID
To check if the Policies are correctly created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. Get Policies by ID
To check if the Policies are correctly created.
4. Get Policies by ID
To check if the Policies are correctly created.

```
curl -L -X GET 'http://dataprovider-controlplane.tx.test/management/v2/policydefinitions/200' \
-H 'X-Api-Key: TEST2'
```

5. Create Contract Definition
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Create Contract Definition
```
5. Create Contract Definition

curl -L -X POST 'http://dataprovider-controlplane.tx.test/management/v2/contractdefinitions' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: TEST2' \
--data-raw '{
"@context": {},
"@id": "200",
"@type": "ContractDefinition",
"accessPolicyId": "200",
"contractPolicyId": "200",
"assetsSelector": {
"@type": "CriterionDto",
"operandLeft": "https://w3id.org/edc/v0.0.1/ns/id",
"operator": "=",
"operandRight": "200"
}
}'
```

6. Get Contract Definition by ID
To check if the Contract Definition is correctly executed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
6. Get Contract Definition by ID
To check if the Contract Definition is correctly executed
6. Get Contract Definition by ID
To check if the Contract Definition is correctly executed

```
curl -L -X GET 'http://dataprovider-controlplane.tx.test/management/v2/contractdefinitions/200' \
-H 'X-Api-Key: TEST2'
```

7. Query Catalog
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
7. Query Catalog
```
7. Query Catalog

curl -L -X POST 'http://dataconsumer-1-controlplane.tx.test/management/v2/catalog/request' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: TEST1' \
--data-raw '{
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"@type": "CatalogRequest",
"counterPartyAddress": "http://dataprovider-controlplane.tx.test/api/v1/dsp",
"counterPartyId": "BPNL00000003AYRE",
"protocol": "dataspace-protocol-http",
"querySpec": {
"offset": 0,
"limit": 50
}
}'
```
We get the {{offer_id}} from the response.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
We get the {{offer_id}} from the response.

We get the {{offer_id}} from the response.


8. Initiate Negotiation
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
8. Initiate Negotiation
```
8. Initiate Negotiation

curl -L -X POST 'http://dataconsumer-1-controlplane.tx.test/management/v2/contractnegotiations' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: TEST1' \
--data-raw '{
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"@type": "NegotiationInitiateRequestDto",
"counterPartyAddress": "http://dataprovider-controlplane.tx.test/api/v1/dsp",
"protocol": "dataspace-protocol-http",
"policy": {
"@context": "http://www.w3.org/ns/odrl.jsonld",
"@type": "odrl:Offer",
"@id": "",
"assigner": "BPNL00000003AYRE",
"permission": {
"odrl:target": "200",
"odrl:action": {
"odrl:type": "USE"
},
"odrl:constraint": {
"odrl:or": {
"odrl:leftOperand": "BusinessPartnerNumber",
"odrl:operator": {
"@id": "odrl:eq"
},
"odrl:rightOperand": "BPNL00000003AZQP"
}
}
},
"prohibition": [],
"obligation": [],
"target": "200"
}
}'
```
We get {{negotiation_id}} from the response.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
We get {{negotiation_id}} from the response.

We get {{negotiation_id}} from the response.


9. Get Negotiation By ID
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
9. Get Negotiation By ID
```
9. Get Negotiation By 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_.

We get {{contractagreement_id}} from the response.

10. Initiate Transfer
```
curl -L -X POST 'http://dataconsumer-1-controlplane.tx.test/management/v2/transferprocesses' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: TEST1' \
--data-raw '{
"@context": {
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
},
"@type": "TransferRequest",
"protocol": "dataspace-protocol-http",
"counterPartyAddress": "http://dataprovider-controlplane.tx.test/api/v1/dsp",
"contractId": "",
"assetId": "200",
"transferType": "HttpData-PULL",
"dataDestination": {
"type": "HttpProxy"
},
"connectorId": "BPNL00000003AZQP",
"callbackAddresses": [
{
"transactional": true,
"uri": "http://dataprovider-submodelserver.tx.test/api/v1/transfers"
}
]
}'
```
We get {{transfer_id}} from the response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
We get {{transfer_id}} from the response

We get {{transfer_id}} from the response


11. Get Transfer by ID
```
evegufy marked this conversation as resolved.
Show resolved Hide resolved
curl -L -X GET 'http://dataconsumer-1-controlplane.tx.test/management/v2/transferprocesses/{{transfer_id}}' \
-H 'X-Api-Key: TEST1'
```
You should be able to see in the response that the _state_ value is equal to _STARTED_.
evegufy marked this conversation as resolved.
Show resolved Hide resolved

12. Validate Transfer
```
curl -L -X GET 'http://dataprovider-submodelserver.tx.test/api/v1/transfers/TEST1/contents'
```
evegufy marked this conversation as resolved.
Show resolved Hide resolved
Loading