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

Tip: As long as not configured otherwise, the default URL where you can find the Configuration Management Swagger UI is built like this:
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

Use GET method Get all Solution Configurations in the Swagger UI or
curl -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

Use GET method Get a specific Solution Configuration in the Swagger UI or
curl -X GET "https://{your-hostname}/api/cfg/v1/runtimes/{runtimeName}/solutions/{solutionAcronym}/configurations/{configurationName}" -H  "accept: text/plain" -H "Authorization: Bearer {BearerToken}"
Table 1. Request Parameters
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

Use POST method Create or update a specific Solution Configuration in the Swagger UI or
curl -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.
If the JSON Web Token (JWT) that is used in a solution should be forwarded to call the API dependency, the following must be included in the configuration value (as JSON):
 "k5_propagate_security_token": true
Tip: You might not need a specific API Binding if the named dependency is also developed with IBM Financial Services Workbench and you marked "Local Lookup" while adding the API dependency in your solution.

Delete API Bindings

Use DELETE method Delete a specific Solution Configuration in the Swagger UI or
curl -X DELETE "https://{your-hostname}/api/cfg/v1/runtimes/{runtimeName}/solutions/{solutionAcronym}/configurations/{configurationName}" -H  "accept: text/plain" -H "Authorization: Bearer {BearerToken}"
Table 2. Request Parameters
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:

  1. 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
                           }
  2. 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"
                           }
Attention: Any change to the API binding will only be applied to the solutions after a new deployment..