All Products
Search
Document Center

Data Transmission Service:ConfigureSubscription

更新時間:May 09, 2024

Configures a change tracking task.

Note

When you configure a change tracking task in the Data Transmission Service (DTS) console, you can move the pointer over Next: Save Task Settings and Precheck in the Advanced Settings step and click Preview OpenAPI parameters to view the parameters that are used to call API operations.

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

Parameter

Type

Required

Example

Description

Action

String

Yes

ConfigureSubscription

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

RegionId

String

Yes

cn-hangzhou

The ID of the region in which the DTS instance resides. For more information, see Supported regions.

DtsJobName

String

Yes

MySQL 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.

DtsInstanceId

String

No

dtsy0zz3t13h7d****

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

DtsJobId

String

No

y0zz3t13h7d****

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

SourceEndpointEngineName

String

No

PostgreSQL

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.

SourceEndpointInstanceType

String

No

RDS

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 that is hosted on an Elastic Compute Service (ECS) instance

  • Express: self-managed database that is connected over Express Connect

  • CEN: self-managed database that is connected over Cloud Enterprise Network (CEN)

  • dg: self-managed database that is connected over Database Gateway

SourceEndpointRegion

String

No

cn-hangzhou

The ID of the region in which the source database resides. For more information, see 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.

SourceEndpointInstanceID

String

No

rm-bp1zc3iyqe3qw****

The ID of the source instance.

Note

This parameter takes effect and 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.

SourceEndpointIP

String

No

172.16.8*.***

The IP address of the source database.

Note

This parameter takes effect and is required only when the source database is a self-managed database.

SourceEndpointPort

String

No

3306

The service port number of the source database.

Note

This parameter takes effect and is required only when the source database is a self-managed database.

SourceEndpointOracleSID

String

No

testsid

The system ID (SID) of the Oracle database.

Note

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

SourceEndpointDatabaseName

String

No

dtstestdata

The name of the source database.

SourceEndpointUserName

String

No

dtstest

The database account of the source instance.

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.

SourceEndpointPassword

String

No

Test123456

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

SourceEndpointOwnerID

String

No

140692647406****

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

Note

This parameter takes effect and is required only when you track data changes across different Alibaba Cloud accounts.

SourceEndpointRole

String

No

ram-for-dts

The Resource Access Management (RAM) role that is assigned 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 allow the Alibaba Cloud account that you use to configure the change tracking task to access the source database.

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.

DbList

String

Yes

{"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.

Reserve

String

No

{ "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 Reserve parameter description.

Checkpoint

String

No

1616902385

The time at which the data change tracking starts. The value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Note

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

SubscriptionInstanceNetworkType

String

Yes

vpc

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 SubscriptionInstanceNetworkType. You must also specify SubscriptionInstanceVPCId and SubscriptionInstanceVSwitchID. If you do not specify SubscriptionInstanceNetworkType, 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.

SubscriptionInstanceVPCId

String

No

vpc-bp1vwnn14rqpyiczj****

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

Note

This parameter takes effect and is required only when SubscriptionInstanceNetworkType is set to vpc.

SubscriptionInstanceVSwitchId

String

No

vsw-bp10df3mxae6lpmku****

The ID of the vSwitch in the specified VPC.

Note

This parameter takes effect and is required only when SubscriptionInstanceNetworkType is set to vpc.

SubscriptionDataTypeDDL

Boolean

No

true

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

  • true: tracks DDL statements.

  • false: does not track DDL statements.

SubscriptionDataTypeDML

Boolean

No

true

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

  • true: tracks DML statements.

  • false: does not track DML statements.

DelayPhone

String

No

1361234****,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 numbers, but can configure alert rules for DTS tasks in the CloudMonitor console. For more information, see Configure alert rules for DTS tasks in the CloudMonitor console.

DelayRuleTime

Long

No

10

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

Note

If DelayNotice is set to true, this parameter is required.

DelayNotice

Boolean

No

true

Specifies whether to monitor the task latency. Valid values:

  • true: monitors the task latency.

  • false: does not monitor the task latency.

ErrorPhone

String

No

1361234****,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 numbers, but can configure alert rules for DTS tasks in the CloudMonitor console. For more information, see Configure alert rules for DTS tasks in the CloudMonitor console.

ErrorNotice

Boolean

No

true

Specifies whether to monitor the task status. Valid values:

  • true: monitors the task status.

  • false: does not monitor the task status.

DedicatedClusterId

String

No

dtscluster_atyl3b5214uk***

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

DtsBisLabel

String

No

normal

The environment tag of the DTS instance. Valid values:

  • normal

  • online

Response parameters

Parameter

Type

Example

Description

HttpStatusCode

String

200

The HTTP status code.

RequestId

String

1D6ECADF-C5E9-4C96-8811-77602B31****

The request ID.

ErrCode

String

InternalError

The error code returned if the request failed.

DtsJobId

String

y0zz3t13h7d****

The ID of the change tracking task.

Success

String

true

Indicates whether the request was successful.

DtsInstanceId

String

dtsy0zz3t13h7d****

The ID of the change tracking instance.

ErrMessage

String

The 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

HttpCode

Error code

Error message

Description

400

Throttling.User

Request was denied due to user flow control.

The number of requests reached the upper limit, and the request was rejected. Try again later.

500

ServiceUnavailable

The request has failed due to a temporary failure of the server.

The response of the server timed out or the server was unavailable. Try again. If the error persists, contact technical support.

403

InvalidSecurityToken.Expired

Specified SecurityToken is expired.

The signature expired. Use a new signature.

For a list of error codes, see Service error codes.