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
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | TagResources | The operation that you want to perform. Set the value to TagResources. |
RegionId | String | Yes | cn-hangzhou | The ID of the region where the Global Accelerator (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. 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. |
ResourceType | String | Yes | accelerator | The type of the resource to which you want to add tags. Valid values:
|
ResourceId.N | String | No | ga-bp149u6o36qt1as9b**** | The ID of the resource to which you want to add tags.
The parameter is required. You can enter at most 50 GA resource IDs. |
Tag.N.Key | String | No | KeyTest | 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 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. |
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.