Call the ListClusters interface 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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListClusters

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

RegionId String Yes cn-hangzhou

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

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

Cluster type, with the following values:

  • HADOOP
  • KAFKA
  • DATA SCIENCE
  • DRUID
  • FLINK
  • GATEWAY
  • CLICKHOSUE
CreateType String No ON-DEMAND

The creation method of the cluster. The value is as follows:

  • ON-DEMAND: create on-demand
  • MANUAL: manually created
MachineType String No ECS

The instance type. the fact that it's defaulting to ECS.

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

Cluster status, with the following values:

  • CREATING: The cluster is being created
  • CREATE_FAILED: Cluster creation failed
  • RUNNING
  • IDLE: cluster idle
  • RELEASING: cluster release
  • RELEASE_FAILED: Cluster release failed
  • RELEASED: The cluster is released
  • WAIT_FOR_PAY: Pending Payment
  • ABNORMAL: cluster status exception
IsDesc Boolean No false

Whether to arrange in reverse order:

  • true: in reverse order
  • false: non-reverse order
DepositType String No HALF_MANAGED

Managed type, with the following values:

  • 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 on each page.

DefaultStatus Boolean No true

Whether to query the cluster whose default status is Initializing, Waiting for Build, Idle, Running, Released, or Failed to Create. Valid values:

  • false: Yes
  • true: no
Name String No cluster_name

The description of the cluster.

VpcId String No vpc-bp1c85tzgqu1bf5b****

The ID of the VPC to which the instance belongs.

ResourceGroupId String No rg-bp67acfmxazb4p****

The resource group ID. You can call ListResourceGroups View the resource group ID.

Tag.N.Key String No TestKey

The tag keys of the EMR instance and the node ECS instance. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key value is 1~128, which cannot start with aliyun and acs: and cannot contain http:// or https://.

Tag.N.Value String No TestValue

The tag values of EMR instances and node ECS instances. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value 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. 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

Managed type, with the following values:

  • 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 returned message.

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

The ID of the request.

HasUncompletedOrder Boolean false

Whether there are outstanding orders:

  • true: there are outstanding orders
  • false: there are no outstanding orders
Id String C-010A704DA760****

The ID of the ACK cluster that you want to query.

K8sClusterId String No.

A reserved field.

MachineType String ECS

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

MetaStoreType String LOCAL

The metadata type, with the following values:

  • LOCAL: cluster internal metadata
  • UNIED: unified metadata
  • USER_RDS: user-built 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 36

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

The running time. Unit: seconds.

Status String IDEL

The status of the cluster.

Tags Array of Tag

The list of tags.

Tag
TagKey String DevDept

The key of tag N. Valid values of N: 1 to 20 The tag key cannot be an empty string. The value of the 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. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value ranges from 1 to 128. It cannot start with acs: and cannot contain http:// or https://.

Type String HADOOP

The type of the cluster.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries 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
}