Adds tags to resources of Global Accelerator (GA).

Usage notes

You can add up to 20 tags to each resource. Before you add tags to a resource, Alibaba Cloud checks the number of existing tags of the resource. If the quota is reached, an error message is 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
ActionStringYesTagResources

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

RegionIdStringYescn-hangzhou

The ID of the region where the Global Accelerator (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. ClientToken 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 of each API request may be different.
ResourceTypeStringYesaccelerator

The type of the resource to which you want to add tags. 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 to which you want to add tags.

  • If you set the ResourceType parameter to accelerator, set the value of ResourceId to the ID of a standard GA instance.
  • If you set the ResourceType parameter to basicaccelerator, set the value of ResourceId to the ID of a basic GA instance.
  • If you set the ResourceType parameter 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 access control list (ACL).

The parameter is required. You can enter at most 50 GA resource IDs.

Tag.N.KeyStringNoKeyTest

The tag key of the resource. The tag key cannot be an empty string.

The tag key can be up to 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.

Examples

Sample requests

http(s)://[Endpoint]/?Action=TagResources
&RegionId=cn-hangzhou
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&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

<TagResourcesResponse>
    <RequestId>54B48E3D-DF70-471B-AA93-08E683A1B45</RequestId>
</TagResourcesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

Error codes

For a list of error codes, see Service error codes.