All Products
Search
Document Center

AnalyticDB for MySQL:ListTagResources

Last Updated:Mar 15, 2024

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
adb:ListTagResourcesList
  • DBCluster
    acs:adb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the cluster. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ResourceTypestringYes

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

cluster
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

212db86sca4384811e0b5e8707ec21345
ResourceIdarrayNo

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

Note You must specify at least one of the following parameters: ResourceId.N and Tag.N.Key.
stringNo

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

Note You must specify at least one of the following parameters: ResourceId.N and Tag.N.Key.
am-bp1l20nxxxxxxxxxx
Tagobject []No

The tags that are added to clusters.

KeystringNo

The key of the tag. 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 following parameters: ResourceId.N and Tag.N.Key.
testkey1
ValuestringNo

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

testvalue1

Response parameters

ParameterTypeDescriptionExample
object

The response parameters

NextTokenstring

The pagination token that is used in the next request to retrieve a new page of results. You must specify the token that is obtained from the previous query as the value of NextToken.

212db86sca4384811e0b5e8707ec21345
RequestIdstring

The request ID.

184DE106-CB2C-4DD2-B57F-396652E6C8F8
TagResourcesobject []

The tags that are added to clusters.

ResourceTypestring

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

cluster
TagValuestring

The value of the tag.

testvalue1
ResourceIdstring

The cluster ID.

am-bp1l20nxxxxxxxxxx
TagKeystring

The key of the tag.

testkey1

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.