Queries the tags that are added to a specified resource.
Operation description
- Set ResourceId.N or Tag.N that consists of Tag.N.Key and Tag.N.Value in the request to specify the object to be queried.
- Tag.N is a resource tag that consists of a key-value pair. If you set only Tag.N.Key, all tag values that are assigned to the specified key are returned. If you set only Tag.N.Value, an error message is returned.
- If you set both Tag.N and ResourceId.N to filter tags, ResourceId.N must match all specified key-value pairs.
- If you specify multiple key-value pairs, resources that contain these key-value pairs are returned.
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 |
---|---|---|---|---|
alidns:ListTagResources | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Lang | string | No | The language in which you want some response parameters to be returned. | en |
ResourceType | string | Yes | The resource type. | DOMAIN |
NextToken | string | No | The token that determines the start point of the query. | 4698691 |
Tag | array<object> | No | An array of tag key-value pairs. | |
object | No | |||
Key | string | No | The key of the tag. | abcd |
Value | string | No | The value of the tag. | abcd |
ResourceId | array | No | The ID of the resource. | |
string | No | The domain name. If Tag.N parameters are left empty, the ResourceId.N is required. | dns-example.com |
Response parameters
Examples
Sample success responses
JSON
format
{
"NextToken": "4698691",
"RequestId": "61092C8D-6AEB-4310-B74D-C632F89BF4FB",
"TagResources": [
{
"ResourceType": "DOMAIN",
"TagValue": "abcd",
"ResourceId": "dns-example.com",
"TagKey": "abcd"
}
]
}
Error codes
For a list of error codes, visit the Service error codes.