Queries tag keys.
Operation description
This topic provides an example on how to call the API operation to query the tag keys in the cn-hangzhou
region. The response shows that the following tag keys exist: team
, k1
, and k2
.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID. For more information about region IDs, see Endpoints . | cn-hangzhou |
NextToken | string | No | The token that is used to start the next query. | caeba0bbb2be03f84eb48b699f0a**** |
PageSize | integer | No | The number of tag keys to return on each page. Maximum value: 1000. Default value: 50. | 50 |
Category | string | No | The type of the resource tags. This parameter specifies a filter condition for the query. Valid values:
Note
The value of this parameter is not case-sensitive.
| all |
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:
Note
This parameter is available only in the China (Shenzhen) and China (Hong Kong) regions.
| EQUAL |
TagFilter.Key | string | No | The tag key. This parameter is used together with the Note
This parameter is available only in the China (Shenzhen) and China (Hong Kong) regions.
| team |
Response parameters
Examples
Sample success responses
JSON
format
{
"NextToken": "caeba0bbb2be03f84eb48b699f0a****",
"RequestId": "DC09A6AA-2713-4E10-A2E9-E6C5C43A8842",
"Keys": {
"Key": [
{
"Key": "team",
"Category": "custom",
"Description": "Business team"
}
]
}
}
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 | InvalidParameter.Category | The specified Category is invalid. Valid values are Custom and System. | The specified Category is invalid. Valid values are Custom and System. |
403 | InvalidParameter.ResourceType | The ResourceType parameter is invalid. | The ResourceType parameter is invalid. |
For a list of error codes, visit the Service error codes.