Skip to content

Transaction and Workflows

All the following actions can be started in the client controller Swagger UI or with the given curl request.

1. Start Transaction

To start a transaction, you need to provide an app ID of the app for which you want to start a transaction. You can specify a list of partaking data consumers and a list of partaking data providers. This restriction is optional. If not specified all registered clients can participate in the transaction. The start of a transaction provides you with the corresponding transaction ID and creates a PostgreSQL database for this transaction. For information on how this is created see Configuration of a database The name of the database contains the transaction ID.

curl -X 'POST'
'https://<client_service>:8080/api/v1/client-controller/apps'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "appId": "yourAppId", "consumer": ["SELECTOR_CONSUMER"], "provider": ["SELECTOR_PROVIDER"] }'

2. Start Workflow

You need to provide the transaction ID as well as the workflow definition ID of the workflow you want to start. Only clients which are specified as a consumer for this transaction are permitted to start workflows. The start of the workflow triggers the start of the Argo template which is stored under the app ID.

curl -X 'POST'
'https://<client_service>:8080/api/v1/client-controller/apps/<transactionId>'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{ "workflowDefinitionId": "HelloWorld" }'

3. Get Credentials

To obtain credentials for the services you need to use the credential resources of the client controller. Only participants which are specified as consumer or provider for the given transaction get valid credentials.

3.1 Database Credentials

The credentials for the transaction database can be obtained by:

curl -X 'GET'
'https://<client_service>:8080/api/v1/client-controller/credential-service/database/external/{transactionId}'
-H 'accept: application/json'

The credentials for the safedeposit database can be obtained by:

curl -X 'GET'
'https://<client_service>:8080/api/v1/client-controller/credential-service/database/safedeposit/{appId}'
-H 'accept: application/json'

3.2 RabbitMQ Credentials

The RabbitMQ credentials can be obtained by:

curl -X 'GET'
'https://<client_service>:8080/api/v1/client-controller/credential-service/rabbitmq/external/{appId}'
-H 'accept: application/json'

4. End Workflow

This endpoint ends the transaction in the app store and deletes the transaction specific database created in the start transaction step.

curl -X 'DELETE'
'https://<client_service>:8080/api/v1/client-controller/apps/<transactionId>'
-H 'accept: application/json'
-d ''

5. Safe Deposit Database

With this POST endpoint a database is created which can be used as a safe deposit box for data storage. The credentials to access this database can be generated from the respective client by the GET endpoint. This database can be deleted with the DELETE endpoint.

curl -X 'POST' 
  'https://<client_service>:8080/api/v1/client-controller/safe-deposit-database' 
  -H 'accept: application/json' 
  -H 'Content-Type: application/json' 
  -d '{"appId": "yourAppId" }'
curl -X 'GET' 
  'https://<client_service>:8080/api/v1/client-controller/credential-service/database/safedeposit/<appId>' 
  -H 'accept: application/json'
curl -X 'DELETE' 
  'https://<client_service>:8080/api/v1/client-controller/safe-deposit-database/<appId>' 
  -H 'accept: application/json'
  -d ''