You can call this operation to create and bind tags to specified EMR clusters.

The limits for calling this operation are as follows:

  • You can bind a cluster with a maximum of 20 tags.
  • Tags bound to the EMR cluster are synchronized to the ECS instances on the node.

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 No TagResources

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

RegionId String Yes cn-hangzhou

The ID of the region where your cluster resides.

ResourceId.N RepeatList Yes C- 3652B95F6596 automatic snapshot policies *

The IDs of N resources. Valid values of N: 1 to 50.

ResourceType String Yes cluster

The type of the resource. Select cluster from the EMR cluster drop-down list.

Tag.N.Key String Yes DevDept

The key of tag N of the resource. Valid values of N: 1 to 20. It cannot be an empty string. The value range of a tag key is 1-128. The tag key cannot start with aliyun or acs: and cannot contain http:// or https://.

Tag.N.Value String No DevNianmin

The value of tag N of the resource. Valid values of N: 1 to 20. It can be an empty string. The value range of the tag is 1-128. The tag value cannot start with acs: and cannot contain http:// or https://.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests:

http(s)://[Endpoint]/? Action=TagResources
&RegionId=cn-hangzhou    
&ResourceId.1=C-3652B95F6596 static website hosting *
&ResourceType=cluster
&Tag.1.Key=DevDept
&<Common request parameters>

Sample success responses

XML format

<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>

JSON format

{"RequestId":"473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"}

Error codes

HTTP status code Error code Error message Description
500 InternalError The request processing has failed due to some unknown error. The error message returned because the request processing has failed due to an internal error. Submit a ticket.

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