TagResources

Updated at:

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 aliyun or acs: (case-insensitive). Neither tag keys nor tag values can contain http:// or https://.

  • Tag keys in the same request must be unique. Otherwise, the error code InvalidTag.Duplicated is 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.CustomTagCountExceed is 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.NotFound is returned, and no tags are bound to any resource.

  • If the binding succeeds, the response contains only RequestId and 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 ListTagResources to verify the binding results. If only one resource is specified and the binding fails, the operation returns the corresponding error code.

Call sequence

  1. Call ListAppInstanceGroup to obtain the IDs of the delivery groups to which you want to add tags.

  2. Call this operation with ResourceType=APPINSTANCEGROUP, ResourceId.N, and Tag.N.Key/Tag.N.Value.

  3. To view the tags bound to resources, 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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

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.

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:

  • APPINSTANCEGROUP: China Office (Chinese: Wuying) delivery group.

If you specify another value, the error code InvalidResourceType.Invalid is returned.

Valid values:

  • APPINSTANCEGROUP :

    China Office (Chinese: Wuying) delivery group.

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 InvalidAppInstanceGroup.NotFound is returned. No tags are bound to any resource.

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 Key and Value.

  • Tag keys in the same request must be unique. Otherwise, the error code InvalidTag.Duplicated is returned.

  • If a tag key already exists on the resource, the tag value is updated to the value specified in the current request.

  • A maximum of 20 custom tags can be bound to a single resource. If this limit is exceeded, the error code ResourceTag.CustomTagCountExceed is returned.

Tag keys that start with System/ are China Office (Chinese: Wuying) system tags. Only the following values are supported, and the tag value can be only true or false:

  • System/Scheduler/GRAYSCALE: the canary release tag for the delivery group.

  • System/Scheduler/STOP_NEW_USER_CONNECTION: prevents newly bound users from establishing connections to the delivery group.

If you specify other tag keys that start with System/, the error code InvalidTag.SystemTagKeyInvalid or InvalidTag.SystemKeyNotAllow is returned.

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 aliyun or acs: (case-insensitive) and cannot contain http:// or https://. Letters, digits, spaces, and common punctuation marks are supported. If the tag key does not comply with the rules, the error code InvalidTagPolicy.KeyInvalid is returned.

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 http:// or https://. If the tag value does not comply with the rules, the error code InvalidTagPolicy.ValueInvalid is returned.

If the tag key is a system tag, the tag value can be only true or false.

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.