Queries the values of a specified tag key.
In this example, the values of the tag key k1
in the cn-hangzhou
region are queried. The returned result shows that the value of the tag key k1
is v1
.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListTagValues |
The operation that you want to perform. Set the value to ListTagValues. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the resources. |
Key | String | Yes | k1 |
The tag key. |
NextToken | String | No | caeba0bbb2be03f84eb48b699f0a**** |
The token that is used to start the next query. |
PageSize | Integer | No | 50 |
The number of tag values to return on each page. Maximum value: 1000. Default value: 50. |
ResourceType | String | No | ALIYUN::ECS::INSTANCE |
The type of the resource. For more information about supported resource types, see Types of resources that support Tag API operations. |
For more information about common parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
NextToken | String | caeba0bbb2be03f84eb48b699f0a**** |
The token that is used to start the next query. If the value of this parameter is empty, all results are returned. |
RequestId | String | 8989CA7E-D2E0-4B6D-8282-311106E80150 |
The ID of the request. |
Values | List | v1 |
The information of the tag values. |
Examples
Sample requests
https://tag.aliyuncs.com/?Action=ListTagValues
&RegionId=cn-hangzhou
&Key=k1
&<Common request parameters>
Sample success responses
XML
format
<ListTagValuesResponse>
<NextToken></NextToken>
<RequestId>8989CA7E-D2E0-4B6D-8282-311106E80150</RequestId>
<Values>
<Value>v1</Value>
</Values>
</ListTagValuesResponse>
JSON
format
{
"NextToken": "",
"RequestId": "8989CA7E-D2E0-4B6D-8282-311106E80150",
"Values": {
"Value": [
"v1"
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
403 | Invalid.NextToken | The parameter NextToken is invalid. | The error message returned because the value of the NextToken parameter is invalid. |
404 | Missing.TagKey | Tag.N.Value has been specified and you must specify Tag.N.Key. | The error message returned because the key of Tag N is not specified. |
404 | MissingParameter.TagKey | You must specify TagKey. | The error message returned because the TagKey parameter is not specified. |
403 | NoPermission.Operator | The user is not authorized to operate on the specified resource. | The error message returned because you are not authorized to perform the operation. |
403 | NoPermissionKey.Operator | You are not authorized to operate the tag key. | The error message returned because you are not authorized to perform operations on the tag key. |
403 | InvalidParameter.ResourceType | The ResourceType parameter is invalid. | The error message returned because the value of the ResourceType parameter is invalid. |
403 | InvalidParameter.TagKey | The Tag.N.Key parameter is invalid. | The error message returned because the value of the TagKey parameter is invalid. |
For a list of error codes, visit the API Error Center.