You can call this operation to create tags for ApsaraDB for POLARDB clusters.

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
RegionId String Yes cn-hangzhou

The ID of the region.

ResourceId.N RepeatList Yes pc-bp1xxx.1,pc-bp2xxx.2

The ID of the ApsaraDB for POLARDB cluster for which tags are to be created. You can create tags for a maximum of 50 clusters at a time. The number n that follows the ID of each cluster must be different and must be consecutive integers that start from 1. Example: pc-bp1xxx.1 and pc-bp2xxx.2.

ResourceType String Yes cluster

The type of the cluster. Set the value to cluster.

AccessKeyId String No key-test

The AccessKey ID provided to you by Alibaba Cloud.

Action String No TagResources

The operation that you want to perform. Set the value to TagResources.

Tag.N.Key String No test1

The key of the tag. You can create up to 20 key-value pairs of tags at a time. The number n in each key-value pair must be unique and must be consecutive integers that start from 1. Each value of the Tag.n.Key parameter is paired with a value of the Tag.n.Value parameter.

Tag.N.Value String No 1

The value of the tag. You can create up to 20 key-value pairs of tags at a time. The number n in each key-value pair must be unique and must be consecutive integers that start from 1. Each value of the Tag.n.Value parameter is paired with a value of the Tag.n.Key parameter.

Response parameters

Parameter Type Example Description
RequestId String 863D51B7-5321-41D8-A0B6-A088B0450EFD

The ID of the request.

Examples

Sample requests


http(s)://[Endpoint]/? Action=TagResources
&RegionId=cn-hangzhou
&ResourceId.1=pc-bp1xxx.1,pc-bp2xxx.2
&ResourceType=cluster
&Tag.1.Key=test1
&Tag.1.Value=1
&<Common request parameters>

Sample success responses

XML format

<TagResourcesResponse>
  <RequestId>863D51B7-5321-41D8-A0B6-A088B0450EFD</RequestId>
</TagResourcesResponse>

JSON format

{
	"RequestId":"863D51B7-5321-41D8-A0B6-A088B0450EFD"
}

Error codes

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