Queries the tags of a key or a secret.
Operation description
For more information about the access policy required by a RAM user or RAM role to call this API, see Resource Access Management.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the resource. Note
You can call the DescribeRegions to query the most recent region list. |
cn-hangzhou |
| NextToken |
string |
No |
The pagination token that is used in the next request to retrieve a new page of results. Note
If the call does not return all result entries, the value of the NextToken parameter is returned. By default, 200 rows are returned. You can call this operation again and set the value of the parameter to the value of the parameter that is returned in the last call to implement paged query. |
caeba0bbb2be03f84eb48b699f0a4883 |
| ResourceType |
string |
Yes |
The type of resource whose tags you want to query. Valid value:
|
key |
| ResourceId |
array |
No |
A list of resource IDs for which you want to query tags. You can enter a maximum of 50 resource IDs. Enter multiple resource IDs in the |
|
|
string |
No |
The resource IDs for which you want to query tags. You can enter a maximum of 50 resource IDs. Enter multiple resource IDs in the |
key-hzz62f1cb66fa42qo**** |
|
| Tag |
array<object> |
No |
A list of tags that you want to query. Valid values of N: 1 to 20. |
|
|
object |
No |
|||
| Key |
string |
No |
The key of the tag. A tag consists of a key-value pair. You can enter up to 20 tags. Enter multiple tags in the Note
The key cannot start with aliyun or acs:. |
disk-encryption |
| Value |
string |
No |
The value of the tag. A tag consists of a key-value pair. You can enter up to 20 tags. Enter multiple tags in the |
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| NextToken |
string |
A pagination token. It can be used in the next request to retrieve a new page of results.
|
e71d8a535bd9cc11 |
| RequestId |
string |
The request ID. |
00827261-20B7-4562-83F2-4DF39876A45A |
| TagResources |
object |
||
| TagResource |
array<object> |
A list of tags. |
|
|
object |
|||
| ResourceType |
string |
The type of the resource. |
key |
| TagValue |
string |
The value of the tag. |
true |
| ResourceId |
string |
The resource ID. |
key-hzz62f1cb66fa42qo**** |
| TagKey |
string |
The key of the tag. |
disk-encryption |
Examples
Success response
JSON format
{
"NextToken": "e71d8a535bd9cc11",
"RequestId": "00827261-20B7-4562-83F2-4DF39876A45A",
"TagResources": {
"TagResource": [
{
"ResourceType": "key",
"TagValue": "true",
"ResourceId": "key-hzz62f1cb66fa42qo****",
"TagKey": "disk-encryption"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Duplicate.TagKey | The specified tagKey is duplicate. | |
| 404 | InvalidAccessKeyId.NotFound | The Access Key ID provided does not exist in our records. | |
| 404 | InvalidResourceId.NotFound | The specified ResourceId is not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.