You can call this operation to query the cluster list. The query result is returned by page.

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-b

The ID of the region where your cluster resides.

AccessKeyId String No LTAI8ljWyu7y****

The AccessKey ID provided to you by Alibaba Cloud, which specifies the ID of the user.

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

The list of cluster types.

CreateType String No ON-DEMAND

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

  • ON-DEMAND
  • MANUAL
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.

DepositType String No HALF_MANAGED

The hosting type, which specifies whether the cluster is fully-hosted or half-hosted. Valid values:

  • HALF_MANAGED
  • FULLY_MANAGED
IsDesc Boolean No false

Specifies whether to sort the clusters in descending order.

MachineType String No ECS

The type of hosts in the cluster.

PageNumber Integer No 1

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

PageSize Integer No 10

The number of entries to return on each page.

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

The list of the cluster status.

Response parameters

Parameter Type Example Description
Clusters

The list of clusters.

ClusterInfo

The information of a cluster.

ChargeType String PostPaid

The billing method of the cluster.

CreateResource String ECM_EMR

The label that is automatically attached to the EMR cluster.

CreateTime Long 1542784048000

The time when the cluster was created.

DepositType String HALF_MANAGED

The hosting type, which indicates whether the cluster is fully-hosted or half-hosted. Valid values: HALF_MANAGED and FULLY_MANAGED.

ExpiredTime Long 1542784048000

The time-out period of the subscription cluster.

FailReason

The reason why the creation of the cluster fails.

ErrorCode String InvalidImageId.NotFound

The error code.

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

Indicates whether you have uncompleted orders.

Id String C-010A704DA760****

The ID of the cluster.

MachineType String ECS

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

MetaStoreType String local

The mode in which Hive Metastore is deployed.

Name String cluster_name

The name of the cluster.

OrderList String 0

The list of orders.

OrderTaskInfo

A reserved parameter that indicates the information of orders.

CurrentCount Integer 0

A reserved parameter.

OrderIdList String 0

A reserved parameter.

TargetCount Integer 0

A reserved 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

The period for which the cluster has been running. Unit: seconds.

Status String IDEL

The status of the cluster.

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 clusters that you have queried.

Examples

Sample requests


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

Sample success response

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 format

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

Error codes

HTTP status code Error code Error message Description
403 Params.Illegal The specified parameters are wrongly formed.. The error message returned because the format of the specified parameters is invalid.
403 User.OtherUserResource.NotAllow It is not allowed to operate other user's resource The error message returned because you are not allowed to manage resources of other users.
403 Invalid.Cluster.Status Invalid cluster status %s in status list The error message returned because the status of the specified cluster is invalid.
403 Invalid.Cluster.Type Invalid cluster type %s in cluster type list The error message returned because the type of the specified cluster is invalid.
403 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Submit a ticket.

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