Queries tags that are added to one or more AnalyticDB for MySQL clusters, or AnalyticDB for MySQL clusters that have one or more tags added.

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. You can call the DescribeRegions operation to query the most recent region list.

ResourceType String Yes cluster

The type of the resource. Set the value to cluster.

NextToken String No 212db86sca4384811e0b5e8707ec21345

The token required to obtain more results. This parameter is not required in the first query. If a query does not return all results, in the next query, you can provide the token returned by the previous query to obtain more results.

ResourceId.N String No am-bp1l20nxxxxxxxxxx

The ID of cluster N. You can specify multiple cluster IDs. Valid values of N: 1 to 50.

Note You must specify at least one of the ResourceId.N and Tag.N.Key parameters.
Tag.N.Key String No testkey1

The key of tag N. You can specify multiple tag keys. The tag key cannot be an empty string. Valid values of N: 1 to 20.

Note You must specify at least one of the ResourceId.N and Tag.N.Key parameters.
Tag.N.Value String No testvalue1

The value of tag N. You can specify multiple tag values. The tag value can be an empty string. Valid values of N: 1 to 20.

Response parameters

Parameter Type Example Description
NextToken String 212db86sca4384811e0b5e8707ec21345

The token required to obtain more results. If a query does not return all results, in the next query, you can provide the token returned by the previous query to obtain more results.

RequestId String 184DE106-CB2C-4DD2-B57F-396652E6C8F8

The ID of the request.

TagResources Array of TagResource

Details of the clusters and tags that were queried.

TagResource
ResourceType String cluster

The type of the resource. A value of cluster indicates an AnalyticDB for MySQL cluster.

TagValue String testvalue1

The value of the tag.

ResourceId String am-bp1l20nxxxxxxxxxx

The ID of the cluster.

TagKey String testkey1

The key of the tag.

Examples

Sample requests

http(s)://adb.aliyuncs.com/?Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=cluster
&NextToken=212db86sca4384811e0b5e8707ec21345
&ResourceId=["am-bp1l20nxxxxxxxxxx"]
&Tag=[{"Key":"testkey1","Value":"testvalue1"}]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListTagResourcesResponse>
    <NextToken>212db86sca4384811e0b5e8707ec21345</NextToken>
    <RequestId>184DE106-CB2C-4DD2-B57F-396652E6C8F8</RequestId>
    <TagResources>
        <ResourceType>cluster</ResourceType>
        <TagValue>testvalue1</TagValue>
        <ResourceId>am-bp1l20nxxxxxxxxxx</ResourceId>
        <TagKey>testkey1</TagKey>
    </TagResources>
</ListTagResourcesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "NextToken" : "212db86sca4384811e0b5e8707ec21345",
  "RequestId" : "184DE106-CB2C-4DD2-B57F-396652E6C8F8",
  "TagResources" : {
    "ResourceType" : "cluster",
    "TagValue" : "testvalue1",
    "ResourceId" : "am-bp1l20nxxxxxxxxxx",
    "TagKey" : "testkey1"
  }
}

Error codes

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