Queries tags based on resource IDs or tags. When you specify tags, you can either specify only keys of tags or specify keys and values of tags.

You must specify at least one of the following elements in the request: resource IDs and tags. Otherwise, an error is returned.


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 bds-bp15e022622f****

The ID of resource N. Set the value to the cluster ID. You can query the tags of multiple resources. Specify the parameter name in the format of ResourceId.x, 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. If the data size is excessively large, you can use the NextToken parameter to query the next page.

Response parameters

Parameter Type Example Description
NextToken String 1d2db86sca4384811e0b5e8707e68****

The token used to query the next page. If the value of the NextToken parameter is null, all the data entries are returned.

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

The ID of the request.

TagResources Array of TagResource

The list of the resources.

ResourceId String bds-bp15e022622f****

The ID of the resource.


The type of the resource.

TagKey String k1

The tag key.

TagValue String v2

The tag value.


Sample requests

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

Sample success responses

XML format


JSON format


Error codes

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