• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. Cluster and Host Management (Proprietary APIs)
  5. Obtaining Information About All Clusters

Obtaining Information About All Clusters

Function

This API is used to obtain information about all clusters.

URI

GET /api/v1/clusters

Request

N/A

Response

Response parameters:

Table 1 describes the response parameters.

Table 1 Parameter description

Parameter

Type

Description

kind

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.

apiVersion

String

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

metadata

Table 2

-

spec

Table 3

-

clusterStatus

Table 4

-

k8s_version

String

-

commit_id

String

-

Table 2 Data structure of the metadata field

Parameter

Type

Description

name

String

Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated.

uuid

String

UUID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. Populated by the system. Read-only.

spaceuuid

String

ID of the space where the user resides.

createAt

String

createAt is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only.

updateAt

String

updateAt is a timestamp representing the server time when this object was update. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only.

Table 3 Data structure of the spec field

Parameter

Type

Description

description

String

Descriptive information.

hostList

Table 5

Host list.

az

String

az data center where the host resides.

cpu

Integer

CPU size (measured in cores) of all hosts in the cluster.

memory

Integer

Memory size (measured in MB) of all hosts in the cluster.

vpc

String

Name of the network used by the cluster.

vpcid

String

VPC ID.

subnet

String

Name of the subnet used by the cluster.

endpoint

String

Address used to access the container cluster from the internal network.

external_endpoint

String

Address used to access the container cluster through the external network. If the cluster is not bound to an EIP, this parameter is invalid.

security_group_id

String

Security group ID of the container cluster.

NOTE:

If this parameter is left blank, CCE will dynamically create a security group when creating the container cluster.

clustertype

String

Container cluster type.

Options: HA and Single.

Default: Single.

NOTE:
  • HA: An HA container cluster has three master nodes. This cluster is available only when two or more masters are available. This ensures the high reliability of the cluster.
  • Single: A single container cluster has only one master node.
Table 4 Data structure of the clusterStatus field

Parameter

Type

Description

status

String

Status of the cluster.

Table 5 Data structure of the hostList field

Parameter

Type

Description

kind

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.

apiVersion

String

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

metadata

Table 2

-

spec

Table 6

-

Table 6 Data structure of the spec field

Parameter

Type

Description

hostList

Table 7

Host list.

Table 7 Data structure of the hostList field

Parameter

Type

Description

kind

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.

apiVersion

String

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

metadata

Table 2

-

spec

Table 8

-

replicas

Integer

Number of host instances.

status

String

Host status.

message

String

Node information.

Table 8 Data structure of the spec field

Parameter

Type

Description

clusteruuid

String

Cluster UUID.

clustername

String

Cluster name.

privateip

String

Private network IP address of the host.

publicip

String

Public network IP address of the host.

flavor

String

Host specifications.

cpu

Integer

CPU size measured in cores.

memory

Integer

Memory size measured in MB.

hostid

String

Host UUID.

az

String

az data center where the host resides.

label

String

Label existing on the host.

volume

Table 9

Disk information.

sshkey

String

SSH key used to create the host.

status

Table 10

-

Table 9 Data structure of the volume field

Parameter

Type

Description

diskType

String

Disk type, which is used to determine a data disk or a system disk.

diskSize

Integer

Disk size.

volumeType

String

Disk IO type.

Table 10 Data structure of the status field

Parameter

Type

Description

Capacity

Table 11

-

Allocatable

Table 12

-

Conditions

Table 13

-

Addresses

Table 14

-

DaemonEndpoints

Table 15

-

NodeInfo

Table 16

-

Images

Table 17

-

Table 11 Data structure of the Capacity field

Parameter

Type

Description

CPU

String

Maximum CPU capacity of the host.

Memory

String

Maximum memory capacity of the host.

Pods

String

Maximum number of pods on the host.

Table 12 Data structure of the Allocatable field

Parameter

Type

Description

CPU

String

CPU usage of the host.

Memory

String

Memory usage of the host.

Pods

String

Number of pods that have been used on the host.

Table 13 Data structure of the Conditions field

Parameter

Type

Description

Type

String

Type of the condition.

Status

String

Status of the condition.

LastHeartbeatTime

Time

Last heartbeat time.

LastTransitionTime

Time

Last status transition time.

Reason

String

Reason of status transition.

Message

String

Status transition information.

Table 14 Data structure of the Addresses field

Parameter

Type

Description

Type

String

Network type.

Address

String

Network address.

Table 15 Data structure of the DaemonEndpoints field

Parameter

Type

Description

KubeletEndpoint

Table 18

-

Table 16 Data structure of the NodeInfo field

Parameter

Type

Description

MachineID

String

Machine ID.

SystemUUID

String

System ID.

BootID

String

Boot ID.

KernelVersion

String

Kernel version.

OsImage

String

System image.

ContainerRuntimeVersion

String

Container version.

KubeletVersion

String

Kubelet version.

KubeProxyVersion

String

Proxy version.

Table 17 Data structure of the Images field

Parameter

Type

Description

Names

String

Image name.

SizeBytes

Integer

Image size.

Table 18 Data structure of the KubeletEndpoint field

Parameter

Type

Description

Port

Integer

Kubelet port number.

Example response:

{ 
    "kind": "cluster", 
    "apiVersion": "v1", 
    "metadata": { 
        "name": "sit-cluster-94b5f", 
        "uuid": "d5633999-d8e9-485e-af74-1913175696e6", 
        "spaceuuid": "763e9dc1-b470-34c7-ede7-0d2229198c1a", 
        "createAt": "2017-04-27 05:43:04.664929459 +0000 UTC", 
        "updateAt": "2017-05-11 07:16:15.62414924 +0000 UTC" 
    }, 
    "spec": { 
        "description": "cce cluster", 
        "hostList": { 
            "kind": "list", 
            "apiVersion": "v1", 
            "metadata": {}, 
            "spec": { 
                "hostList": [ 
                    { 
                        "kind": "host", 
                        "apiVersion": "v1", 
                        "metadata": { 
                            "name": "sit-cluster-94b5f-node-1", 
                            "uuid": "e4222dec-421e-4479-a36b-3e95eebe6505", 
                            "spaceuuid": "763e9dc1-b470-34c7-ede7-0d2229198c1a", 
                            "createAt": "2017-04-27 05:43:07.791008293 +0000 UTC", 
                            "updateAt": "2017-05-11 07:38:48.433948693 +0000 UTC" 
                        }, 
                        "spec": { 
                            "clusteruuid": "d5633999-d8e9-485e-af74-1913175696e6", 
                            "clustername": "sit-cluster-94b5f", 
                            "privateip": "192.168.0.248", 
                            "publicip": "10.154.58.95", 
                            "flavor": "s1.large", 
                            "cpu": 2, 
                            "memory": 8192, 
                            "hostid": "e4222dec-421e-4479-a36b-3e95eebe6505", 
                            "az": "eu-de-02", 
                            "volume": [ 
                                { 
                                    "diskType": "root", 
                                    "diskSize": 40, 
                                    "volumeType": "SAS" 
                                }, 
                                { 
                                    "diskType": "data", 
                                    "diskSize": 100, 
                                    "volumeType": "SAS" 
                                } 
                            ], 
                            "sshkey": "KeyPair-bae5", 
                            "status": { 
                                "capacity": { 
                                    "cpu": "2", 
                                    "memory": "7973104Ki", 
                                    "pods": "110" 
                                }, 
                                "allocatable": { 
                                    "cpu": "1.334", 
                                    "memory": "7752568Ki", 
                                    "pods": "110" 
                                }, 
                                "conditions": [ 
                                    { 
                                        "type": "OutOfDisk", 
                                        "status": "False", 
                                        "lastHeartbeatTime": "2017-05-11T07:39:42Z", 
                                        "lastTransitionTime": "2017-04-27T05:58:40Z", 
                                        "reason": "KubeletHasSufficientDisk", 
                                        "message": "kubelet has sufficient disk space available" 
                                    }, 
                                    { 
                                        "type": "MemoryPressure", 
                                        "status": "False", 
                                        "lastHeartbeatTime": "2017-05-11T07:39:42Z", 
                                        "lastTransitionTime": "2017-04-27T05:58:40Z", 
                                        "reason": "KubeletHasSufficientMemory", 
                                        "message": "kubelet has sufficient memory available" 
                                    }, 
                                    { 
                                        "type": "DiskPressure", 
                                        "status": "False", 
                                        "lastHeartbeatTime": "2017-05-11T07:39:42Z", 
                                        "lastTransitionTime": "2017-04-27T05:58:40Z", 
                                        "reason": "KubeletHasNoDiskPressure", 
                                        "message": "kubelet has no disk pressure" 
                                    }, 
                                    { 
                                        "type": "Ready", 
                                        "status": "True", 
                                        "lastHeartbeatTime": "2017-05-11T07:39:42Z", 
                                        "lastTransitionTime": "2017-04-27T05:58:40Z", 
                                        "reason": "KubeletReady", 
                                        "message": "kubelet is posting ready status" 
                                    } 
                                ], 
                                "addresses": [ 
                                    { 
                                        "type": "LegacyHostIP", 
                                        "address": "192.168.0.248" 
                                    }, 
                                    { 
                                        "type": "InternalIP", 
                                        "address": "192.168.0.248" 
                                    }, 
                                    { 
                                        "type": "Hostname", 
                                        "address": "192.168.0.248" 
                                    } 
                                ], 
                                "daemonEndpoints": { 
                                    "kubeletEndpoint": { 
                                        "Port": 10250 
                                    } 
                                }, 
                                "nodeInfo": { 
                                    "machineID": "f21bcad2f362498d924ac24efcdd3e2a", 
                                    "systemUUID": "236EC4DA-DE2B-4731-8B73-5700D48B79CC", 
                                    "bootID": "fad71a86-4084-4537-9c43-d893b6f474fd", 
                                    "kernelVersion": "3.10.0-229.42.1.97.x86_64", 
                                    "osImage": "EulerOS V2.0SP1", 
                                    "containerRuntimeVersion": "docker://1.11.2", 
                                    "kubeletVersion": "v1.5.0+$Format:%h$", 
                                    "kubeProxyVersion": "v1.5.0+$Format:%h$" 
                                }, 
                                "images": [ 
                                    { 
                                        "names": [ 
                                            "fluentd:1.11" 
                                        ], 
                                        "sizeBytes": 617825114 
                                    }, 
                                    { 
                                        "names": [ 
                                            "10.154.57.150:443/kkfww002/apache-php:latest" 
                                        ], 
                                        "sizeBytes": 244663227 
                                    }, 
                                    { 
                                        "names": [ 
                                            "ops_agent:node" 
                                        ], 
                                        "sizeBytes": 200491883 
                                    }, 
                                    { 
                                        "names": [ 
                                            "kube-proxy:178e4172fb1df7fbf14c340aae3be0b3" 
                                        ], 
                                        "sizeBytes": 175577071 
                                    }, 
                                    { 
                                        "names": [ 
                                            "kubedns-amd64:1.5" 
                                        ], 
                                        "sizeBytes": 50815316 
                                    }, 
                                    { 
                                        "names": [ 
                                            "etcd:2.2.1" 
                                        ], 
                                        "sizeBytes": 28191895 
                                    }, 
                                    { 
                                        "names": [ 
                                            "exechealthz-amd64:1.0" 
                                        ], 
                                        "sizeBytes": 7115733 
                                    }, 
                                    { 
                                        "names": [ 
                                            "kube-dnsmasq-amd64:1.3" 
                                        ], 
                                        "sizeBytes": 5125973 
                                    }, 
                                    { 
                                        "names": [ 
                                            "pause:2.0" 
                                        ], 
                                        "sizeBytes": 350164 
                                    } 
                                ] 
                            } 
                        }, 
                        "replicas": 1, 
                        "status": "ACTIVE", 
                        "message": "sit-cluster-94b5f-node-1" 
                    }, 
                    { 
                        "kind": "host", 
                        "apiVersion": "v1", 
                        "metadata": { 
                            "name": "sit-cluster-94b5f-node-2", 
                            "uuid": "b5ea679c-d3be-4f52-a0f4-0ea3acd15934", 
                            "spaceuuid": "763e9dc1-b470-34c7-ede7-0d2229198c1a", 
                            "createAt": "2017-04-27 06:01:14.637647049 +0000 UTC", 
                            "updateAt": "2017-05-11 07:38:48.479566577 +0000 UTC" 
                        }, 
                        "spec": { 
                            "clusteruuid": "d5633999-d8e9-485e-af74-1913175696e6", 
                            "clustername": "sit-cluster-94b5f", 
                            "privateip": "192.168.0.253", 
                            "publicip": "10.154.58.139", 
                            "flavor": "s1.xlarge", 
                            "cpu": 4, 
                            "memory": 16384, 
                            "hostid": "b5ea679c-d3be-4f52-a0f4-0ea3acd15934", 
                            "az": "eu-de-02", 
                            "volume": [ 
                                { 
                                    "diskType": "root", 
                                    "diskSize": 40, 
                                    "volumeType": "SATA" 
                                }, 
                                { 
                                    "diskType": "data", 
                                    "diskSize": 100, 
                                    "volumeType": "SATA" 
                                } 
                            ], 
                            "sshkey": "KeyPair-bae5", 
                            "status": { 
                                "capacity": { 
                                    "cpu": "4", 
                                    "memory": "16230604Ki", 
                                    "pods": "110" 
                                }, 
                                "allocatable": { 
                                    "cpu": "2.932", 
                                    "memory": "15937636Ki", 
                                    "pods": "110" 
                                }, 
                                "conditions": [ 
                                    { 
                                        "type": "OutOfDisk", 
                                        "status": "False", 
                                        "lastHeartbeatTime": "2017-05-11T07:39:49Z", 
                                        "lastTransitionTime": "2017-04-27T06:10:28Z", 
                                        "reason": "KubeletHasSufficientDisk", 
                                        "message": "kubelet has sufficient disk space available" 
                                    }, 
                                    { 
                                        "type": "MemoryPressure", 
                                        "status": "False", 
                                        "lastHeartbeatTime": "2017-05-11T07:39:49Z", 
                                        "lastTransitionTime": "2017-04-27T06:10:28Z", 
                                        "reason": "KubeletHasSufficientMemory", 
                                        "message": "kubelet has sufficient memory available" 
                                    }, 
                                    { 
                                        "type": "DiskPressure", 
                                        "status": "False", 
                                        "lastHeartbeatTime": "2017-05-11T07:39:49Z", 
                                        "lastTransitionTime": "2017-04-27T06:10:28Z", 
                                        "reason": "KubeletHasNoDiskPressure", 
                                        "message": "kubelet has no disk pressure" 
                                    }, 
                                    { 
                                        "type": "Ready", 
                                        "status": "True", 
                                        "lastHeartbeatTime": "2017-05-11T07:39:49Z", 
                                        "lastTransitionTime": "2017-04-27T06:10:28Z", 
                                        "reason": "KubeletReady", 
                                        "message": "kubelet is posting ready status" 
                                    } 
                                ], 
                                "addresses": [ 
                                    { 
                                        "type": "LegacyHostIP", 
                                        "address": "192.168.0.253" 
                                    }, 
                                    { 
                                        "type": "InternalIP", 
                                        "address": "192.168.0.253" 
                                    }, 
                                    { 
                                        "type": "Hostname", 
                                        "address": "192.168.0.253" 
                                    } 
                                ], 
                                "daemonEndpoints": { 
                                    "kubeletEndpoint": { 
                                        "Port": 10250 
                                    } 
                                }, 
                                "nodeInfo": { 
                                    "machineID": "f21bcad2f362498d924ac24efcdd3e2a", 
                                    "systemUUID": "DB6D465A-BA24-4CD7-BDE8-CF49D29058DF", 
                                    "bootID": "df969e86-b870-4c4a-bc8d-3941ac9feb1a", 
                                    "kernelVersion": "3.10.0-229.42.1.97.x86_64", 
                                    "osImage": "EulerOS V2.0SP1", 
                                    "containerRuntimeVersion": "docker://1.11.2", 
                                    "kubeletVersion": "v1.5.0+$Format:%h$", 
                                    "kubeProxyVersion": "v1.5.0+$Format:%h$" 
                                }, 
                                "images": [ 
                                    { 
                                        "names": [ 
                                            "fluentd:1.11" 
                                        ], 
                                        "sizeBytes": 617825114 
                                    }, 
                                    { 
                                        "names": [ 
                                            "10.154.57.150:443/kkfww002/apache-php:latest" 
                                        ], 
                                        "sizeBytes": 244663227 
                                    }, 
                                    { 
                                        "names": [ 
                                            "ops_agent:node" 
                                        ], 
                                        "sizeBytes": 200491883 
                                    }, 
                                    { 
                                        "names": [ 
                                            "kube-proxy:178e4172fb1df7fbf14c340aae3be0b3" 
                                        ], 
                                        "sizeBytes": 175577071 
                                    }, 
                                    { 
                                        "names": [ 
                                            "10.154.57.150:443/kkfww002/redis:latest" 
                                        ], 
                                        "sizeBytes": 109208225 
                                    }, 
                                    { 
                                        "names": [ 
                                            "kubedns-amd64:1.5" 
                                        ], 
                                        "sizeBytes": 50815316 
                                    }, 
                                    { 
                                        "names": [ 
                                            "etcd:2.2.1" 
                                        ], 
                                        "sizeBytes": 28191895 
                                    }, 
                                    { 
                                        "names": [ 
                                            "exechealthz-amd64:1.0" 
                                        ], 
                                        "sizeBytes": 7115733 
                                    }, 
                                    { 
                                        "names": [ 
                                            "kube-dnsmasq-amd64:1.3" 
                                        ], 
                                        "sizeBytes": 5125973 
                                    }, 
                                    { 
                                        "names": [ 
                                            "pause:2.0" 
                                        ], 
                                        "sizeBytes": 350164 
                                    } 
                                ] 
                            } 
                        }, 
                        "replicas": 1, 
                        "status": "ACTIVE", 
                        "message": "node-0d187060-2b0f-11e7-ae3b-286ed488ca06" 
                    }
                ] 
            } 
        }, 
        "az": "eu-de-02", 
        "cpu": 11, 
        "memory": 45056, 
        "vpc": "vpc-fec7", 
        "vpcid": "0ec12a92-e6b1-49e6-a144-36f270731c0b", 
        "subnet": "subnet-fec7",
        "endpoint": "https://192.168.0.80:5443",
        "external_endpoint": "https://172.20.50.188:5443",
        "security_group_id": "159585ee-e65d-4362-a6cd-66521c98a32d", 
        "clustertype": "Single",
        "latestversion": { 
            "version": "V1.1.0", 
            "date": "2017-04-24 15:03:14.634515594 +0000 UTC" 
        }, 
        "versioninfo": { 
            "version": "V1.1.0", 
            "date": "2017-04-24 15:03:14.634515594 +0000 UTC" 
        } 
    }, 
    "clusterStatus": { 
        "status": "AVAILABLE" 
    } ,
    "k8s_version":"1.5.0",
    "commit_id":"58b7c16a52c03e4a849874602be42ee71afdcab1"
}

Status Code

Table 19 describes the status code of this API.

Table 19 Status code

Status Code

Description

200

This operation succeeds, and information about all clusters is returned.

For the description about status codes, see section Status Codes.