You can call DescribeClusters to view the details of all clusters in Container Service for Kubernetes.

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 headers

This operation uses the common request header only. For more information, see Common parameters.

Request syntax

GET /clusters HTTPS|HTTP

Request parameters

Parameter Type Required Example Description
name String No test

A keyword of the cluster name. The clusters whose names contain the keyword are returned.

clusterType String No ManagedKubernetes

The type of the clusters.

Response parameters

Parameter Type Example Description
clusters Array

A list of clusters.

cluster_id String cb95aa626a47740afbf6aa099b650****

The ID of the cluster.

cluster_type String Kubernetes

The type of the cluster.

current_version String 1.14.8-aliyun.1

The version of the cluster.

data_disk_category String cloud

The type of the data disks.

data_disk_size Integer 0

The size of a data disk. Unit: GB.

deletion_protection Boolean true

Indicates whether deletion protection is enabled for the cluster. If this feature is enabled, the cluster cannot be deleted by operations in the console or API operations.

docker_version String 18.09.2

The version of Docker.

master_url String "{\"api_server_endpoint\":\"https://47.93.195.255:6443https://mirana.cs-cn-beijing.aliyuncs.com:4243https://192.168.0.79:6443\"}", "external_loadbalancer_id": "lb-2ze3buguz3gx9920zwf24"

The endpoints that can be used to connect to the cluster. For more information, see .SSH访问Kubernetes集群

meta_data String ***

The metadata of the cluster.

name String my-test-Kubernetes-cluster

The name of the cluster.

network_mode String vpc

The network type of the cluster. vpc indicates Virtual Private Cloud (VPC).

region_id String cn-beijing

The ID of the region where the cluster is deployed.

resource_group_id String rg-acfmyvw3wjmb3uq

The ID of the resource group to which the cluster belongs.

security_group_id String sg-2zedf74ifulatvx0z2ag

The ID of the security group to which the ECS instances in the cluster belong.

state String running

The status of the cluster. Valid values: running, filed, and stopped. running indicates that the cluster is running properly. filed and stopped indicate that the cluster is abnormal.

tags Array

The tags of the cluster.

key String 2

The name of the tag.

value String 3

The value of the tag.

vpc_id String vpc-2zecuu62b9zw7a7qnn2**

The ID of the VPC.

vswitch_cidr String ""

The CIDR block that is assigned to VSwitches.

vswitch_id String vsw-2zete8s4qocqg0mf6xx**

The IDs of VSwitches.

zone_id String cn-beijing-a

The ID of the zone where the cluster is deployed.

Examples

Sample requests

GET /clusters HTTP/1.1
Common request header

Sample request description

 GET /clusters HTTP/1.1
<Common request header>

Sample success responses

XML format

<0>
    <name>sl-numa</name>
    <cluster_id>cd62be8675b514f278163cf750acb1789</cluster_id>
    <size>4</size>
    <region_id>cn-shenzhen</region_id>
    <state>running</state>
    <cluster_type>Kubernetes</cluster_type>
    <current_version>1.16.6-aliyun.1</current_version>
    <resource_group_id>rg-acfmyvw3wjmb3uq</resource_group_id>
    <instance_type/>
    <vswitch_id>vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm</vswitch_id>
    <data_disk_category>cloud</data_disk_category>
    <security_group_id>sg-wz956lln6kknnwlwleag</security_group_id>
    <tags>
        <key>ack.aliyun.com</key>
        <value>cd62be8675b514f278163cf750acb1789</value>
    </tags>
    <zone_id>cn-shenzhen-e</zone_id>
    <docker_version>19.03.5</docker_version>
    <deletion_protection>false</deletion_protection>
</0>
<1>
    <name>sl-terway</name>
    <cluster_id>c5b269738d1f5427ebd32884fc59c5c0f</cluster_id>
    <size>5</size>
    <region_id>cn-shenzhen</region_id>
    <state>running</state>
    <cluster_type>Kubernetes</cluster_type>
    <current_version>1.16.6-aliyun.1</current_version>
    <vpc_id>vpc-wz984yvbd6lck22z3pvgt</vpc_id>
    <vswitch_id>vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm</vswitch_id>
    <security_group_id>sg-wz9e8pvnjalx1tm1g80p</security_group_id>
    <tags>
        <key>ack.aliyun.com</key>
        <value>c5b269738d1f5427ebd32884fc59c5c0f</value>
    </tags>
    <zone_id>cn-shenzhen-e</zone_id>
    <docker_version>19.03.5</docker_version>
    <deletion_protection>false</deletion_protection>
</1>

JSON format

[
    {
        "name": "sl-numa",
        "cluster_id": "cd62be8675b514f278163cf750acb1789",
        "size": 4,
        "region_id": "cn-shenzhen",
        "state": "running",
        "cluster_type": "Kubernetes",
        "current_version": "1.16.6-aliyun.1",
        "resource_group_id": "rg-acfmyvw3wjmb3uq",
        "instance_type": "",
        "vswitch_id": "vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm",
        "data_disk_category": "cloud",
        "security_group_id": "sg-wz956lln6kknnwlwleag",
        "tags": [
            {
                "key": "ack.aliyun.com",
                "value": "cd62be8675b514f278163cf750acb1789"
            }
        ],
        "zone_id": "cn-shenzhen-e",
        "docker_version": "19.03.5",
        "deletion_protection": false
    },
    {
        "name": "sl-terway",
        "cluster_id": "c5b269738d1f5427ebd32884fc59c5c0f",
        "size": 5,
        "region_id": "cn-shenzhen",
        "state": "running",
        "cluster_type": "Kubernetes",
        "current_version": "1.16.6-aliyun.1",
        "vpc_id": "vpc-wz984yvbd6lck22z3pvgt",
        "vswitch_id": "vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm,vsw-wz9uwxhawmtzg7u9h5mmm",
        "security_group_id": "sg-wz9e8pvnjalx1tm1g80p",
        "tags": [
            {
                "key": "ack.aliyun.com",
                "value": "c5b269738d1f5427ebd32884fc59c5c0f"
            }
        ],
        "zone_id": "cn-shenzhen-e",
        "docker_version": "19.03.5",
        "deletion_protection": false
    }

]

Sample response description

 [
    {
        "agent_version": "string",
        "cluster_id": "string",
        "created": "datetime",
        "external_loadbalancer_id": "string",
        "master_url": "string",
        "name": "string",
        "network_mode": "string",
        "region_id": "string",
        "security_group_id": "string",
        "size": "numbers",
        "state": "string",
        "updated": "datetime",
        "vpc_id": "string",
        "vswitch_id": "string"
    }
]

Error codes

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