You can call this operation to attach tags to AnalyticDB for MySQL 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
Action String Yes TagResources

The operation that you want to perform. Set this parameter to TagResources.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

ResourceId.N RepeatList Yes am-bp1xxx.1

The ID of a cluster. You can attach tags to a maximum of 50 clusters at a time. The N value that follows the ID of each cluster must be unique and must be consecutive integers that start from 1. For example, am-bp1xxx.1 and am-bp2xxx.2.

ResourceType String Yes ALIYUN::ADB::CLUSTER

The type of the cluster. Set the value to ALIYUN::ADB::CLUSTER.

Tag.N.Key String No a

The tag key. You can attach a maximum of 20 key-value pairs of tags at a time. The N value 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 tag value. You can attach a maximum of 20 key-value pairs of tags at a time. The N value 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=am-bp1xxx.1
&ResourceType=ALIYUN::ADB::CLUSTER
&Tag.1.Key=a
&Tag.1.Value=1
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

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