Queries the tags of a key or a secret.
Debugging
Authorization information
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 parameters
Examples
Sample success responses
JSONformat
{
"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 |
|---|---|---|
| 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. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2023-05-30 | The Error code has changed | View Change Details |
