Configuring Synchronization Policies in Batches
Function
- This API is used to configure synchronization policies in batches, including conflict policies, DROP Database filtering, and object synchronization scope.
Constraints
- This API can be called only after a task is created, the task status is CONFIGURATION, the test of connections to the source and destination databases is successful, and the API for modifying the task is successfully called.
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 For details about how to obtain the project ID, see Obtaining a Project ID. |
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 objects |
List of requests for setting synchronization policies in batches. For details, see Table 4. |
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. Value: drop_database |
ddl_trans |
No |
Boolean |
Whether to synchronize DDL during incremental synchronization. |
index_trans |
No |
Boolean |
Whether to synchronize indexes during incremental synchronization. |
is_fill_materialized_view |
No |
Boolean |
Whether to fill the materialized view in the PostgreSQL full migration/synchronization phase. If this parameter is not specified, the default value is false. |
export_snapshot |
No |
Boolean |
Whether to export data in snapshot mode in the PostgreSQL full migration/synchronization phase. If this parameter is not specified, the default value is false. |
slot_name |
No |
String |
Replication slot name. This parameter is optional for an incremental synchronization task with PostgreSQL serving as the source database. |
file_and_position |
No |
String |
|
gtid_set |
No |
String |
|
ddl_topic |
No |
String |
Topic for storing DDLs. This parameter is mandatory when Kafka is the destination database and ddl_trans is set to true. Value: name of an existing topic in the destination database. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
count |
Integer |
Total number. |
results |
Array of objects |
List of returned synchronization policies that are configured in batches. For details, see Table 6. |
Example Request
- Configuring synchronization task policies in batches, in which conflict_policy is set to ignore, ddl_trans is set to true, and filter_ddl_policy is set to drop_database
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" }] }
- Configuring MySQL incremental 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", "file_and_position": "mysql-bin.000019:197", "gtid_set":"e4979f26-4bc3-11ee-b279-fa163ef21d64:1-23" } ] }
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.
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