Binds tags to one or more data migration, data synchronization, or change tracking instances.
If you have a large number of instances, you can create multiple tags and bind these tags to the instances. Then, you can filter the instances by tag.
- A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can be mapped to the same value.
- If the tag that you specify does not exist, this tag is automatically created and bound to the specified instance.
- If the key of the specified tag is the same as that of an existing tag, the specified tag overwrites the existing tag.
- You can bind up to 20 tags to each instance.
- You can bind tags to up to 50 instances in each call.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | TagResources | The operation that you want to perform. Set this parameter to TagResources. |
RegionId | String | Yes | cn-hangzhou | The ID of the region where the data migration, data synchronization, or change tracking instance resides. For more information, see List of supported regions. |
ResourceId.N | RepeatList | Yes | dtsntk10k6r12v**** | The ID of the data migration, data synchronization, or change tracking instance. You can call the DescribeDtsJobs operation to query the instance ID. Note N specifies the serial number of the instance. For example, ResourceId.0 specifies the ID of the first instance and ResourceId.1 specifies the ID of the second instance. |
ResourceType | String | Yes | ALIYUN::DTS::INSTANCE | The resource type. Valid value: ALIYUN::DTS::INSTANCE. |
Tag.N.Key | String | Yes | testkey1 | The tag key. Note
|
Tag.N.Value | String | Yes | testvalue1 | The tag value. Note
|
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 | 755D7B84-6813-42B0-BC9D-2699CFEA**** | The ID of the request. |
Success | Boolean | true | Indicates whether the call was successful. |
Examples
Sample requests
http(s)://dts.aliyuncs.com/?Action=TagResources
&RegionId=cn-hangzhou
&ResourceId.1=dtsntk10k6r12v****
&ResourceType=ALIYUN::DTS::INSTANCE
&Tag.1.Key=testkey1
&Tag.1.Value=testvalue1
&<Common request parameters>
Sample success responses
XML
format
<TagResourcesResponse>
<RequestId>755D7B84-6813-42B0-BC9D-2699CFEA****</RequestId>
<Success>true</Success>
</TagResourcesResponse>
JSON
format
{
"RequestId": "755D7B84-6813-42B0-BC9D-2699CFEA****",
"Success": true
}
Error codes
For a list of error codes, visit the API Error Center.