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

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

ParameterTypeRequiredExampleDescription
ActionStringYesListTagResources

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

RegionIdStringYescn-hangzhou

The ID of the region where the GA instance is deployed. Set the value to cn-hangzhou.

ClientTokenStringNo123e4567-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.
NextTokenStringNoFFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If this is your first and only query, ignore this parameter.
  • If a next query is to be performed, set the value to the NextToken value returned in the last call to the ListTagResources operation.
ResourceTypeStringYesaccelerator

The type of the resource whose tag information you want to query. Valid values:

  • accelerator: a standard GA instance.
  • basicaccelerator: a basic GA instance.
  • bandwidthpackage: a bandwidth plan.
  • acl: an access control list (ACL).
ResourceId.NStringNoga-bp149u6o36qt1as9b****

The ID of the resource whose tag information you want to query.

  • If ResourceType is set to accelerator, set the value of ResourceId to the ID of a standard GA instance.
  • If ResourceType is set to basicaccelerator, set the value of ResourceId to the ID of a basic GA instance.
  • If ResourceType is set to bandwidthpackage, set the value of ResourceId to the ID of a bandwidth plan.
  • If ResourceType is set to acl, set the value of ResourceId to the ID of an ACL.

You can enter up to 50 resource IDs.

Tag.N.KeyStringNoKeyTest

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 http:// or https://. It cannot start with aliyun or acs:.

You can specify up to 20 tag keys.

Tag.N.ValueStringNovalueTest

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 acs: or aliyun. The tag value cannot contain http:// or https://.

You can specify up to 20 tag values.

Response parameters

ParameterTypeExampleDescription
RequestIdString54B48E3D-DF70-471B-AA93-08E683A1B45

The ID of the request.

TotalCountInteger1

The number of entries returned.

NextTokenStringFFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If NextToken is not returned, it indicates that no additional results exist.
  • If NextToken is returned, the value is the token that is used for the next query.
TagResourcesArray of TagResource

The information about the resources to which tags are added.

TagResource
ResourceTypeStringaccelerator

The type of the resource.

  • accelerator: a standard GA instance.
  • basicaccelerator: a basic GA instance.
  • bandwidthpackage: a bandwidth plan.
  • acl: an ACL.
TagValueStringKeyTest

The tag value.

ResourceIdStringga-bp149u6o36qt1as9b****

The ID of the resource.

TagKeyStringvalueTest

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.