You can call this operation to create tags and bind the tags to a resource.

Description

If TagKey is specified, the new TagValue value overrides the original TagValue value.

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

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 region ID of the resource.

ResourceId.N RepeatList Yes ecd-ia2zw38bi6cm7****

The ID of the resource, which is the ID of the cloud desktop. Valid values of N: 1 to 50.

ResourceType String Yes ALIYUN::GWS::INSTANCE

The type of the resource. Set the value to ALIYUN::GWS::INSTANCE.

Tag.N.Key String No TestKey

The key of tag N. Valid values of N: 1 to 20.

The tag key cannot be an empty string. It can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.

Tag.N.Value String No TestValue

The value of tag N. Valid values of N: 1 to 20.

The tag value can be an empty string. It can be up to 128 characters in length. It cannot start with acs: or contain http:// or https://.

Response parameters

Parameter Type Example Description
RequestId String 3EB7FCEE-D731-4948-85A3-4B2C341CA983

The ID of the request.

Examples

Sample requests

https://ecd.cn-hangzhou.aliyuncs.com/?Action=TagResources
&RegionId=cn-hangzhou
&ResourceId.1=ecd-ia2zw38bi6cm7****
&ResourceType=ALIYUN::GWS::INSTANCE
&<Common Request Parameters>

Sample success responses

XML format

<TagResourcesResponse>
      <RequestId>3EB7FCEE-D731-4948-85A3-4B2C341CA983</RequestId>
</TagResourcesResponse>

JSON format

{
    "RequestId":"3EB7FCEE-D731-4948-85A3-4B2C341CA983"
}

Error codes

For a list of error codes, visit the API Error Center.