Queries the tags that are bound to specific data migration, data synchronization, or change tracking instances, or queries the instances to which specific tags are bound.

Debugging

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

Request parameters

Parameter Type Required Example Description
Action String Yes ListTagResources

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

RegionId String Yes cn-hangzhou

The ID of the region where the DTS instance resides. For more information, see List of supported regions.

ResourceType String Yes ALIYUN::DTS::INSTANCE

The resource type. Valid value: ALIYUN::DTS::INSTANCE.

NextToken String No 212db86sca4384811e0b5e8707ec2****

The query token.

Note If a query does not return all results, you can specify the returned NextToken parameter in the next query to obtain more results.
ResourceId.N RepeatList No dtsntk10k6r12v****

The ID of the data migration, data synchronization, or change tracking instance. You can call the DescribeMigrationJobs, DescribeSynchronizationJobs, or DescribeSubscriptionInstances operation to query the instance ID.

Note
  • N specifies the serial number of the instance. For example, ResourceId.1 specifies the ID of the first instance and ResourceId.2 specifies the ID of the second instance. You can query 1 to 50 instance IDs at a time.
  • You must specify at least one of the ResourceId.N and Tag.N.Key parameters.
Tag.N.Key String No testkey1

The tag key.

Note
  • N specifies the serial number of the tag. For example, Tag.1.Key specifies the key of the first tag and Tag.2.Key specifies the key of the second tag. You can query 1 to 20 tag keys at a time.
  • You must specify at least one of the ResourceId.N and Tag.N.Key parameters. The parameters cannot be empty strings.
Tag.N.Value String No testvalue1

The tag value.

Note
  • N specifies the serial number of the tag. For example, Tag.1.Value specifies the value of the first tag and Tag.2.Value specifies the value of the second tag. You can query 1 to 20 tag values at a time.
  • This parameter can be an empty string.

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.

NextToken String 212db86sca4384811e0b5e8707ec2****

The query token.

Note If a query does not return all results, you can specify the returned NextToken parameter in the next query to obtain more results.
RequestId String 609AD332-F2B1-48B7-BF43-41FEE641****

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

TagResources Array of TagResource

The collection of tags.

TagResource
ResourceId String dtsntk10k6r12v****

The instance ID.

ResourceType String ALIYUN::DTS::INSTANCE

The resource type. Valid value: ALIYUN::DTS::INSTANCE.

TagKey String testkey1

The tag key.

TagValue String testvalue1

The tag value that corresponds to the tag key.

Examples

Sample requests

http(s)://dts.aliyuncs.com/?Action=ListTagResources
&RegionId=cn-hangzhou	
&ResourceType=ALIYUN::DTS::INSTANCE
&ResourceId.1=dtsntk10k6r12v****
&Tag.1.Key=testkey1
&Tag.1.Value=testvalue1
&<Common request parameters>

Sample success responses

XML format

<ListTagResourcesResponse>
      <RequestId>609AD332-F2B1-48B7-BF43-41FEE641****</RequestId>
      <TagResources>
            <ResourceId>dtsntk10k6r12v****</ResourceId>
            <TagKey>testkey1</TagKey>
            <ResourceType>ALIYUN::DTS::INSTANCE</ResourceType>
            <TagValue>testvalue1</TagValue>
      </TagResources>
      <Success>true</Success>
</ListTagResourcesResponse>

JSON format

{
	"RequestId": "609AD332-F2B1-48B7-BF43-41FEE641****",
	"TagResources": [
		{
			"ResourceId": "dtsntk10k6r12v****",
			"TagKey": "testkey1",
			"ResourceType": "ALIYUN::DTS::INSTANCE",
			"TagValue": "testvalue1"
		}
	],
	"Success": true
}

Error codes

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