Updated on 2024-10-16 GMT+08:00

Exporting Configurations

Function

This API is used to export configurations from the configuration management center.

URI

POST /v1/{project_id}/kie/download

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant sub-project ID, which must be unique. The value contains 1 to 64 characters. See Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

label

No

String

Exports data filtered by label. The format is {Label key}:{Label value}.

match

No

String

Matching option of the filtered items.

Value exact indicates exact matching, including the same number of labels.

If the value is null, inclusive matching is used.

Request

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

x-engine-id

Yes

String

ID of the engine whose configuration is to be downloaded. See Querying the Exclusive Microservice Engine List.

X-Enterprise-Project-ID

No

String

Enterprise project ID.

If this parameter is not set, the default enterprise project is default and the ID is 0.

Table 4 Request body parameter

Parameter

Mandatory

Type

Description

ids

Yes

List<String>

ID list of the configuration items to be exported. See Querying the Configuration List. When ids is empty, this API is called to export all configuration items.

Response

Status code: 200

Table 5 Response body parameter

Parameter

Mandatory

Type

Description

metadata

No

Object

Additional information about a configuration item.

data

Yes

List<KVCreateBody>

List of configuration items to be created.

Table 6 KVCreateBody

Parameter

Mandatory

Type

Description

id

Yes

String

Configuration ID.

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.

Table 7 Metadata

Parameter

Mandatory

Type

Description

version

No

String

Version information.

annotations

No

Object

Additional information about a configuration item.

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

detail

String

Location details.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

detail

String

Location details.

Example Request

Export the configuration whose ID is 0bdfddb8-c4f9-4a88-8360-07a8a616a804.

POST https://{endpoint}/v1/{project_id}/kie/download

{
    "ids":[
        "0bdfddb8-c4f9-4a88-8360-07a8a616a804"
    ]
}

Example Response

Successfully queried.

{
    "metadata": {
        "version": "2.0.0"
    },
    "data": [
        {
            "id": "0bdfddb8-c4f9-4a88-8360-07a8a616a804",
            "key": "2",
            "labels": {
                "2": "2"
            },
            "value": "2",
            "status": "enabled",
            "value_type": "text"
        },
        {
            "id": "34befef9-7f3a-4394-85f9-142622a11b1d",
            "key": "1",

            "labels": {
                "1": "1"
            },
            "value": "1",
            "status": "enabled",
            "value_type": "text"
        }
    ]
}

Status Code

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Code

See CSE Error Codes.