Method description
Lists clusters of the current user. Pagination is supported.
Parameter description
| Parameter | Type | Required | Description |
|---|---|---|---|
| marker | String | No | Start resource ID of the current page. Default value: Null string |
| maxItemCount | int | No | Maximum number of returned items. The maximum value is 200. The default value is also 200 |
Response description
If the call succeeds, a ListClustersResponse instance is returned. You can use the getItems method of this instance to obtain the List
object. If a failure occurs, a ClientException is thrown.
Sample code
try{ListClustersResponse response = client.listClusters();//SucceededList<Cluster> list = response.getItems();}catch(ClientException e){e.printStackTrace();// Failed}
Attribute of Cluster
| Attribute | Type | Description |
|---|---|---|
| id | String | Cluster ID |
| name | String | Cluster name |
| ownerId | long | Owner ID |
| description | String | Brief description |
| state | String | Cluster state. Optional values include Active and Deleting |
| creationTime | Date | Creation time |
| instanceType | String | Type of the instance for creating a cluster. Supported instance types vary according to the region |
| imageId | String | It can be an ECS image ID or a registered image ID |
| operationLogs | List |
Operation log |
| metrics | ClusterMatrics | Number of instances in various states |
| groups | Map |
Instance group |
| userData | Map |
User data |
| configs | Configs | Cluster configurations, such as the disk configuration of the instance. It is described by [Configs] |
Attributes of ClusterMatrics
| Attribute | Type | Description |
|---|---|---|
| startingCount | long | Number of instances that are being started |
| runningCount | long | Number of instances that are Running |
| stoppingCount | long | Number of instances that are being stopped |
| stoppedCount | long | Number of stopped instances |
Attributes of Group
| Attribute | Type | Description |
|---|---|---|
| desiredVMCount | int | Expected number of started instances |
| actualVMCount | int | Actual number of started instances |
| instanceType | String | ECS instance type |
| resourceType | String | Type of the resource. Currently, this parameter can only be set to OnDemand |
Configs
| Attribute | Type | Required | Description |
|---|---|---|---|
| Disks | object | No | Disk configurations of instances in a cluster |
Disks
| Attribute | Type | Required | Description |
|---|---|---|---|
| SystemDisk | object | No | System disk information |
| DataDisk | array | No | Data disk information |
SystemDisk
| Attribute | Type | Required | Description |
|---|---|---|---|
| Type | string | No | Disk type. Default value: ephemeral |
| Size | int | Yes | Disk size. The range varies according to the disk type |
The following system disk type is available:
- ephemeral: ephemeral disk
System disk size, in the unit of GB. Value range:
- ephemeral - [40, 500]
Default value: size=max{40, ImageSize}
The value of this parameter must be greater than or equal to max{40, ImageSize}.
DataDisk
| Attribute | Type | Required | Description |
|---|---|---|---|
| Type | string | No | Disk type. Default value: ephemeral |
| Size | int | Yes | Disk size.The range varies according to the disk type |
| MountPoint | String | No | Disk mount point |
The following data disk type is available:
- ephemeral: ephemeral disk
Data disk size, in the unit of GB. Value range:
- ephemeral - [5, 1024]