You can call the ListClusters operation to query the list of all clusters in each region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes ListClusters

The operation that you want to perform. This parameter is required for API requests that you create by piecing together HTTP or HTTPS URLs. Set the value to ListClusters.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call DescribeRegions Interface to view the latest list of Alibaba Cloud regions.

ClusterTypeList.N RepeatList No ["HADOOP","KAFKA"]

List of cluster types:

  • HADOOP
  • KAFKA
  • GATEWAY
  • DRUID
  • ZOOKEEPER
  • DATA_SCIENCE
CreateType String No ON-DEMAND

The method in which the cluster was created. Valid values:

  • ON-DEMAND: Create ON DEMAND
  • MANUAL: manually created
MachineType String No ECS

The instance type. The default value is ECS.

StatusList.N RepeatList No ["CREATING","IDLE"]

The status of the job instance. Valid values:

  • CREATING: the cluster is being created.
  • CREATE_FAILED: the cluster fails to be created.
  • RUNNING
  • IDLE: the cluster is IDLE.
  • RELEASING: the cluster is being released.
  • RELEASE_FAILED: the cluster fails to be released.
  • RELEASED: the cluster has been RELEASED.
  • WAIT_FOR_PAY: to be paid
  • ABNORMAL: the cluster status is ABNORMAL.
IsDesc Boolean No false

Whether to reverse the order:

  • true
  • false
DepositType String No HALF_MANAGED

Hosting type:

  • HALF_MANAGED: Semi-managed
  • MANAGED: fully MANAGED
PageNumber Integer No 1

The number of the page to return. Pages start from page 1.

PageSize Integer No 10

The number of entries returned per page.

DefaultStatus Boolean No true

Specifies whether to query the clusters that are in the initializing, to-be-deployed, idle, running, releasing, and failed-to-be-created states.

Name String No cluster_name

The name of the cluster.

ResourceGroupId String No rg-bp67acfmxazb4p****

The ID of the resource group to which the snapshot belongs. You can call ListResourceGroups View the resource group ID.

Tag.N.Key String No TestKey

The key of Tag n of the EMR instance and ECS instance on the node. Valid values of N: 1 to 20 The tag key cannot be an empty string. The tag key must be 1 to 128 in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.

Tag.N.Value String No TestValue

The tag value of the EMR instance and ECS instance on the node. Valid values of N: 1 to 20. The tag value can be an empty string. The value of the tag ranges from 1 to 128. It cannot start with acs: and cannot contain http:// or https://.

ExpiredTagList.N RepeatList No 0

A reserved parameter. You do not need to specify this parameter.

Response parameters

Parameter Type Example Description
Clusters Array of ClusterInfo

The list of clusters available in a project.

ClusterInfo
ChargeType String PostPaid

The billing method of the instance. Default value: Postpaid. Valid values:

  • PostPaid: pay-as-you-go clusters
  • PrePaid: subscription cluster
CreateResource String ECM_EMR

The tags that are automatically attached to the EMR cluster.

CreateTime Long 1542784048000

The time when the template was created.

DepositType String HALF_MANAGED

Hosting type:

  • HALF_MANAGED: Semi-managed
  • MANAGED: fully MANAGED
ExpiredTime Long 1542784048000

The time-out period of the subscription cluster.

Note This parameter is not reflected in pay-as-you-go clusters.
FailReason Struct

The reason why the creation of the cluster fails.

ErrorCode String InvalidImageId.NotFound

The error code of the failure.

ErrorMsg String The specified ImageId does not exist.

The error message.

RequestId String B8DC3A91-3953-4444-92BB-DBC29C47EC1A

The ID of the request.

HasUncompletedOrder Boolean false

Whether there are outstanding orders:

  • true
  • false
Id String C-010A704DA760****

The ID of the cluster.

K8sClusterId String N/A

A reserved parameter.

MachineType String ECS

The host type of the cluster. Currently, the host type is ECS instances by default.

MetaStoreType String LOCAL

Metadata type:

  • LOCAL: internal metadata of the cluster
  • UNIFIED: UNIFIED metadata
  • USER_RDS: User-created RDS
Name String cluster_name

The name of the cluster.

OperationId Long 1111

The ID of the operation.

OrderList String 0

The list of orders.

OrderTaskInfo Struct

A reserved parameter that indicates the information of orders.

CurrentCount Integer 0

A reserved parameter. You do not need to specify this parameter.

OrderIdList String 0

A reserved parameter. You do not need to specify this parameter.

TargetCount Integer 0

A reserved parameter. You do not need to specify this parameter.

Period Integer 10

The validity period of the subscription cluster. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36. Unit: months.

RunningTime Integer 2345

Run time. Unit: seconds.

Status String IDEL

The status of the cluster.

Tags Array of Tag

The information of a tag.

Tag
TagKey String DevDept

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

TagValue String DevNianmin

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

Type String HADOOP

The type of ACK cluster. Valid values:

PageNumber Integer 1

The number of the returned page.

PageSize Integer 10

The number of automatic snapshot tasks returned per page.

RequestId String BF4FBAC6-B03E-4BFB-B6DB-EB53C34F2E22

The ID of the request.

TotalCount Integer 12

The total number of hosts that you have queried.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListClusters
&RegionId=cn-hangzhou
&<common request parameters>

Sample success responses

XML format

<ListClustersResponse>
      <clusters>
            <chargeType>PostPaid</chargeType>
            <createResource>ECM_EMR</createResource>
            <createTime>1542784048000</createTime>
            <failReason></failReason>
            <hasUncompletedOrder>false</hasUncompletedOrder>
            <id>C-010A704DA760****</id>
            <name>jy_test_d1_test</name>
            <orderTaskInfo></orderTaskInfo>
            <runningTime>3138</runningTime>
            <status>RELEASED</status>
            <type>HADOOP</type>
      </clusters>
      <clusters>
            <chargeType>PostPaid</chargeType>
            <createResource>ECM_EMR</createResource>
            <createTime>1538107586000</createTime>
            <failReason></failReason>
            <hasUncompletedOrder>false</hasUncompletedOrder>
            <id>C-B9712209060C****</id>
            <name>intelligence-313-yp</name>
            <orderTaskInfo></orderTaskInfo>
            <runningTime>2069400</runningTime>
            <status>RELEASED</status>
            <type>HADOOP</type>
      </clusters>
      <clusters>
            <chargeType>PostPaid</chargeType>
            <createResource>ECM_EMR</createResource>
            <createTime>1536546078000</createTime>
            <failReason></failReason>
            <hasUncompletedOrder>false</hasUncompletedOrder>
            <id>C-4CD9EBBD6B23****</id>
            <name>mg-storm</name>
            <orderTaskInfo></orderTaskInfo>
            <runningTime>1382155</runningTime>
            <status>RELEASED</status>
            <type>HADOOP</type>
      </clusters>
      <clusters>
            <chargeType>PostPaid</chargeType>
            <createResource>ECM_EMR</createResource>
            <createTime>1535363759000</createTime>
            <failReason></failReason>
            <hasUncompletedOrder>false</hasUncompletedOrder>
            <id>C-75D6EE95D722****</id>
            <name>df-3101-upgrade-test</name>
            <orderTaskInfo></orderTaskInfo>
            <runningTime>676284</runningTime>
            <status>RELEASED</status>
            <type>HADOOP</type>
      </clusters>
      <clusters>
            <chargeType>PostPaid</chargeType>
            <createResource>ECM_EMR</createResource>
            <createTime>1534492361000</createTime>
            <failReason>
                  <errorCode>InvalidImageId.NotFound</errorCode>
                  <errorMsg>The specified ImageId does not exist.</errorMsg>
                  <requestId>B8DC3A91-3953-4444-92BB-DBC29C47EC1A</requestId>
            </failReason>
            <hasUncompletedOrder>false</hasUncompletedOrder>
            <id>C-5EF0F3C257B****</id>
            <name>Test cluster 1</name>
            <orderTaskInfo></orderTaskInfo>
            <runningTime>0</runningTime>
            <status>CREATE_FAILED</status>
            <type>HADOOP</type>
      </clusters>
      <pageNumber>1</pageNumber>
      <pageSize>5</pageSize>
      <requestId>5443DB14-4641-4DFF-9226-4888EC5A2EA9</requestId>
      <totalCount>11</totalCount>
</ListClustersResponse>

JSON Syntax

{
    "clusters": [
        {
            "chargeType": "PostPaid",
            "createResource": "ECM_EMR",
            "createTime": 1542784048000,
            "failReason": {},
            "hasUncompletedOrder": false,
            "id": "C-010A704DA760****",
            "name": "jy_test_d1_test",
            "orderTaskInfo": {},
            "runningTime": 3138,
            "status": "RELEASED",
            "type": "HADOOP"
        },
        {
            "chargeType": "PostPaid",
            "createResource": "ECM_EMR",
            "createTime": 1538107586000,
            "failReason": {},
            "hasUncompletedOrder": false,
            "id": "C-B9712209060C****",
            "name": "intelligence-313-yp",
            "orderTaskInfo": {},
            "runningTime": 2069400,
            "status": "RELEASED",
            "type": "HADOOP"
        },
        {
            "chargeType": "PostPaid",
            "createResource": "ECM_EMR",
            "createTime": 1536546078000,
            "failReason": {},
            "hasUncompletedOrder": false,
            "id": "C-4CD9EBBD6B23****",
            "name": "mg-storm",
            "orderTaskInfo": {},
            "runningTime": 1382155,
            "status": "RELEASED",
            "type": "HADOOP"
        },
        {
            "chargeType": "PostPaid",
            "createResource": "ECM_EMR",
            "createTime": 1535363759000,
            "failReason": {},
            "hasUncompletedOrder": false,
            "id": "C-75D6EE95D722****",
            "name": "df-3101-upgrade-test",
            "orderTaskInfo": {},
            "runningTime": 676284,
            "status": "RELEASED",
            "type": "HADOOP"
        },
        {
            "chargeType": "PostPaid",
            "createResource": "ECM_EMR",
            "createTime": 1534492361000,
            "failReason": {
                "errorCode": "InvalidImageId.NotFound",
                "errorMsg": "The specified ImageId does not exist.",
                "requestId": "B8DC3A91-3953-4444-92BB-DBC29C47EC1A"
            },
            "hasUncompletedOrder": false,
            "id": "C-5EF0F3C257B****",
            "name": "Test cluster 1",
            "orderTaskInfo": {},
            "runningTime": 0,
            "status": "CREATE_FAILED",
            "type": "HADOOP"
        }
    ],
    "pageNumber": 1,
    "pageSize": 5,
    "requestId": "5443DB14-4641-4DFF-9226-4888EC5A2EA9",
    "totalCount": 11
}