Creates tags for one or more 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
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 cluster.

ResourceType String Yes cluster

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

Tag.N.Key String No type

The tag key. To create multiple tags for a cluster at a time, click Add to add tags.

Note You can create up to 20 key-value pairs of tags at a time. Each value of Tag.N.Key is paired with a value of Tag.N.Value.
Tag.N.Value String No test

The tag value. To create multiple tags for a cluster at a time, click Add to add tags.

Note You can create up to 20 key-value pairs of tags at a time. 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 1CB5286F-AF5A-4E09-BFE9-588D4C******

The ID of the request.

Examples

Sample requests

https://polardb.aliyuncs.com/?Action=TagResources
&RegionId=cn-hangzhou
&ResourceType=cluster
&ResourceId=["pc-*****************"]
&Tag=[{"Key":"type","Value":"test"}]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<TagResourcesResponse>
    <RequestId>1CB5286F-AF5A-4E09-BFE9-588D4C******</RequestId>
</TagResourcesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "1CB5286F-AF5A-4E09-BFE9-588D4C******"
}

Error codes

HTTP status code Error code Error message Description
400 NumberExceed.Tags The number of tags is exceed , Valid : 20 The error message returned because the number of created tags exceeds the upper limit. You can create up to 20 tags for a cluster.

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