All Products
Search
Document Center

Batch Compute:ListClusters

Last Updated:Feb 21, 2023

Description

Obtains the cluster list.

Request syntax

GET /clusters?Marker={Marker}&MaxItemCount={MaxItemCount}

Attribute description

Attribute

Type

Required

Description

Marker

String

No

Start resource ID of the current page.Default value: Null string

MaxItemCount

int

No

Maximum number of actually returned resources. The default value is 50, and the maximum value is 100.

Response

Success

The 200 status code and the following cluster list information are returned:

{
    "NextMarker": "",
    "Items":[{
        "Name": "clusterName1",
        "Id": "cls-6kir9pdp3lg6220g418002",
        "OwnerId": 123,
        "Description": "demo",
        "CreationTime": "2016-10-31T06:55:33.921897Z",
        "State": "Active",
        "ImageId": "img-ubuntu",
        "Notification": {
            "Topic": {
                "Name": "test-topic",
                "Endpoint": "http://[UserId].mns.[Region].aliyuncs.com/",
                "Events": [
                    "OnClusterDeleted",
                    "OnInstanceCreated",
                    "OnInstanceActive"
                ]
            }
        },
        "Configs": {
            "Disks": {
                "SystemDisk": {
                    "Type": "cloud",
                    "Size": 500
                },
                "DataDisk": {
                    "Type": "cloud",
                    "Size": 500,
                    "MountPoint": "/path/to/mount"
                }
            }
        },
        "Groups": {
            "group1": {
                "DesiredVMCount": 3,
                "ActualVMCount": 2,
                "InstanceType": "bcs.a2.large",
                "ResourceType": "OnDemand"
            }
        },
        "OperationLogs": ["[2016-10-31T06:55:33.921897Z][group]Creating instance group successfully","[2016-10-31T06:55:33.941897Z]Creating cluster successfully"],
        "Metrics": {
            "RunningCount": 1,
            "StartingCount": 0,
            "StoppingCount": 0,
            "StoppedCount": 0
        }
    }]
}

Attribute description

Attribute

Type

Description

NextMarker

string

Start resource ID on the next page. The value is blank in the last page.

Items

Array

Cluster list.

Error codes

Error code

Error message

Status code

Syntax

InvalidMaxItemCount

Specified parameter MaxItemCount is not valid. Its type must be integer.

400

MaxItemCount must be an integer.

InvalidMaxItemCount

Specified parameter MaxItemCount is not valid. It must be in [0, 100].

400

The MaxItemCount value must be in the range of [0, 100].