You can call this operation to query tags that are bound to one or more EMR clusters.

Note the following information when you call this operation:

  • Specify at least one parameter: ResourceId.N and Tag.N(Tag.N.Key and Tag.N.Value) in the request to determine the query object.
  • When both Tag.N and ResourceId.N are specified, only the EMR clusters that meet both of the specified conditions are returned.

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 ListTagResources

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

RegionId String Yes cn-hangzhou

The ID of the region where your cluster resides.

ResourceType String Yes cluster

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

ResourceId.N RepeatList No C- 3652B95F65967 deployment environment *

The ID of the EMR cluster. Valid values of N: 1 to 50.

Tag.N.Key String No DevDept

The tag key that is used for exact match of the EMR cluster. Valid values of the tag key: 1 to 128. Valid values of N: 1 to 20.

Tag.N is used to precisely search for the EMR cluster bound to a specified Tag. It consists of a key-value pair.

  • When only Tag.N.Key is specified, all clusters associated with this tag key are returned.
  • If you only specify Tag.N.Value, the InvalidParameter.TagValue error occurs.
  • When you specify multiple tag key-value pairs at the same time, only EMR clusters that match all tag key-value pairs can be found.
Tag.N.Value String No DevNianmin

The tag value that is used for exact match of the EMR cluster. Valid values of the tag value: 1 to 128. Valid values of N: 1 to 20.

NextToken String No Configure static website hosting *

The token that is returned for the next query.

Response parameters

Parameter Type Example Description
NextToken String Configure static website hosting *

The token that is returned for the next query.

RequestId String DE65F6B7-7566-4802-9007-96F2494AC5XX

The ID of the request.

TagResources Array

A collection of clusters and tags, including the cluster ID, resource type, and tag key-value pair.

TagResource
ResourceId String C- 3652B95F6596 automatic snapshot policies *

The ID of the Apsara PolarDB cluster that you want to manage.

ResourceType String cluster

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

TagKey String DevDept

The tag key of the disk.

TagValue String DevNianmin

The tag value of the disk.

Examples

Sample requests:

http(s)://[Endpoint]/? Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=cluster
&<Common request parameters>

Sample success responses

XML format

<RequestId>DE65F6B7-7566-4802-9007-96F2494AC5XX</RequestId>
<NextToken>caeba0bbb2be03f84eb48b699f0a****</NextToken>
<TagResources>
    <TagResource>
        <ResourceId>C-3652B95F6596****</ResourceId>
        <TagKey>DevDept</TagKey>
        <ResourceType>cluster</ResourceType>
        <TagValue>DevNianmin</TagValue>
    </TagResource>
</TagResources>

JSON format

{"RequestId":"DE65F6B7-7566-4802-9007-96F2494AC5XX","NextToken":"caeba0bbb2be03f84eb48b699f0a****","TagResources":{"TagResource":[{"ResourceId":"C-3652B95F6596****","TagKey":"DevDept","ResourceType":"cluster","TagValue":"DevNianmin"}]}}

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.