ListTagResources - Query tags for resources
Queries tags attached to one or more resources.
Debugging
You can call this API directly in OpenAPI Explorer. OpenAPI Explorer saves you the effort of calculating signatures. After a successful call, OpenAPI Explorer automatically generates sample SDK code.
Permissions
The following table lists the permissions required to call this API. To grant a RAM user or RAM role permission to call this API, add the required permissions to the Action element of a RAM policy statement.
Operation: The permission required to call the API.
Access level: The access level of the operation. Valid values: Write, Read, and List.
Resource type: The resource types that can be authorized. For more information, see the following descriptions:
Required resource types are highlighted.
If an operation does not support resource-level authorization,
All resourcesis displayed in this column.
Condition key: The condition keys that are defined by the cloud service.
Associated operation: Other operations that must also be permitted for this operation to succeed.
Operation | Access level | Resource type | Condition key | Associated operation |
alikafka:ListTagResources | Read | All resources * | None | None |
Request parameters
Parameter | Type | Required | Description | Example |
RegionId | string | Yes | The region ID of the resource. | cn-hangzhou |
ResourceType | string | Yes | The type of the resource. Valid values:
| INSTANCE |
NextToken | string | No | The token used to retrieve the next page of results. | caeba0bbb2be03f84eb48b699f0a4883 |
ResourceId | array | No | The resource IDs. The resource ID format varies by resource type:
For example, if the instance ID is Note You must specify either the ResourceId parameter or the Tag parameter to query tags for a resource. Otherwise, the API call fails. | |
string | No | The resource ID. | alikafka_post-cn-v0h1fgs2**** | |
Tag | array<object> | No | A list of tags. | |
object | No | A tag. | ||
Key | string | No | The tag key of the resource.
| FinanceDept |
Value | string | No | The tag value of the resource.
| FinanceJoshua |
Response parameters
Parameter | Type | Description | Example |
NextToken | string | The token used to retrieve the next page of results. | caeba0bbb2be03f84eb48b699f0a4883 |
RequestId | string | The request ID. | DE65F6B7-7566-4802-9007-96F2494A**** |
TagResources | array<object> | The list of resources and their tags. | |
TagValue | string | The tag value. | FinanceJoshua |
ResourceType | string | The type of the resource. Valid values:
| Instance |
ResourceId | string | The resource ID. The format of the resource ID varies based on the resource type:
For example, if the instance ID is | alikafka_post-cn-v0h1fgs2**** |
TagKey | string | The tag key. | FinanceDept |
Examples
Sample response
{
"NextToken": "caeba0bbb2be03f84eb48b699f0a4883",
"RequestId": "DE65F6B7-7566-4802-9007-96F2494A****",
"TagResources": {
"TagResource": [
{
"TagValue": "FinanceJoshua",
"ResourceType": "Instance",
"ResourceId": "alikafka_post-cn-v0h1fgs2****",
"TagKey": "FinanceDept"
}
]
}
}Error codes
For a list of common error codes, see Common error codes.
Change history
Date | Description | Actions |
2024-08-15 | Updated the OpenAPI description. | |
2023-11-09 | Updated internal API configurations. The API call behavior is unchanged. |