You can call ListTagResources to query tags that are attached to resources.


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 parameter types

This operation uses common request parameters only. For more information, see Common parameters.

Request syntax


Request parameters

Parameter Type Required Example Description
resource_type String Yes CLUSTER

The type of the resource.

next_token String No 1d2db86sca4384811e0b5e8707e******

The token used to start the next query.

resource_ids String No ["xxxxx","xxxxxx"]

The IDs of the resources to query.

tags String No [{"key":"env","value","dev"},{"key":"dev", "value":"IT"}]

The list of tags to query. This list is a JSON string that contains a maximum of 20 key-value pairs.


  • You must specify resource_ids or tags. Otherwise, an error message appears.
  • The query results only include visible tags.

Response parameters

Parameter Type Example Description
request_id String F99407AB-2FA9-489E-A259-40CF6D******

The ID of the request.

tag_resources Struct

A list of resources that have tags.

tag_resource Array

The details of a resource.

resource_id String xxxxx

The ID of the resource.

resource_type String ALIYUN::CS::CLUSTER

The type of the resource.

tag_key String env

The key of the returned tag.

tag_value String dev

The value of the returned tag.


Sample requests

GET /tags HTTP/1.1
Common request parameters
"resource_type": "CLUSTER",

Sample request description

GET /tags? resource_ids=["xxx","yyy"]&resource_type=CLUSTER&tags=[{"key":"env","value":"dev"},{"key":"dep","value":"IT"}]

Sample success responses

XML format


JSON format

    "request_id": "3D8795D9-8FF5-46B2-86E6-E3B4073169BE",
    "tag_resources": {
        "tag_resource": [
                "resource_type": "ALIYUN::CS::CLUSTER",
                "resource_id": "xxxx****",
                "tag_key": "env",
                "tag_value": "dev"

Error codes

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