Creating a Configuration
Function
This API is used to create a configuration.
URI
POST /v1/{project_id}/kie/kv
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Fixed value: default. |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Authorization |
No |
String |
This parameter is mandatory if security authentication is enabled for an exclusive microservice engine. Otherwise, this parameter is not required. The token of an exclusive microservice engine with security authentication enabled is in the following format: Authorization:Bearer {Token} For details about how to obtain the token, see Obtaining the User Token of an Exclusive Microservice Engine. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Configuration key. |
value |
No |
String |
Configuration value. |
labels |
No |
Map<String,String> |
Configuration labels. |
status |
No |
String |
Configuration status. |
value_type |
No |
String |
Type of the configuration value. |
Response
Status code: 200
Parameter |
Type |
Description |
---|---|---|
kie |
Configuration information. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Configuration ID. |
key |
String |
Configuration key. |
value |
String |
Configuration value. |
value_type |
String |
Type of the configuration value. |
status |
String |
Configuration status. |
create_time |
String |
Time when the configuration is created. |
update_time |
String |
Time when the configuration is updated. |
labels |
Map<String,String> |
Configuration labels. |
create_revision |
Integer |
Created version number of the configuration. |
update_revision |
Integer |
Updated version number of the configuration. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_message |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_message |
String |
Error message. |
Example Request
Create a configuration whose label is "key1": "value1" and "key2": "value2".
POST https://{endpoint}/v1/{project_id}/kie/kv { "key": "String", "value": "String", "labels": { "key1": "value1", "key2": "value2", }, "status": "String", "value_type": "String" }
Example Response
Status code: 200
Successfully created. The configuration information is returned.
{ "id": "8a9e6a5d-8d65-48fb-a40c-5150c8479da8", "key": "string", "labels": { "key1": "value1", "key2": "value2" }, "value": "string", "value_type": "text", "status": "enabled", "create_time": 1623139038, "update_time": 1623139038, "create_revision": 13, "update_revision": 13, }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
409 |
Conflict |
500 |
Internal Server Error |
Error Code
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot