Updated on 2024-09-11 GMT+08:00

Modifying Data Synchronization Configurations

Function

This API is used to modify data synchronization configurations. Before calling this API:

URI

PUT /v3/{project_id}/instances/{instance_id}/clickhouse/databases/replication/config

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

ClickHouse instance ID, which is compliant with the UUID format.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

To obtain this value, call the IAM API for obtaining a user token.

The value of X-Subject-Token in the response header is the token value.

X-Language

No

String

Request language type. The default value is en-us.

Values:

  • en-us
  • zh-cn
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

source_instance_id

Yes

String

Source instance ID, which is compliant with the UUID format.

source_node_id

No

String

Node ID of the source instance.

database

Yes

String

Database name.

value

Yes

String

Configuration value. Only the synchronization scope can be modified. You cannot change the whitelist or blacklist type.

For example, if you have created a data synchronization whitelist and want to modify it using this API, you can use "value": "{"white_list":"test1,test2,test3"}", but not "value": "{"black_list":"test1,test2,test3"}".

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

job_id

String

ID of the created task.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Modifying a data synchronization whitelist

PUT https://{localhost}/v3/23a50154cf494ec9ad6883979a12db0a/instances/54e42160670e48e789af7075e1efea1fin16/clickhouse/databases/replication/config

{
  "source_instance_id" : "5a377c0073cd4264be308fd968e60312in07",
  "source_node_id" : "",
  "database" : "db1",
  "value" : "{\"white_list\":\"t1,t2,t3\"}"
}

Example Response

Status code: 200

Success.

{
  "job_id" : "3077fd46-2924-4513-ae07-82bac7886a9c"
}

Status Code

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Code

For details, see Error Codes.