Configures a change tracking task.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesConfigureSubscription

The operation that you want to perform. Set the value to ConfigureSubscription.

RegionIdStringYescn-hangzhou

The ID of the region in which the Data Transmission Service (DTS) instance resides. For more information, see List of supported regions.

DtsJobNameStringYesMySQL Change Tracking

The name of the change tracking task.

Note We recommend that you specify a descriptive name for easy identification. You do not need to use a unique name.
DtsInstanceIdStringNodtsy0zz3t13h7d****

The ID of the change tracking instance. You can call the DescribeDtsJobs operation to query the instance ID.

DtsJobIdStringNoy0zz3t13h7d****

The ID of the change tracking task. You can call the DescribeDtsJobs operation to query the task ID.

SourceEndpointEngineNameStringNoPostgreSQL

The engine of the source database. Valid values: MySQL, PostgreSQL, and Oracle.

Note If the source database is a self-managed database, you must specify this parameter.
SourceEndpointInstanceTypeStringNoRDS

The type of the source database. Valid values:

  • RDS: ApsaraDB RDS for MySQL instance
  • PolarDB: PolarDB for MySQL cluster
  • DRDS: PolarDB-X 1.0 instance
  • LocalInstance: self-managed database with a public IP address
  • ECS: self-managed database hosted on an Elastic Compute Service (ECS) instance
  • Express: self-managed database connected over Express Connect
  • CEN: self-managed database connected over Cloud Enterprise Network (CEN)
  • dg: self-managed database connected over Database Gateway
SourceEndpointRegionStringNocn-hangzhou

The ID of the region in which the source database resides. For more information, see List of supported regions.

Note If the source database is a self-managed database with a public IP address, you can set the value of this parameter to cn-hangzhou or the ID of the region that is closest to the region in which the self-managed database resides.
SourceEndpointInstanceIDStringNorm-bp1zc3iyqe3qw****

The ID of the source database.

Note This parameter is required only when the source database is an ApsaraDB RDS for MySQL instance, a PolarDB-X 1.0 instance, or a PolarDB for MySQL cluster.
SourceEndpointIPStringNo172.16.8*.***

The endpoint of the source database.

Note This parameter is required only when the source database is a self-managed database.
SourceEndpointPortStringNo3306

The service port number of the source database.

Note This parameter is required only when the source database is a self-managed database.
SourceEndpointOracleSIDStringNotestsid

The system ID (SID) of the Oracle database.

Note This parameter is required only when the source database is a self-managed Oracle database and is not deployed in the Real Application Clusters (RAC) architecture.
SourceEndpointDatabaseNameStringNodtstestdata

The name of the source database.

SourceEndpointUserNameStringNodtstest

The username of the account that is used to connect to the source database.

Note The permissions that are required for the database account vary with the change tracking scenario. For more information, see Prepare the source database account for change tracking.
SourceEndpointPasswordStringNoTest123456

The password of the account that is used to connect to the source database.

SourceEndpointOwnerIDStringNo140692647406****

The ID of the Alibaba Cloud account to which the source database belongs.

Note This parameter is required only when you track data changes across different Alibaba Cloud accounts.
SourceEndpointRoleStringNoram-for-dts

The RAM role that is authorized to access the source database. This parameter is required if the source database does not belong to the Alibaba Cloud account that you use to configure the change tracking task. In this case, you must authorize the Alibaba Cloud account to access the source database by using a RAM role.

Note For more information about the permissions that are required for the RAM role and how to grant the permissions to the RAM role, see Configure RAM authorization for cross-account data migration and synchronization.
DbListStringYes{"dtstest":{"name":"dtstest","all":true}}

The objects for which you want to track data changes. The value must be a JSON string. For more information, see Objects of DTS tasks.

ReserveStringNo{ "srcInstanceId": "cen-9kqshqum*******" }

The reserved parameter of DTS. The value must be a JSON string. You can specify this parameter to add more configurations of the source or destination database to the DTS task. For example, you can specify the data storage format of the destination Kafka database and the ID of the CEN instance. For more information, see MigrationReserved.

CheckpointStringNo1616902385

The UNIX timestamp that represents the start time of change tracking. Unit: seconds.

Note You can use a search engine to obtain a UNIX timestamp converter.
SubscriptionInstanceNetworkTypeStringYesvpc

The network type of the change tracking task. Set the value to vpc. A value of vpc indicates the Virtual Private Cloud (VPC) network type.

Note
  • To use the new version of the change tracking feature, you must specify the SubscriptionInstanceNetworkType parameter. You must also specify the SubscriptionInstanceVPCId and SubscriptionInstanceVSwitchID parameters. If you do not specify the SubscriptionInstanceNetworkType parameter, the previous version of the change tracking feature is used.
  • The previous version of the change tracking feature supports self-managed MySQL databases, ApsaraDB RDS for MySQL instances, and PolarDB-X 1.0 instances. The new version of the change tracking feature supports self-managed MySQL databases, ApsaraDB RDS for MySQL instances, PolarDB for MySQL clusters, and Oracle databases.
SubscriptionInstanceVPCIdStringNovpc-bp1vwnn14rqpyiczj****

The ID of the VPC in which the change tracking instance is deployed.

Note This parameter is required only when the SubscriptionInstanceNetworkType parameter is set to vpc.
SubscriptionInstanceVSwitchIdStringNovsw-bp10df3mxae6lpmku****

The ID of the vSwitch in the specified VPC.

Note This parameter is required only when the SubscriptionInstanceNetworkType parameter is set to vpc.
SubscriptionDataTypeDDLBooleanNotrue

Specifies whether to track DDL statements. Default value: true. Valid values:

  • true: tracks DDL statements.
  • false: does not track DDL statements.
SubscriptionDataTypeDMLBooleanNotrue

Specifies whether to track DML statements. Default value: true. Valid values:

  • true: tracks DML statements.
  • false: does not track DML statements.
DelayPhoneStringNo1361234****,1371234****

The mobile numbers to which latency-related alerts are sent. Separate multiple mobile numbers with commas (,).

Note
  • This parameter is available only for users of the China site (aliyun.com). Only mobile numbers in the Chinese mainland are supported. You can specify up to 10 mobile numbers.
  • Users of the international site (alibabacloud.com) cannot receive alerts by using mobile phones, but can configure alert rules for DTS tasks in the CloudMonitor console.
DelayRuleTimeLongNo10

The threshold for triggering latency-related alerts. Unit: seconds. The value must be an integer. You can set the threshold based on your business needs. To prevent jitters caused by network and database overloads, we recommend that you set the threshold to more than 10 seconds.

Note If the DelayNotice parameter is set to true, this parameter is required.
DelayNoticeBooleanNotrue

Specifies whether to monitor the task latency. Valid values:

  • true: monitors the task latency.
  • false: does not monitor the task latency.
ErrorPhoneStringNo1361234****,1371234****

The mobile numbers to which status-related alerts are sent. Separate multiple mobile numbers with commas (,).

Note
  • This parameter is available only for users of the China site (aliyun.com). Only mobile numbers in the Chinese mainland are supported. You can specify up to 10 mobile numbers.
  • Users of the international site (alibabacloud.com) cannot receive alerts by using mobile phones, but can configure alert rules for DTS tasks in the CloudMonitor console.
ErrorNoticeBooleanNotrue

Specifies whether to monitor the task status. Valid values:

  • true: monitors the task status.
  • false: does not monitor the task status.
DedicatedClusterIdStringNodtscluster_atyl3b5214uk***

The ID of the DTS dedicated cluster on which the change tracking task is scheduled to run.

Response parameters

ParameterTypeExampleDescription
HttpStatusCodeString200

The HTTP status code.

RequestIdString1D6ECADF-C5E9-4C96-8811-77602B31****

The ID of the request.

ErrCodeStringInternalError

The error code returned if the request failed.

DtsJobIdStringy0zz3t13h7d****

The ID of the change tracking task.

SuccessStringtrue

Indicates whether the request was successful.

DtsInstanceIdStringdtsy0zz3t13h7d****

The ID of the change tracking instance.

ErrMessageStringThe request processing has failed due to some unknown error.

The error message returned if the request failed.

Examples

Sample requests

http(s)://dts.aliyuncs.com/?Action=ConfigureSubscription
&DbList={"dtstest":{"name":"dtstest","all":true}}
&DtsJobName=MySQL Change Tracking
&SourceEndpointInstanceType=RDS
&SubscriptionInstanceNetworkType=vpc
&SourceEndpointInstanceID=rm-bp1zc3iyqe3qw****
&SourceEndpointUserName=dtstest
&SourceEndpointPassword=Test123456
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ConfigureSubscriptionResponse>
    <DtsJobId>y0zz3t13h7d****</DtsJobId>
    <RequestId>1D6ECADF-C5E9-4C96-8811-77602B31****</RequestId>
    <HttpStatusCode>200</HttpStatusCode>
    <DtsInstanceId>dtsy0zz3t13h7d****</DtsInstanceId>
    <Success>true</Success>
</ConfigureSubscriptionResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "DtsJobId" : "y0zz3t13h7d****",
  "RequestId" : "1D6ECADF-C5E9-4C96-8811-77602B31****",
  "HttpStatusCode" : 200,
  "DtsInstanceId" : "dtsy0zz3t13h7d****",
  "Success" : true
}

Error codes

HTTP status codeError codeError messageDescription
400Throttling.UserRequest was denied due to user flow control.The error message returned because the number of requests exceeds the limit and the request is rejected. Try again later.
500ServiceUnavailableThe request has failed due to a temporary failure of the server.The error message returned because the response of the server timed out or the server was unavailable. Try again. If the error persists, contact technical support.
403InvalidSecurityToken.ExpiredSpecified SecurityToken is expired.The error message returned because the signature expired. Use a new signature.

For a list of error codes, visit the API Error Center.