API Bindings
Introduction
API-bindings are externalized specifications created per API dependency and can be managed via the Configuration Management API under Solution Configuration as a Solution Configuration.
The configuration of k5-projects and built solutions is done via a REST API called Configuration Management API. This API provides a Swagger UI for ease-of-use but you can use the tool of your choice for calling APIs (e.g. cURL, Postman).
https://ssob-config.<domain>
The exact URL can be
found within the route named k5-configuration-management
. It
can be easily retrieved by executing
oc get route k5-configuration -n <namespace>
, whereby
<namespace>
points to the namespace, where the Solution
Hub is installed. Get API Bindings
API bindings are stored as Solution Configurations. Therefore, you can use the same operations to query them.
Use these operations to query all or just a specific Solution Configuration.
Get all Solution Configurations of a solution
GET
method Get all Solution Configurations in the Swagger
UI
orcurl -X GET "{your-hostname}/api/cfg/v1/runtimes/{runtimeName}/solutions/{solutionAcronym}/configurations" -H "accept: application/json" -H "Authorization: Bearer {BearerToken}"
Get a specific Solution Configuration of a solution
GET
method Get a specific Solution Configuration in the
Swagger UI
orcurl -X GET "https://{your-hostname}/api/cfg/v1/runtimes/{runtimeName}/solutions/{solutionAcronym}/configurations/{configurationName}" -H "accept: text/plain" -H "Authorization: Bearer {BearerToken}"
Parameter | Type | Description |
---|---|---|
runtimeName |
path parameter (String) | The name of the specific k5-project, e.g.
cpd-runtime-default |
solutionAcronym |
path parameter (String) | The acronym of a solution, e.g. ORDERS |
configurationName |
path parameter (String) | The name of the specific Solution Configuration. |
Create or Edit API Bindings
POST
method Create or update a specific Solution
Configuration in the Swagger UI
orcurl -X POST "https://{your-hostname}/api/cfg/v1/runtimes/{runtimeName}/solutions/{solutionAcronym}/configurations/{configurationName}" -H "accept: */*" -H "Authorization: Bearer {BearerToken}" -H "Content-Type: text/plain" -d ""
Parameter | Type | Description |
configurationName |
path parameter (String) | The name of the configuration - must be the integration namespace's acronym concatenated by a dash with the API-dependency name in Solution Designer (e.g. acr-example) |
runtimeName |
path parameter (String) | The name of the specific k5-project, e.g.
cpd-runtime-default . |
solutionAcronym |
path parameter (String) | Acronym of the specific solution that uses the dependency, e.g.
ORDERS . |
configurationValue |
body parameter (JSON) | The binding information needed to call the dependency. |
"k5_propagate_security_token": true
Delete API Bindings
DELETE
method Delete a specific Solution Configuration in
the Swagger UI
orcurl -X DELETE "https://{your-hostname}/api/cfg/v1/runtimes/{runtimeName}/solutions/{solutionAcronym}/configurations/{configurationName}" -H "accept: text/plain" -H "Authorization: Bearer {BearerToken}"
Parameter | Type | Description |
---|---|---|
runtimeName |
path parameter (String) | The name of the specific k5-project, e.g.
cpd-runtime-default |
solutionAcronym |
path parameter (String) | The acronym of a solution, e.g. ORDERS |
configurationName |
path parameter (String) | The name of the specific Solution Configuration. |
Examples:
- API binding to call an API dependency named "dependency" from within the
integration namespace with the acronym "ns" of a solution with the acronym
"calling" (which has also been developed with Financial Services Workbench).
runtimeName cpd-runtime-test solutionAcronym calling configurationName ns-dependency Request body { "url": "https://cpd-runtime-test.apps.openshift-host.cloud/dependency/api/v1", "k5_propagate_security_token": true }
- API binding to call a foreign API dependency (e.g. a ML-Service)
runtimeName cpd-runtime-test solutionAcronym calling configuratioName ns-dependency Request body { "url": "https://mlpattern.123.456.789.10.example.io", "user": "userName", "password": "passWord" }