Updated on 2025-04-25 GMT+08:00

Importing kie Configurations

Function

This API is used to import kie configurations.

URI

POST /v1/{project_id}/kie/file

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which must be unique. The value contains 1 to 64 characters.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

override

No

String

Overwrite policy.

  • force: overwrites duplicate keys.
  • abort: stops the import if duplicate keys are found.
  • skip: skips duplicate keys.

Default value: force

Enumerated values:

  • force
  • abort
  • skip

label

No

String

To import a specified label, enter a value in the format of {Label key}:{Label value}. If this parameter is empty, the label of the body is imported.

Request

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Enterprise-Project-ID

No

String

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

Default value: 0

Content-Type

Yes

String

Set it to application/json;charset=UTF-8.

Accept

Yes

String

Set it to application/json.

Table 4 FormData parameter

Parameter

Mandatory

Type

Description

upload_file

Yes

File

Contents in the file must be in key-value pairs, for example, {"data":[{"key1":"value1","key2":"value2"}]}}.

Response

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

OK

Array of GetKieConfigs objects

List of configuration items that are successfully imported.

failure

Array of failure objects

List of configuration items that fail to be imported and their errors.

Table 6 GetKieConfigs

Parameter

Type

Description

id

String

ID of a configuration item.

key

String

Key of a configuration item.

labels

Object

Label of a configuration item.

value

String

Value of a configuration item.

value_type

String

Type of a configuration item value.

status

String

Status of a configuration item.

create_time

Integer

Creation time.

update_time

Integer

Update time.

create_revision

Long

Version number of the created configuration.

update_revision

Long

Version number of the updated configuration.

Table 7 failure

Parameter

Type

Description

key

String

Key of the configuration item that fails to be imported.

labels

Object

Label of the configuration item that fails to be imported.

error_code

String

Error code displayed for an import failure.

error_message

String

Import failure cause.

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Example Request

POST https://{endpoint}/v3/{project_id}/kie/file
{
  }

Example Response

Status code: 200

OK

{
  "success" : [ {
    "id" : "8a9e6a5d-8d65-48fb-a40c-5150c8479da8",
    "key" : "string",
    "labels" : {
      "key" : "value"
    },
    "value" : "string",
    "value_type" : "text",
    "status" : "enabled",
    "create_time" : 1623139038,
    "update_time" : 1623139038,
    "create_revision" : 13,
    "update_revision" : 13
  } ],
  "failure" : [ {
    "key" : "string",
    "labels" : {
      "key" : "value"
    },
    "error_code" : "SVCSTG.004xxxxx",
    "error_message" : "Invalid parameters"
  } ]
}

Status Code

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Code

See Error Codes.