TagResources
Creates and binds tags to specified app instance groups according to Alibaba Cloud tag specifications. If a tag with the same key already exists on a resource, the tag value is updated to the value specified in the current request. Currently, only the app instance group (`APPINSTANCEGROUP`) resource type is supported.
Operation description
Prerequisites
When you call this operation as a RAM user or by using STS credentials, 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 app instance group resources. You must set ResourceType to APPINSTANCEGROUP. You can obtain the app instance group ID by calling ListAppInstanceGroup.
Tag rules
A single request 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, and 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 cannot be duplicate. Otherwise, the error code
InvalidTag.Duplicatedis returned.A 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 single resource can be bound to up to 20 custom tags. If this limit is exceeded, the error code
ResourceTag.CustomTagCountExceedis returned.
Execution results
If any specified app instance group does not exist or does not belong to the current account, the entire request fails, and the error code
InvalidAppInstanceGroup.NotFoundis returned. No tags are bound to any resources.If the binding is successful, the response contains only RequestId and does not return tag details.
If multiple resources are specified and the binding fails for only some of the resources, the operation still returns a success response, and the response does not contain failure details. Call ListTagResources to verify the binding results. If only one resource is specified and the binding fails, the operation directly returns the corresponding error code.
Call sequence
Call ListAppInstanceGroup to obtain the IDs of the app instance groups to which you want to bind tags.
Call this operation and specify ResourceType=
APPINSTANCEGROUP, ResourceId.N, and Tag.N.Key/Tag.N.Value.To view the tags bound to a resource, call ListTagResources. To unbind tags, call UntagResources.
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
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
appstreaming:TagResources |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. This parameter is required. Specify the ID of the region where the app instance group resides, such as |
cn-hangzhou |
| ResourceType |
string |
Yes |
The resource type. This parameter is required. Currently, only app instance groups are supported. The value is case-insensitive, but we recommend that you use uppercase letters:
If you specify other values, 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 the app instance group IDs. You can specify up to 50 IDs in a single request. Duplicate IDs are automatically deduplicated. All IDs must belong to existing app instance 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 app instance group ID. You can obtain the ID by calling ListAppInstanceGroup. |
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. You must specify both Key and Value for each tag.
Tag keys starting with
If you specify other tag keys starting 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. It 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. Empty strings are allowed. It cannot contain If the tag key is a system tag, the tag value can only be |
720p |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response of the request. If the binding is successful, only the request ID is returned. |
||
| RequestId |
string |
The request ID. You can use the request ID to troubleshoot request 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.