Queries the binding relationship between ApsaraDB for Redis instances and tags.

You can also query these instances or tags in the ApsaraDB for Redis console. For more information, see Filter ApsaraDB for Redis instances by tag and View tags bound to an instance.

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 where the instance is deployed.

ResourceType String Yes INSTANCE

The type of resource. Set the value to INSTANCE.

ResourceId.N RepeatList No r-bp1zxszhcgatnx****

The ID of the specified instance. You can specify multiple IDs.

Note
  • N specifies the serial number of the instance. For example, ResourceId.1 indicates the ID of the first instance and ResourceId.2 indicates the ID of the second instance.
  • You must specify either this parameter or Tag.N.Key.
Tag.N.Key String No demokey

The key of the tag.

Note
  • N specifies the serial number of the tag. For example, Tag.1.Key indicates the key of the first tag. Tag.2.Key indicates the key of the second tag.
  • You must specify either this parameter or ResourceId.N.
Tag.N.Value String No demovalue

The value of the tag.

Note N specifies the serial number of the tag. For example, Tag.1.Value indicates the value of the first tag. Tag.2.Value indicates the value of the second tag.
NextToken String No 212db86sca4384811e0b5e8707ec2****

The start token for the next query. It is used to return more results.

Note This parameter is not required in the first query. If all results are not returned in one query, you can input the NextToken returned in the previous query to query again.

Response parameters

Parameter Type Example Description
NextToken String 212db86sca4384811e0b5e8707ec2****

If all results are not returned in this query, you can provide this token in the next query to obtain more results.

RequestId String 47A514A1-4B77-4E30-B4C5-2A880650****

The ID of the request.

TagResources Array of TagResource

The information about the returned instances and tags.

TagResource
ResourceId String r-bp1zxszhcgatnx****

The ID of the ApsaraDB for Redis instance.

ResourceType String ALIYUN::KVSTORE::INSTANCE

The type of resource. The returned value is ALIYUN::KVSTORE::INSTANCE. The value indicates an ApsaraDB for Redis instance.

TagKey String demokey

The key of the tag.

TagValue String demovalue

The value of the tag.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=INSTANCE
&Tag.1.Key=demokey1
&Tag.1.Value=demovalue1
&Tag.2.Key=demokey2
&Tag.2.Value=demovalue2
&<Common request parameters>

Sample success responses

XML format

<ListTagResourcesResponse>
      <TagResources>
            <TagResource>
                  <ResourceType>ALIYUN::KVSTORE::INSTANCE</ResourceType>
                  <TagValue>demovalue1</TagValue>
                  <ResourceId>r-bp1zxszhcgatnx****</ResourceId>
                  <TagKey>demokey1</TagKey>
            </TagResource>
            <TagResource>
                  <ResourceType>ALIYUN::KVSTORE::INSTANCE</ResourceType>
                  <TagValue>demovalue1</TagValue>
                  <ResourceId>r-bp1zxszhcgatnx****</ResourceId>
                  <TagKey>demokey1</TagKey>
            </TagResource>
            <TagResource>
                  <ResourceType>ALIYUN::KVSTORE::INSTANCE</ResourceType>
                  <TagValue>demovalue2</TagValue>
                  <ResourceId>r-bp1zxszhcgatnx****</ResourceId>
                  <TagKey>demokey2</TagKey>
            </TagResource>
            <TagResource>
                  <ResourceType>ALIYUN::KVSTORE::INSTANCE</ResourceType>
                  <TagValue>demovalue2</TagValue>
                  <ResourceId>r-bp1zxszhcgatnx****</ResourceId>
                  <TagKey>demokey2</TagKey>
            </TagResource>
      </TagResources>
      <RequestId>47A514A1-4B77-4E30-B4C5-2A880650****</RequestId>
</ListTagResourcesResponse>

JSON format

{
    "TagResources": {
        "TagResource": [
            {
                "ResourceType": "ALIYUN::KVSTORE::INSTANCE",
                "TagValue": "demovalue1",
                "ResourceId": "r-bp1zxszhcgatnx****",
                "TagKey": "demokey1"
            },
            {
                "ResourceType": "ALIYUN::KVSTORE::INSTANCE",
                "TagValue": "demovalue1",
                "ResourceId": "r-bp1zxszhcgatnx****",
                "TagKey": "demokey1"
            },
            {
                "ResourceType": "ALIYUN::KVSTORE::INSTANCE",
                "TagValue": "demovalue2",
                "ResourceId": "r-bp1zxszhcgatnx****",
                "TagKey": "demokey2"
            },
            {
                "ResourceType": "ALIYUN::KVSTORE::INSTANCE",
                "TagValue": "demovalue2",
                "ResourceId": "r-bp1zxszhcgatnx****",
                "TagKey": "demokey2"
            }
        ]
    },
    "RequestId": "47A514A1-4B77-4E30-B4C5-2A880650****"
}

Error codes

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