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

ParameterTypeRequiredExampleDescription
ActionStringYesListTagResources

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

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

ResourceTypeStringYesALIYUN::DTS::INSTANCE

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

NextTokenStringNo212db86sca4384811e0b5e8707ec2****

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.NRepeatListNodtsntk10k6r12v****

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

The tag key.

Note
  • N specifies the serial number of the tag. For example, Tag.0.Key specifies the key of the first tag and Tag.1.Key specifies the key of the second tag. You can specify 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.ValueStringNotestvalue1

The tag value.

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

Response parameters

ParameterTypeExampleDescription
ErrCodeStringInternalError

The error code returned if the call failed.

ErrMessageStringThe request processing has failed due to some unknown error.

The error message returned if the call failed.

NextTokenString212db86sca4384811e0b5e8707ec2****

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.
RequestIdString609AD332-F2B1-48B7-BF43-41FEE641****

The ID of the request.

SuccessBooleantrue

Indicates whether the call was successful.

TagResourcesArray of TagResource

The collection of tags.

TagResource
ResourceIdStringdtsntk10k6r12v****

The ID of the DTS instance.

ResourceTypeStringALIYUN::DTS::INSTANCE

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

TagKeyStringtestkey1

The tag key.

TagValueStringtestvalue1

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

HTTP status codeError codeError messageDescription
419QuotaExceed.TagsPerResourceThe maximum number of tags for each resource is exceeded.The error message returned because the maximum number of tags for each resource has been reached.

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