Queries the tags that are added to one or more resources of Global Accelerator (GA).
Usage notes
- You must specify ResourceId.N or Tag.N that consists of Tag.N.Key and Tag.N.Value in the request to specify the object that you want to query.
- Tag.N is a resource tag that consists of a key-value pair. If you specify only Tag.N.Key, all tag values that are associated with the specified tag key are returned. If you specify only Tag.N.Value, an error message is returned.
- If you specify Tag.N and ResourceId.N to filter tags, ResourceId.N must match all specified key-value pairs.
- If you specify multiple key-value pairs, resources that contain these key-value pairs are returned.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListTagResources | The operation that you want to perform. Set the value to ListTagResources. |
RegionId | String | Yes | cn-hangzhou | The ID of the region where the GA instance is deployed. Set the value to cn-hangzhou. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-426655440000 | The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters. Note If you do not set this parameter, the system sets ClientToken to the value of RequestId. The value of RequestId may be different for each API request. |
NextToken | String | No | FFmyTO70tTpLG6I3FmYAXGKPd**** | The token that is used for the next query. Valid values:
|
ResourceType | String | Yes | accelerator | The type of the resource whose tag information you want to query. Valid values:
|
ResourceId.N | String | No | ga-bp149u6o36qt1as9b**** | The ID of the resource whose tag information you want to query.
You can enter up to 50 resource IDs. |
Tag.N.Key | String | No | KeyTest | The tag key of the resource. The tag key cannot be an empty string. It can be at most 64 characters in length, and cannot contain You can specify up to 20 tag keys. |
Tag.N.Value | String | No | valueTest | The tag value of the resource. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with You can specify up to 20 tag values. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 54B48E3D-DF70-471B-AA93-08E683A1B45 | The ID of the request. |
TotalCount | Integer | 1 | The number of entries returned. |
NextToken | String | FFmyTO70tTpLG6I3FmYAXGKPd**** | The token that is used for the next query. Valid values:
|
TagResources | Array of TagResource | The information about the resources to which tags are added. | |
TagResource | |||
ResourceType | String | accelerator | The type of the resource.
|
TagValue | String | KeyTest | The tag value. |
ResourceId | String | ga-bp149u6o36qt1as9b**** | The ID of the resource. |
TagKey | String | valueTest | The tag key. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListTagResources
&RegionId=cn-hangzhou
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&ResourceType=accelerator
&ResourceId=["ga-bp149u6o36qt1as9b****"]
&Tag=[{"Key":"KeyTest","Value":"valueTest"}]
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListTagResourcesResponse>
<RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
<TotalCount>1</TotalCount>
<NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
<TagResources>
<ResourceType>accelerator</ResourceType>
<TagValue>KeyTest</TagValue>
<ResourceId>ga-bp149u6o36qt1as9b****</ResourceId>
<TagKey>valueTest</TagKey>
</TagResources>
</ListTagResourcesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45",
"TotalCount" : 1,
"NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
"TagResources" : [ {
"ResourceType" : "accelerator",
"TagValue" : "KeyTest",
"ResourceId" : "ga-bp149u6o36qt1as9b****",
"TagKey" : "valueTest"
} ]
}
Error codes
For a list of error codes, see Service error codes.