All Products
Search
Document Center

Container Service for Kubernetes:ListTagResources

Last Updated:Apr 22, 2024

Queries resource labels and the detailed information, such as the key-value pairs of the labels and the clusters to which the labels are added. You can use labels to classify and manage Container Service for Kubernetes (ACK) clusters in order to meet monitoring, cost analysis, and tenant isolation requirements.

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
cs:ListTagResourcesRead
  • All Resources
    *
    none
none

Request syntax

GET /tags

Request parameters

ParameterTypeRequiredDescriptionExample
resource_idsarrayYes

The list of cluster IDs.

stringYes

The cluster ID.

c71cf3d796c374bf48644482cb0c3****
resource_typestringYes

The resource type. Set the value to CLUSTER.

CLUSTER
region_idstringYes

The region ID.

cn-beijing
tagsarrayNo

The list of labels that you want to query. You can specify at most 20 labels.

tagNo

The label.

ack.aliyun.com
next_tokenstringNo

The pagination token that is used in the next request to retrieve a new page of results.

***

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

next_tokenstring

The pagination token that is used in the next request to retrieve a new page of results.

c374bf4864448****
request_idstring

The request ID.

E368C761-F8F6-4A36-9B58-BD53D5CD0CEB
tag_resourcesobject

The details of the queried labels and resources.

tag_resourceobject []

The resource and label.

tag_keystring

The key of the label.

ack.aliyun.com
tag_valuestring

The value of the label.

c71cf3d796c374bf48644482cb0c3****
resource_idstring

The ID of the resource.

i-xxx
resource_typestring

The type of the resource. For more information, see Labels .

CLUSTER

Examples

Sample success responses

JSONformat

{
  "next_token": "c374bf4864448****",
  "request_id": "E368C761-F8F6-4A36-9B58-BD53D5CD0CEB",
  "tag_resources": {
    "tag_resource": [
      {
        "tag_key": "ack.aliyun.com",
        "tag_value": "c71cf3d796c374bf48644482cb0c3****",
        "resource_id": "i-xxx",
        "resource_type": "CLUSTER"
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history