Queries the tags that are attached to a specified resource.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
alikafka:ListTagResources | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region in which the resource is deployed. | cn-hangzhou |
ResourceType | string | Yes | The type of the resource whose tags you want to query. The value is an enumerated value. Valid values:
| INSTANCE |
NextToken | string | No | The token that determines the start point of the next query. | caeba0bbb2be03f84eb48b699f0a4883 |
ResourceId | array | No | The resource ID. The following items describe the formats of resource IDs:
For example, you create an instance whose ID is alikafka_post-cn-v0h1fgs2xxxx, a topic whose name is test-topic, and a group whose ID is test-consumer-group. In this case, the resource IDs are alikafka_post-cn-v0h1fgs2xxxx, Kafka_alikafka_post-cn-v0h1fgs2xxxx_test-topic, and Kafka_alikafka_post-cn-v0h1fgs2xxxx_test-consumer-group. Note
You must specify one of the ResourceId and Tag parameters to query the tags that are attached to a resource. Otherwise, the call fails.
| |
string | No | alikafka_post-cn-v0h1fgs2**** | ||
Tag | object [] | No | The tags. | |
Key | string | No | The tag key.
| FinanceDept |
Value | string | No | The tag value.
| FinanceJoshua |
Response parameters
Examples
Sample success responses
JSON
format
{
"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 error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2023-11-09 | The internal configuration of the API is changed, but the call is not affected | see changesets | ||
|