Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
20 KiB
Configuring Synchronization Policies in Batches
Function
- This API is used to configure synchronization policies in batches, including conflict policies, DROP DATASE filtering, and object synchronization scope.
Constraints
This API supports synchronization policies.
URI
POST /v3/{project_id}/jobs/batch-sync-policy
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
The content type. The default value is application/json. |
X-Auth-Token |
Yes |
String |
User token obtained from IAM. |
X-Language |
No |
String |
Request language type Default value: en-us Values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
jobs |
Yes |
Array of Table 4objects |
List of requests for setting synchronization policies in batches. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
job_id |
Yes |
String |
Task ID. |
conflict_policy |
No |
String |
Conflict policy. Values:
|
filter_ddl_policy |
No |
String |
DDL filtering policy. Values:
|
ddl_trans |
No |
Boolean |
Whether to synchronize DDL during incremental synchronization. |
index_trans |
No |
Boolean |
Whether to synchronize indexes during incremental synchronization. |
slot_name |
No |
String |
Replication slot name. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
count |
Integer |
Total number. |
results |
Array of ModifyJobResp objects |
List of returned synchronization policies that are configured in batches. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Task ID. |
status |
String |
Status Values:
|
error_code |
String |
Error code, which is optional and indicates the returned information about the failure status. |
error_msg |
String |
Error message, which is optional and indicates the returned information about the failure status. |
Example Request
The following is an example of configuring synchronization task policies in batches:
https://{Endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-sync-policy
{ "jobs": [{ "conflict_policy": "ignore", "ddl_trans": true, "filter_ddl_policy": "drop_database", "index_trans": true, "job_id": "19557d51-1ee6-4507-97a6-8f69164jb201" }] }
Example Response
Status code: 200
OK
{ "results" : [ { "id" : "19557d51-1ee6-4507-97a6-8f69164jb201", "status" : "success" } ], "count" : 1 }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
Error Code
For details, see Error Code.