Updated on 2023-07-19 GMT+08:00

Modifying a Configuration

Function

This API is used to modify a configuration.

URI

PUT /v1/{project_id}/kie/kv/{kv_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Fixed value: default.

kv_id

Yes

String

ID of the configuration to be modified. See Querying the Configuration List.

Request

Table 2 Request header parameter

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.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

value

Yes

String

Configuration value.

status

No

String

Configuration status.

Response

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

kie

SingleKieInfo

Configuration information.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

Example Request

Modify the value of the configuration whose ID is 8a9e6a5d-8d65-48fb-a40c-5150c8479da8 to this is a test and set the configuration status to enabled.

PUT https://{endpoint}/v1/{project_id}/kie/kv/8a9e6a5d-8d65-48fb-a40c-5150c8479da8

{
    "value": "this is a test",
    "status": "enabled"
}

Example Response

Status code: 200

Successfully modified. The configuration information is returned.

{   
    "id": "8a9e6a5d-8d65-48fb-a40c-5150c8479da8",   
    "key": "string",   
    "labels": {     
        "key1": "value1",
        "key2": "value2"
    },   
    "value": "this is a test",   
    "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

500

Internal Server Error

Error Code

See ServiceComb Error Codes.