Queries the tags of specific resources, or queries the resources to which specific tags are added.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListTagResources

The operation that you want to perform. Set the value to ListTagResources.

ResourceType String Yes ZONE

The resource type. Valid value: ZONE.

Lang String No en

The language of the values of specific response parameters. Valid values: en, zh, and ja.

NextToken String No 234235354

The token used to start the next query.

Size Integer No 20

The number of entries to return on each page. This parameter is equivalent to the PageSize parameter used in other API operations. Valid values: [1,200]. Default value: 20.

ResourceId.N RepeatList No 97fe9321a476d0861f624d3f738dcc38

The resource ID, which is a zone ID. The number N in the parameter name is used to identify different IDs. You can specify 1 to 50 IDs.

Tag.N.Key String No env

The key of the tag. The number N in the parameter name is used to identify different tags.

Tag.N.Value String No daily

The value of the tag. The number N in the parameter name is used to identify different tags.

Response parameters

Parameter Type Example Description
NextToken String 234235354

The token used to start the next query. If the NextToken parameter is empty, no subsequent query is sent.

RequestId String 75446CC1-FC9A-4595-8D96-089D73D7A63D

The ID of the request.

TagResources Array of TagResource

The information about the queried resources or tags.

ResourceId String 97fe9321a476d0861f624d3f738dcc38

The resource ID, which is a zone ID.

ResourceType String ZONE

The resource type.

TagKey String env

The key of the tag.

TagValue String daily

The value of the tag.

Examples

Sample request

http(s)://pvtz.aliyuncs.com/?Action=ListTagResources
&ResourceType=ZONE
&<Common request parameters>

Sample success responses

XML format

<NextToken>234235354</NextToken>
<RequestId>75446CC1-FC9A-4595-8D96-089D73D7A63D</RequestId>
<TagResources>
    <ResourceId>75446CC1-FC9A-4595-8D96-089D73D7A63D</ResourceId>
    <TagKey>env</TagKey>
    <ResourceType>ZONE</ResourceType>
    <TagValue>daily</TagValue>
</TagResources>

JSON format

{
    "NextToken": "234235354",
    "RequestId": "75446CC1-FC9A-4595-8D96-089D73D7A63D",
    "TagResources": [
        {
            "ResourceId": "75446CC1-FC9A-4595-8D96-089D73D7A63D",
            "TagKey": "env",
            "ResourceType": "ZONE",
            "TagValue": "daily"
        }
    ]
}

Error codes

For a list of error codes, visit the API Error Center.