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).
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 Solution Configurations
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 Update Solution Configurations
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 |
---|---|---|
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.
Delete Solution Configurations
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
-
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. - 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\""