Solution Configuration

Introduction

It's possible to create a solution-specific configuration to override the settings of the project configuration and project test 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.
Attention: The possible parameters are the same as with the Project Configuration.

Get Solution Configurations

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 Update Solution Configurations

Attention: You can also use the Solution Configuration to set solution-specific test configurations. See Project Test Configurations for further details on the possible parameters or follow the Example provided.
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 ""
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. Can be an arbitrary string when creating a new Solution Configuration.
data body parameter (YAML) The configuration values (body parameters)

Please see Project Configuration for the list of possible parameters.

Attention: Be aware that updating a Solution Configuration will replace the content of the current configuration with this configurationName. New parameters cannot be appended to existing configurations.

Delete Solution Configurations

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 3. 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. The following example creates a Solution Configuration named "example-configuration" for the solution "service1" to
    • disable the test support
    • use the DEV binding for calling API dependencies
    • not support events
    • not expose the internal APIs

    Enter the following values at the Swagger UI:

    runtimeName            cpd-runtime-test
    solutionAcronym        service1
    configurationName      example-configuration
    Request body(data)     feature:
                             testSupport: false
                             devBinding: true
                             kafkaEvents: false
                             exposeInternalApi: false

    Or use the following cURL command:

    curl -X POST "https://{your-hostname}/api/cfg/v1/runtimes/cpd-runtime-test/solutions/service1/configurations/example-configuration" -H  "accept: */*" -H "Authorization: Bearer {BearerToken}" -H "Content-Type: text/plain" -d "feature:    testSupport: false    devBinding: true    kafkaEvents: false    exposeInternalApi: false"
    Note: If creating or changing the solution-specific configuration, not all possible parameters have to be included in the request body. Only the configuration parameters that are deviating from the Project Configuration should be included.
  2. Create a solution specific test configuration with a Solution Configuration

    The following example creates or changes the test configuration of the solution "service1" to user "Testuser" with password "password".

    Enter the following values at the Swagger UI:

    runtimeName            cpd-runtime-test
    solutionAcronym        service1
    configurationName      service1-test
    Request body           user-alias:
                             default: "Testuser"
                           user:
                             Testuser: "Password"

    Or use the following cURL command:

    curl -X POST "https://{your-hostname}/api/cfg/v1/runtimes/cpd-runtime-test/solutions/service1/configurations/service1-test" -H  "accept: */*" -H "Authorization: Bearer {BearerToken}" -H "Content-Type: text/plain" -d "user-alias:    default: \"Testuser\"    user:        Testuser: \"Password\""
Attention: Any change to the configuration will only be applied to the solution with a new deployment.