Queries the tag values of a tag key.
Operation description
This topic provides an example on how to call the API operation to query the values of the tag key k1
in the cn-hangzhou
region. The response shows that the value of the tag key k1
is v1
.
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 |
---|---|---|---|---|
tag:ListTagValues | get | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID. For more information about region IDs, see Endpoints . | cn-hangzhou |
Key | string | Yes | The tag key. This parameter specifies a filter condition for the query. | k1 |
NextToken | string | No | The token that is used to start the next query. | caeba0bbb2be03f84eb48b699f0a**** |
PageSize | integer | No | The number of tag values to return on each page. Maximum value: 1000. Default value: 50. | 50 |
ResourceType | string | No | The resource type. This parameter specifies a filter condition for the query. Format:
| ALIYUN::ECS::INSTANCE |
QueryType | string | No | The category of the tags. This parameter specifies a filter condition for the query. Valid values:
Note
The value of this parameter is not case-sensitive.
| ResourceTag |
FuzzyType | string | No | The type of the query. Valid values:
| EQUAL |
TagFilter.Value | string | No | The tag value. This parameter is used together with the | v1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"NextToken": "caeba0bbb2be03f84eb48b699f0a****",
"RequestId": "8989CA7E-D2E0-4B6D-8282-311106E80150",
"Values": {
"Value": [
"v1"
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | FuzzyQuery.NotSupport | The fuzzy query is not supported. | - |
403 | Invalid.NextToken | The parameter NextToken is invalid. | The parameter NextToken is invalid. |
403 | NoPermission.Operator | The user is not authorized to operate on the specified resource. | The user is not authorized to operate on the specified resource. |
403 | NoPermissionKey.Operator | You are not authorized to operate the tag key. | You are not authorized to operate the tag key. |
403 | InvalidParameter.ResourceType | The ResourceType parameter is invalid. | The ResourceType parameter is invalid. |
403 | InvalidParameter.TagKey | The Tag.N.Key parameter is invalid. | The Tag.N.Key parameter is invalid. |
403 | MetaTagKeyNotFound | The meta tag key is not found. | - |
404 | Missing.TagKey | Tag.N.Value has been specified and you must specify Tag.N.Key. | Tag.N.Value has been specified and you must specify Tag.N.Key. |
404 | MissingParameter.TagKey | You must specify TagKey. | You must specify TagKey. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|