TagResources
Creates and binds tags to specified China Office (Chinese: Wuying) delivery groups in compliance with Alibaba Cloud tag specifications. If a tag key already exists on a resource, the tag value is updated to the value specified in the current request. Currently, only delivery group (`APPINSTANCEGROUP`) resource types are supported.
Operation description
Before you begin
When you use a RAM user or Security Token Service (STS) credential to call this operation, you must have the appstreaming:TagResources permission.
The resources to which you want to bind tags must belong to the current Alibaba Cloud account. This operation currently supports only delivery group resources. You can set ResourceType only to APPINSTANCEGROUP. You can call ListAppInstanceGroup to obtain delivery group IDs.
Tag rules
In a single request, you can bind up to 20 tags to up to 50 resources. Duplicate resource IDs are automatically deduplicated.
A tag key must be 1 to 128 characters in length. A tag value must be 0 to 256 characters in length. Both are case-sensitive.
A tag key cannot start with
aliyunoracs:(case-insensitive). Neither tag keys nor tag values can containhttp://orhttps://.Tag keys in the same request must be unique. Otherwise, the error code
InvalidTag.Duplicatedis returned.Each tag key on a resource can correspond to only one tag value. If the tag key already exists on the resource, the tag value is updated to the new value.
A maximum of 20 custom tags can be bound to a single resource. If this limit is exceeded, the error code
ResourceTag.CustomTagCountExceedis returned.
Results
If any specified delivery group does not exist or does not belong to the current account, the entire request fails. The error code
InvalidAppInstanceGroup.NotFoundis returned, and no tags are bound to any resource.If the binding succeeds, the response contains only
RequestIdand does not return tag details.If multiple resources are specified and only some of them fail to be bound, the operation still returns a success response without failure details. Call
ListTagResourcesto verify the binding results. If only one resource is specified and the binding fails, the operation returns the corresponding error code.
Call sequence
Call ListAppInstanceGroup to obtain the IDs of the delivery groups to which you want to add tags.
Call this operation with
ResourceType=APPINSTANCEGROUP,ResourceId.N, andTag.N.Key/Tag.N.Value.To view the tags bound to resources, call
ListTagResources. To unbind tags, callUntagResources.
The masked identifiers in the examples are used to demonstrate the format. Replace them with your actual identifiers when you call the operation.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. This parameter is required. Set this parameter to the ID of the region where the delivery group resides, such as |
cn-hangzhou |
| ResourceType |
string |
Yes |
The resource type. This parameter is required. Currently, only delivery groups are supported. The value is case-insensitive. We recommend that you use uppercase letters. Valid values:
If you specify another value, the error code Valid values:
|
APPINSTANCEGROUP |
| ResourceId |
array |
Yes |
The list of resource IDs to which you want to bind tags. This parameter is required. Specify delivery group IDs. You can specify up to 50 IDs in a single request. Duplicate IDs are automatically deduplicated. All IDs must be existing delivery groups under the current Alibaba Cloud account. If any ID does not exist or does not belong to the current account, the entire request fails and the error code |
|
|
string |
Yes |
The delivery group ID. You can call ListAppInstanceGroup to obtain the ID. |
aig-9ciijz60n4xsv**** |
|
| Tag |
array<object> |
Yes |
The list of tags to bind. This parameter is required. You can specify up to 20 tags in a single request. Each tag must include both
Tag keys that start with
If you specify other tag keys that start with |
|
|
object |
Yes |
The key-value pair of a tag. |
||
| Key |
string |
Yes |
The tag key. This parameter is required. The tag key must be 1 to 128 characters in length and is case-sensitive. The tag key cannot start with |
Resolution |
| Value |
string |
Yes |
The tag value. This parameter is required. The tag value must be 0 to 256 characters in length and is case-sensitive. An empty string is allowed. The tag value cannot contain If the tag key is a system tag, the tag value can be only |
720p |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response to this request. If the binding succeeds, only the request ID is returned. |
||
| RequestId |
string |
The request ID, which can be used to troubleshoot issues. |
1CBAFFAB-B697-4049-A9B1-67E1FC5F**** |
Examples
Success response
JSON format
{
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | ServiceUnavailable | Service unavailable. Please try again later. | Service unavailable. Please try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.