Queries the tags that are attached to a specified resource.
Authorization information
The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action
Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:
- 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 keyword: refers to the condition keyword defined by the cloud product itself.
- 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.
Operate | access level | Resource type | conditional keyword | Association operation |
---|---|---|---|---|
alikafka:ListTagResources | Read |
|
| without |
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 ID of the resource. A resource ID complies with the following rules:
For example, the resources whose tags you want to query include the alikafka_post-cn-v0h1fgs2xxxx instance, the test-topic topic, and the test-consumer-group group. In this case, their resource IDs are alikafka_post-cn-v0h1fgs2xxxx, Kafka_alikafka_post-cn-v0h1fgs2xxxx_test-topic, and Kafka_alikafka_post-cn-v0h1fgs2xxxx_test-consumer-group. NoteYou must set at least one of the ResourceId and Tag parameters to query the tags of a specified resource. Otherwise, the request fails. | |
Tag | array | No | The tag list. | |
object | No | |||
Key | string | No | The tag key.
| FinanceDept |
Value | string | No | The tag value.
| FinanceJoshua |
Response parameters
Example
Normal return example
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 API error center.