Configures a data synchronization task.
Before you call this operation, you must call the CreateSynchronizationJob operation to create a data synchronization instance.
- After you call this operation to configure a data synchronization task, the task will be automatically started and prechecked. You do not need to call the StartSynchronizationJob operation to start the task.
- A data synchronization task may fail to be started due to precheck failures. You can call the DescribeSynchronizationJobStatus operation to query the status of the task. Then, you can change parameter settings based on the error messages about the precheck failures. After you fix the issue, you must call the StartSynchronizationJob operation to restart the data synchronization task.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ConfigureSynchronizationJob |
The operation that you want to perform. Set the value to ConfigureSynchronizationJob. |
DataInitialization | Boolean | Yes | true |
Specifies whether to perform initial full data synchronization. Valid values:
Note Default value: true.
|
StructureInitialization | Boolean | Yes | true |
Specifies whether to perform initial schema synchronization. Valid values:
Note Default value: true.
|
SynchronizationJobId | String | Yes | dtsz4ao1dor13d**** |
The ID of the data synchronization instance. You can call the DescribeSynchronizationJobs operation to query the instance ID. |
SynchronizationObjects | String | Yes | [{"DBName":"dtstestdata","TableIncludes":[{"TableName":"customer"}]}] |
The objects that you want to synchronize. The value is a JSON string and can contain regular expressions. For more information, see SynchronizationObjects. |
RegionId | String | No | cn-hangzhou |
The ID of the region where the data synchronization instance resides. For more information, see List of supported regions. |
SynchronizationJobName | String | No | MySQL Synchronization |
The name of the data synchronization task. Note We recommend that you specify an informative name for easy identification. You do
not need to use a unique task name.
|
SynchronizationDirection | String | No | Forward |
The synchronization direction. Valid values:
Note
|
SourceEndpoint.InstanceId | String | No | rm-bp1i99e8l7913**** |
The ID of the source instance. |
SourceEndpoint.InstanceType | String | No | RDS |
The type of the source instance. Valid values:
Note The default value is RDS.
|
SourceEndpoint.IP | String | No | 172.16.88.*** |
The IP address of the source database. Note You must specify this parameter only if the SourceEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
|
SourceEndpoint.Port | String | No | 3306 |
The service port number of the source database. Note You must specify this parameter only if the SourceEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
|
SourceEndpoint.UserName | String | No | dtstestaccount |
The database account of the source database. Note
|
SourceEndpoint.Password | String | No | Test123456 |
The password of the source database account. Note You must specify this parameter only if the SourceEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
|
DestinationEndpoint.InstanceId | String | No | rm-bp1r46452ai50**** |
The ID of the destination instance. Note If the DestinationEndpoint.InstanceType parameter is set to MaxCompute or DataHub, you must specify the name of the MaxCompute project or the DataHub project.
If the destination instance is an AnalyticDB for MySQL cluster, specify the ID of the AnalyticDB for MySQL cluster. |
DestinationEndpoint.InstanceType | String | No | RDS |
The type of the destination instance. Valid values:
Note The default value is RDS.
|
DestinationEndpoint.IP | String | No | 172.16.88.*** |
The IP address of the destination database. Note You must specify this parameter only if the DestinationEndpoint.InstanceType parameter is set to Express, dg, or cen.
|
DestinationEndpoint.Port | String | No | 3306 |
The service port number of the destination database. Note You must specify this parameter only if the DestinationEndpoint.InstanceType parameter is set to ECS, Express, dg, or cen.
|
DestinationEndpoint.UserName | String | No | dtstestaccount |
The database account of the destination database. Note
|
DestinationEndpoint.Password | String | No | Test654321 |
The password of the destination database account. Note
|
SourceEndpoint.OwnerID | String | No | 140692647406**** |
The ID of the Alibaba Cloud account that owns the source RDS instance. Note You can specify this parameter to synchronize data across different Alibaba Cloud
accounts. In this case, you also need to specify the SourceEndpoint.Role parameter.
|
SourceEndpoint.Role | String | No | ram-for-dts |
The name of the RAM role configured for the Alibaba Cloud account that owns the source instance. Note You must specify this parameter when you synchronize data across different Alibaba
Cloud accounts. For information about the permissions and authorization methods of
the RAM role, see Configure RAM authorization for cross-account data migration and synchronization.
|
PartitionKey.ModifyTime_Year | Boolean | No | true |
Specifies whether the incremental data table contains partitions defined by the modifytime_year field. Valid values: true and false. Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to MaxCompute.
|
PartitionKey.ModifyTime_Month | Boolean | No | true |
Specifies whether the incremental data table contains partitions defined by the modifytime_month field. Valid values: true and false. Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to MaxCompute.
|
PartitionKey.ModifyTime_Day | Boolean | No | true |
Specifies whether the incremental data table contains partitions defined by the modifytime_day field. Valid values: true and false. Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to MaxCompute.
|
PartitionKey.ModifyTime_Hour | Boolean | No | true |
Specifies whether the incremental data table contains partitions defined by the modifytime_hour field. Valid values: true and false. Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to MaxCompute.
|
PartitionKey.ModifyTime_Minute | Boolean | No | true |
Specifies whether the incremental data table contains partitions defined by the modifytime_minute field. Valid values: true and false. Note This parameter is available only if the DestinationEndpoint.InstanceType parameter is set to MaxCompute.
|
MigrationReserved | String | No | { "autoStartModulesAfterConfig": "none", "targetTableMode": 2 } |
The reserved parameter of DTS. The value is a JSON string. You can specify this parameter to meet special requirements, for example, whether to automatically start a precheck. For more information, see MigrationReserved. Note This parameter can be used for data synchronization between ApsaraDB for Redis Enterprise
Edition instances. For more information, see Use OpenAPI Explorer to configure one-way or two-way data synchronization between ApsaraDB for Redis Enterprise Edition instances.
|
Checkpoint | String | No | 1610540493 |
The synchronization checkpoint. |
AccountId | String | No | 12323344**** |
The ID of the Alibaba Cloud account. You do not need to specify this parameter because this parameter will be removed in the future. |
SourceEndpoint.DatabaseName | String | No | dtstestdata |
The name of the database to which the synchronization object in the source instance belongs. |
DestinationEndpoint.DataBaseName | String | No | dtstestdata |
The name of the database to which the synchronization object in the destination instance belongs. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
ErrCode | String | InternalError |
The error code returned if the call failed. |
ErrMessage | String | The request processing has failed due to some unknown error. |
The error message returned if the call failed. |
RequestId | String | 2690E467-7773-43BC-A009-370EE2E7**** |
The ID of the request. |
Success | String | true |
Indicates whether the call was successful. |
Examples
Sample requests
http(s)://dts.aliyuncs.com/?Action=ConfigureSynchronizationJob
&DataInitialization=true
&StructureInitialization=true
&SynchronizationJobId=dtsz4ao1dor13d****
&SynchronizationObjects=[{"DBName":"dtstestdata","TableIncludes":[{"TableName":"customer"}]}]
&<Common request parameters>
Sample success responses
XML
format
<ConfigureSynchronizationJobResponse>
<RequestId>2690E467-7773-43BC-A009-370EE2E7****</RequestId>
<Success>true</Success>
</ConfigureSynchronizationJobResponse>
JSON
format
{
"RequestId": "2690E467-7773-43BC-A009-370EE2E7****",
"Success": true
}
Error codes
For a list of error codes, visit the API Error Center.