CreateSyncJob

Last updated: 2021-03-02 17:37:18

1. API Description

Domain name for API request: dts.tencentcloudapi.com.

This API (CreateSyncJob) is used to create a disaster recovery sync task.
After successful creation, check can be initiated through the CreateSyncCheckJob API. The sync task can be started through the StartSyncJob API only if the check succeeds.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: dts.ap-shanghai-fsi.tencentcloudapi.com

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: CreateSyncJob.
Version Yes String Common parameter. The value used for this API: 2018-03-30.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
JobName Yes String Disaster recovery sync task name
SyncOption Yes SyncOption Configuration options of a disaster recovery sync task
SrcDatabaseType Yes String Source instance database type, which currently only supports mysql
SrcAccessType Yes String Source instance access type, which currently only supports cdb (TencentDB instances)
SrcInfo Yes SyncInstanceInfo Source instance information
DstDatabaseType Yes String Target instance access type, which currently only supports mysql
DstAccessType Yes String Target instance access type, which currently only supports cdb (TencentDB instances)
DstInfo Yes SyncInstanceInfo Target instance information
DatabaseInfo No String Information of the source table to be synced, which is described in JSON string format.
For databases with a database-table structure:
[{Database:db1,Table:[table1,table2]},{Database:db2}]

3. Output Parameters

Parameter Name Type Description
JobId String Disaster recovery sync task ID
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Creating a disaster recovery sync task

After purchasing a disaster recovery instance for your master instance, you need to create a disaster recovery sync task first before proceeding to next steps.

Input Example

https://dts.tencentcloudapi.com/?Action=CreateSyncJob
&JobName=testname
&SrcDatabaseType=mysql
&SrcAccessType=cdb
&DstDatabaseType=mysql
&DstAccessType=cdb
&SyncOption.SyncObject=1
&SrcInfo.Region=ap-shanghai
&SrcInfo.InstanceId=cdb-e28hhsjt
&DstInfo.Region=ap-shanghai
&DstInfo.InstanceId=cdb-mdgezf4d
&<Common request parameters>

Output Example

{
  "Response": {
    "JobId": "sync-blj8wnt1",
    "RequestId": "f26f7628-7dad-457d-993e-2f03f0ff518d"
  }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.NotAllowOperation This operation is prohibited.
InternalError.DatabaseError Failed to access the database on the DTS platform.
InternalError.DuplicateJob Migration tasks are in conflict.
InternalError.ProtocolError Communication protocol error.
InvalidParameter A parameter error occurred.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help