All Products
Search
Document Center

Resource Management:ListTagValues

Last Updated:Mar 03, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

For more information about region IDs, see Endpoints .

cn-hangzhou
KeystringYes

The tag key. This parameter specifies a filter condition for the query.

k1
NextTokenstringNo

The token that is used to start the next query.

caeba0bbb2be03f84eb48b699f0a****
PageSizeintegerNo

The number of tag values to return on each page.

Maximum value: 1000. Default value: 50.

50
ResourceTypestringNo

The resource type. This parameter specifies a filter condition for the query.

Format: ALIYUN::${ProductCode}::${ResourceType}. All letters in the value of this parameter must be in uppercase.

  • ProductCode: the service code. You can set this field to a value obtained from the response of the ListSupportResourceTypes operation.
  • ResourceType: the resource type. You can set this field to a value obtained from the response of the ListSupportResourceTypes operation.
ALIYUN::ECS::INSTANCE
QueryTypestringNo

The category of the tags. This parameter specifies a filter condition for the query. Valid values:

  • ResourceTag: resource tags, including custom and system tags. This is the default value.
  • MetaTag: preset tags.
Note The value of this parameter is not case-sensitive.
ResourceTag
FuzzyTypestringNo

The type of the query. Valid values:

  • EQUAL: exact match. This is the default value.
  • PREFIX: prefix-based fuzzy match.
Note This parameter is available only in the China (Shenzhen) and China (Hong Kong) regions.
EQUAL
TagFilter.ValuestringNo

The tag value.

This parameter is used together with the FuzzyType parameter.

Note This parameter is available only in the China (Shenzhen) and China (Hong Kong) regions.
v1

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

NextTokenstring

Indicates whether the next query is required. The value of this parameter may be empty.

  • If the value of this parameter is empty ("NextToken": ""), all results are returned, and the next query is not required.
  • If the value of this parameter is not empty, the next query is required, and the value is the token used to start the next query.
caeba0bbb2be03f84eb48b699f0a****
RequestIdstring

The ID of the request.

8989CA7E-D2E0-4B6D-8282-311106E80150
Valuesarray

The information of the tag values.

string

The information of the tag values.

v1

Examples

Sample success responses

JSONformat

{
  "NextToken": "caeba0bbb2be03f84eb48b699f0a****",
  "RequestId": "8989CA7E-D2E0-4B6D-8282-311106E80150",
  "Values": {
    "Value": [
      "v1"
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400FuzzyQuery.NotSupportThe fuzzy query is not supported.-
403Invalid.NextTokenThe parameter NextToken is invalid.The parameter NextToken is invalid.
403NoPermission.OperatorThe user is not authorized to operate on the specified resource.The user is not authorized to operate on the specified resource.
403NoPermissionKey.OperatorYou are not authorized to operate the tag key.You are not authorized to operate the tag key.
403InvalidParameter.ResourceTypeThe ResourceType parameter is invalid.The ResourceType parameter is invalid.
403InvalidParameter.TagKeyThe Tag.N.Key parameter is invalid.The Tag.N.Key parameter is invalid.
403MetaTagKeyNotFoundThe meta tag key is not found.-
404Missing.TagKeyTag.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.
404MissingParameter.TagKeyYou must specify TagKey.You must specify TagKey.

For a list of error codes, visit the Service error codes.