Help Center/ TaurusDB/ API Reference/ APIs (Recommended)/ HTAP (Lightweight Edition)/ Querying Data Synchronization Information
Updated on 2024-09-11 GMT+08:00

Querying Data Synchronization Information

Function

This API is used to query data synchronization information. Before calling this API:

URI

GET /v3/{project_id}/instances/{instance_id}/clickhouse/replication

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.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Number of records to be queried. The default value is 10. The value cannot be a negative number. The minimum value is 1 and the maximum value is 100.

offset

No

Integer

Index offset. The default value is 0. If offset is set to N, the resource query starts from the N+1 piece of data. If the value is set to 0, indicating that the query starts from the first piece of data. The value must be a number but cannot be a negative number.

Request Parameters

Table 3 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

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Integer

Total number of data synchronization tasks.

replications

Array of ChDatabaseReplicationInfo objects

Information about data synchronization tasks.

ext_text

String

GaussDB(for MySQL) operations, including reboots, specification changes, and switchovers.

Table 5 ChDatabaseReplicationInfo

Parameter

Type

Description

source_database

String

Source database.

target_database

String

Destination database.

status

String

Current status. Values:

  • normal
  • abnormal

stage

String

Synchronization stage. Values:

  • wait: waiting for synchronization
  • failed: Synchronization failed
  • incremental: incremental synchronization
  • full: full synchronization
  • other

percentage

String

Progress percentage.

catchup_stage

String

Catchup stage. Values:

  • wait: waiting for synchronization
  • failed: Synchronization failed
  • incremental: incremental synchronization
  • full: full synchronization
  • other

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying the first 10 synchronization tasks on the first page

GET https://{localhost}/v3/23a50154cf494ec9ad6883979a12db0a/instances/54e42160670e48e789af7075e1efea1fin16/clickhouse/replication?offset=1&limit=10

Example Response

Status code: 200

Success.

{
  "total_count" : 3,
  "replications" : [ {
    "source_database" : "test",
    "target_database" : "test",
    "status" : "abnormal",
    "stage" : "Full",
    "percentage" : 0,
    "catchup_stage" : null
  }, {
    "target_database" : "blackwhite_0018_61474479",
    "status" : "normal",
    "stage" : "Incremental",
    "percentage" : 100,
    "catchup_stage" : null
  }, {
    "target_database" : "blackwhite_0017_22525694",
    "status" : "normal",
    "stage" : "Wait",
    "percentage" : 0,
    "catchup_stage" : null
  } ],
  "ext_text" : null
}

Status Code

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Code

For details, see Error Codes.