Checking Table Configurations for Data Synchronization
Function
This API is used to check table configurations for data synchronization. Before calling this API:
- Learn how to authorize and authenticate it.
- Obtain the required region and endpoint.
URI
POST /v3/{project_id}/instances/{instance_id}/clickhouse/replication/table-check
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
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:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
source_instance_id |
Yes |
String |
Source instance ID. |
source_node_id |
No |
String |
Source node ID. GaussDB(for MySQL) read replica ID. If this parameter is left blank, the ID of the primary node is used. |
source_database_name |
Yes |
String |
Source database name. |
db_configs |
Yes |
Array of ChDatabaseConfigsInfo objects |
Database configurations. |
tables_configs |
Yes |
Array of ChDatabaseTablesConfigsInfo objects |
Table configurations. |
table_repl_config |
Yes |
Table synchronization configurations. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
param_name |
Yes |
String |
Name of the database synchronization configuration parameter. To obtain this value, see Querying Database Parameter Settings for Data Synchronization. |
value |
Yes |
String |
Value of the database synchronization configuration parameter. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
table_name |
Yes |
String |
Table name. |
table_config |
Yes |
String |
Table configuration item. The following column operations are allowed: PARTITION BY, COLUMNS, ORDER BY, SAMPLE BY, PRIMARY KEY, and TTL. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
repl_type |
Yes |
String |
Table synchronization type. Values:
|
tables |
Yes |
Array of strings |
Tables listed on the whitelist or blacklist. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
source_database_name |
String |
Source database name. |
table_config_check_results |
Array of ChDatabaseTableConfigCheckResult objects |
Table configuration check result. |
Parameter |
Type |
Description |
---|---|---|
table_name |
String |
Table name. |
table_config |
String |
Table configuration item. The following column operations are allowed: PARTITION BY, COLUMNS, ORDER BY, SAMPLE BY, PRIMARY KEY, and TTL. |
check_result |
String |
Check result. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Request
Checking table configurations for data synchronization
POST https://{localhost}/v3/23a50154cf494ec9ad6883979a12db0a/instances/54e42160670e48e789af7075e1efea1fin16/clickhouse/replication/table-check { "source_database_name" : "blackwhite_0017_22525694", "db_configs" : [ { "param_name" : "default_isolation_level", "value" : "QUERY_SNAPSHOT" }, { "param_name" : "enable_snapshots", "value" : "true" }, { "param_name" : "enable_chunk_level", "value" : "true" }, { "param_name" : "max_sync_threads", "value" : "1" }, { "param_name" : "treat_numeric_string_as_integer", "value" : "false" }, { "param_name" : "min_binlog_expire_logs_seconds", "value" : "86400" }, { "param_name" : "max_rows_in_buffer", "value" : "2000000" }, { "param_name" : "max_rows_in_buffers", "value" : "6000000" }, { "param_name" : "max_bytes_in_buffer", "value" : "200000000" }, { "param_name" : "max_bytes_in_buffers", "value" : "600000000" }, { "param_name" : "max_flush_data_time", "value" : "5000" } ], "tables_configs" : [ { "table_name" : "sbtest100", "table_config" : "ORDER BY id" } ], "table_repl_config" : { "repl_type" : "white_list", "tables" : [ ] }, "source_instance_id" : "77aa4096cb824a61b93dab5ca00ecc8fin07", "source_node_id" : "57bfeacf6e8d4eb685ea907372374b35no07" }
Example Response
Status code: 200
Success.
{ "source_database_name" : "blackwhite_0017_22525694", "table_config_check_results" : [ { "table_name" : "sbtest100", "table_config" : "ORDER BY id", "check_result" : "Check Override Table Failed" } ] }
Status Code
Status Code |
Description |
---|---|
200 |
Success. |
400 |
Client error. |
500 |
Server error. |
Error Code
For details, see Error Codes.
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