You can call this operation to query a list of tags based on resource IDs or tags. When you specify tags, you can either specify keys of tags or specify keys and values of tags.

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 ListTagResources

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

RegionId String Yes cn-hangzhou

The ID of the region.

ResourceId.N RepeatList No cds-wz9p9ccq****92as

The ID of resource N. Set the value to the cluster ID. You can query multiple resources. You can specify the parameter name in the format such as ResourceId.2 and ResourceId.3. N is a positive integer.

Tag.N.Key String No key1

The key of tag N that you want to query. You can specify multiple tag keys. N is a positive integer.

Tag.N.Value String No value1

The value of tag N. You can specify multiple tag values. N is a positive integer.

NextToken String No NextToken

The token used to query the next page. You can use the NextToken parameter to query the next page.

Response parameters

Parameter Type Example Description
NextToken String 1d2db86sca4384811e0b5e8707e68181f

The token used to query the next page. If the NextToken value is null, the system has read all data.

RequestId String 74F02441-9A8D-48F6-933F-E317AEB28DBF

The ID of the request.

TagResources Array

The information of the tag resources.

TagResource
ResourceId String cds-wz9p9ccq****92as

The ID of the resource.

ResourceType String ALIYUN::CASSANDRA::CLUSTER

The type of the resource.

TagKey String k1

The key of the tag.

TagValue String v1

The value of the tag.

Examples

Sample requests

http(s)://[Endpoint]/? Action=ListTagResources
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<RequestId>74F02441-9A8D-48F6-933F-E317AEB28DBF</RequestId>
<NextToken>1d2db86sca4384811e0b5e8707e68181f</NextToken>
<TagResources>
    <TagResource>
        <ResourceId>cds-wz9p9ccq****92as</ResourceId>
        <TagKey>k1</TagKey>
        <ResourceType>ALIYUN::CASSANDRA::CLUSTER</ResourceType>
        <TagValue>v1</TagValue>
    </TagResource>
</TagResources>

JSON format

{"RequestId":"74F02441-9A8D-48F6-933F-E317AEB28DBF","NextToken":"1d2db86sca4384811e0b5e8707e68181f","TagResources":{"TagResource":[{"ResourceId":"cds-wz9p9ccq****92as","TagKey":"k1","ResourceType":"ALIYUN::CASSANDRA::CLUSTER","TagValue":"v1"}]}}

Error codes

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