All Products
Search
Document Center

PolarDB:ListTagResources

Last Updated:Oct 10, 2024

Queries the tags that are added to one or more PolarDB clusters, or the PolarDB clusters to which one or more tags are 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
polardb:ListTagResourcesget
  • DBCluster
    acs:polardb:{#regionId}:{#accountId}:{#resource-type}/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region. You can call the DescribeRegions operation to query available region IDs.

cn-hangzhou
ResourceTypestringYes

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

cluster
NextTokenstringNo

The token required to obtain more results. This parameter is not required in the first query. If the first query does not return all results, you can use the token that is returned from the first query in the next query to obtain more results.

212db86sca4384811e0b5e8707e******
ResourceIdarrayNo

The IDs of the clusters. To query the tags of multiple clusters, click Add to add cluster IDs.

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

  • If you specify the ResourceId.N parameter, you can add a maximum of 50 cluster IDs at a time.

stringNo

The IDs of the clusters. To query the tags of multiple clusters, click Add to add cluster IDs.

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

  • If you specify the ResourceId.N parameter, you can add a maximum of 50 cluster IDs at a time.

pc-****************
Tagarray<object>No

The tags.

objectNo
KeystringNo

The tag key. To query the details of clusters to which multiple tags are added, click Add to add tags.

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

  • If you specify the Tag.N.Key parameter, you can create up to 20 tags at a time.

type
ValuestringNo

The tag value that is paired with the tag key. This parameter can be set to an empty string.

test

Response parameters

ParameterTypeDescriptionExample
object
NextTokenstring

The token required to obtain more results. If not all results are returned in this query, the token is returned. You can use this token in the next query to obtain more results.

212db86sca4384811e0b5e8707e******
RequestIdstring

The request ID.

688C04E4-23F8-409F-8A38-B954D5******
TagResourcesarray<object>

The details of the queried clusters and tags.

TagResourceobject
ResourceTypestring

The type of the resource. This parameter is set to cluster.

cluster
TagValuestring

The value of the tag.

test
ResourceIdstring

The cluster ID.

pc-****************
TagKeystring

The key of the tag.

type

Examples

Sample success responses

JSONformat

{
  "NextToken": "212db86sca4384811e0b5e8707e******",
  "RequestId": "688C04E4-23F8-409F-8A38-B954D5******",
  "TagResources": {
    "TagResource": [
      {
        "ResourceType": "cluster",
        "TagValue": "test",
        "ResourceId": "pc-****************",
        "TagKey": "type"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400NumberExceed.TagsThe Tags parameter`s number is exceed.The maximum number of tags is reached.
400MissParameter.TagOrResourceIdThe parameter Tag.n or ResourceId.n is needed.The Tag.n or ResourceId.n parameter must be specified.
400NumberExceed.ResourceIdsThe ResourceIds parameter's number is exceed.The number of ResourceIds parameters exceeds the limit.
404InvalidDBClusterId.NotFoundThe DBInstanceId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.

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

Change history

Change timeSummary of changesOperation
2023-09-12The Error code has changedView Change Details