• 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 Hosts in a Specified Cluster

Obtaining Information About All Hosts in a Specified Cluster

Function

This API is used to obtain the information about all hosts in a specified cluster.

URI

GET /api/v1/clusters/{clusteruuid}/hosts

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

clusteruuid

Yes

Cluster UUID.

Request

N/A

Response

Response parameters:

Table 2 describes the response parameters.

Table 2 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 3

-

spec

Table 4

-

Table 3 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 4 Data structure of the spec field

Parameter

Type

Description

hostList

Table 5

Host list.

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 3

-

spec

Table 6

-

replicas

Integer

Number of host instances.

status

String

Host status.

Table 6 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 attached to the host.

volume

Table 7

Disk information.

sshkey

String

SSH key used to create the host.

status

Table 8

-

Table 7 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 8 Data structure of the status field

Parameter

Type

Description

Capacity

Table 9

-

Allocatable

Table 10

-

Conditions

Table 11

-

Addresses

Table 12

-

DaemonEndpoints

Table 13

-

NodeInfo

Table 14

-

Images

Table 15

-

Table 9 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 10 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 11 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 12 Data structure of the Addresses field

Parameter

Type

Description

Type

String

Network type.

Address

String

Network address.

Table 13 Data structure of the DaemonEndpoints field

Parameter

Type

Description

KubeletEndpoint

Table 16

-

Table 14 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 15 Data structure of the Images field

Parameter

Type

Description

Names

String

Image name.

SizeBytes

Integer

Image size.

Table 16 Data structure of the KubeletEndpoint field

Parameter

Type

Description

Port

Integer

Kubelet port number.

Example response:

{
    "kind": "list",
    "apiVersion": "v1",
    "metadata": {},
    "spec": {
        "hostList": [
            {
                "kind": "host",
                "apiVersion": "v1",
                "metadata": {
                    "name": "zxhtest1-node-1",
                    "uuid": "62c455a2-3591-4e2d-a465-97525c2f821a",
                    "spaceuuid": "4b575808-8923-2f80-a388-c9c07c6e0d47",
                    "createAt": "2016-09-22 14:13:21.57446587 +0000 UTC",
                    "updateAt": "2016-09-26 06:31:24.984048111 +0000 UTC"
                },
                "spec": {
                    "clusteruuid": "97dcdf83-c820-414c-af6e-71b2229da164",
                    "clustername": "zxhtest1",
                    "privateip": "192.168.0.176",
                    "publicip": "172.16.56.218",
                    "flavor": "c2.large",
                    "cpu": 2,
                    "memory": 4096,
                    "hostid": "62c455a2-3591-4e2d-a465-97525c2f821a",
                    "az": "eu-de-01",
                    "volume": [
                        {
                            "diskType": "root",
                            "diskSize": 40,
                            "volumeType": "SATA"
                        },
                        {
                            "diskType": "data",
                            "diskSize": 100,
                            "volumeType": "SATA"
                        }
                    ],
                    "sshkey": "SSHkey-b26e",
                    "status": {
                        "capacity": {
                            "cpu": "2",
                            "memory": "3844344Ki",
                            "pods": "110"
                        },
                        "allocatable": {
                            "cpu": "1.200",
                            "memory": "3453720Ki",
                            "pods": "110"
                        },
                        "conditions": [
                            {
                                "type": "OutOfDisk",
                                "status": "False",
                                "lastHeartbeatTime": "2016-09-26T06:30:45Z",
                                "lastTransitionTime": "2016-09-23T01:23:13Z",
                                "reason": "KubeletHasSufficientDisk",
                                "message": "kubelet has sufficient disk space available"
                            },
                            {
                                "type": "Ready",
                                "status": "True",
                                "lastHeartbeatTime": "2016-09-26T06:30:45Z",
                                "lastTransitionTime": "2016-09-23T01:23:13Z",
                                "reason": "KubeletReady",
                                "message": "kubelet is posting ready status"
                            }
                        ],
                        "addresses": [
                            {
                                "type": "LegacyHostIP",
                                "address": "192.168.0.176"
                            },
                            {
                                "type": "InternalIP",
                                "address": "192.168.0.176"
                            }
                        ],
                        "daemonEndpoints": {
                            "kubeletEndpoint": {
                                "Port": 10250
                            }
                        },
                        "nodeInfo": {
                            "machineID": "07ba5fb3842e41cbacfb6debeb628978",
                            "systemUUID": "BDFABB99-87B7-4F0E-979C-C835650EE001",
                            "bootID": "9d82fcac-74e1-4608-9902-5adc2f050bdd",
                            "kernelVersion": "3.10.0-229.30.1.65.x86_64",
                            "osImage": "EulerOS V2.0SP1",
                            "containerRuntimeVersion": "docker://1.9.1",
                            "kubeletVersion": "v1.2.1.0.93+6922fc7beb4e95-dirty",
                            "kubeProxyVersion": "v1.2.1.0.93+6922fc7beb4e95-dirty"
                        },
                        "images": [
                            {
                                "names": [
                                    "kube-proxy:6c47c54085cf1fdb4a87018a69399b12"
                                ],
                                "sizeBytes": 165861544
                            },
                            {
                                "names": [
                                    "ops_agent:node"
                                ],
                                "sizeBytes": 200482639
                            },
                            {
                                "names": [
                                    "fluentd:1.11"
                                ],
                                "sizeBytes": 617642557
                            },
                            {
                                "names": [
                                    "kube2sky:1.14"
                                ],
                                "sizeBytes": 27804037
                            },
                            {
                                "names": [
                                    "etcd:2.2.1"
                                ],
                                "sizeBytes": 28191895
                            },
                            {
                                "names": [
                                    "172.16.52.35:443/test1/redis:v1"
                                ],
                                "sizeBytes": 109208225
                            },
                            {
                                "names": [
                                    "skydns:2015-10-13-8c72f8c"
                                ],
                                "sizeBytes": 40547562
                            },
                            {
                                "names": [
                                    "pause:2.0"
                                ],
                                "sizeBytes": 350164
                            },
                            {
                                "names": [
                                    "exechealthz:1.0"
                                ],
                                "sizeBytes": 7095869
                            },
                            {
                                "names": [
                                    "172.16.52.35:443/test1/php-0922:latest"
                                ],
                                "sizeBytes": 244663227
                            }
                        ]
                    }
                },
                "replicas": 1,
                "status": "ACTIVE"
            },
            {
                "kind": "host",
                "apiVersion": "v1",
                "metadata": {
                    "name": "zxhtest1-node-2",
                    "uuid": "c547c121-8953-407e-bc06-e58f0a916b7b",
                    "spaceuuid": "4b575808-8923-2f80-a388-c9c07c6e0d47",
                    "createAt": "2016-09-22 14:13:21.577305642 +0000 UTC",
                    "updateAt": "2016-09-26 06:31:23.05751273 +0000 UTC"
                },
                "spec": {
                    "clusteruuid": "97dcdf83-c820-414c-af6e-71b2229da164",
                    "clustername": "zxhtest1",
                    "privateip": "192.168.0.177",
                    "publicip": "172.16.56.219",
                    "flavor": "c2.large",
                    "cpu": 2,
                    "memory": 4096,
                    "hostid": "c547c121-8953-407e-bc06-e58f0a916b7b",
                    "az": "eu-de-01",
                    "volume": [
                        {
                            "diskType": "root",
                            "diskSize": 40,
                            "volumeType": "SATA"
                        },
                        {
                            "diskType": "data",
                            "diskSize": 100,
                            "volumeType": "SATA"
                        }
                    ],
                    "sshkey": "SSHkey-b26e",
                    "status": {
                        "capacity": {
                            "cpu": "2",
                            "memory": "3844344Ki",
                            "pods": "110"
                        },
                        "allocatable": {
                            "cpu": "0.890",
                            "memory": "3279640Ki",
                            "pods": "110"
                        },
                        "conditions": [
                            {
                                "type": "OutOfDisk",
                                "status": "False",
                                "lastHeartbeatTime": "2016-09-26T06:30:54Z",
                                "lastTransitionTime": "2016-09-23T01:23:13Z",
                                "reason": "KubeletHasSufficientDisk",
                                "message": "kubelet has sufficient disk space available"
                            },
                            {
                                "type": "Ready",
                                "status": "True",
                                "lastHeartbeatTime": "2016-09-26T06:30:54Z",
                                "lastTransitionTime": "2016-09-23T01:23:13Z",
                                "reason": "KubeletReady",
                                "message": "kubelet is posting ready status"
                            }
                        ],
                        "addresses": [
                            {
                                "type": "LegacyHostIP",
                                "address": "192.168.0.177"
                            },
                            {
                                "type": "InternalIP",
                                "address": "192.168.0.177"
                            }
                        ],
                        "daemonEndpoints": {
                            "kubeletEndpoint": {
                                "Port": 10250
                            }
                        },
                        "nodeInfo": {
                            "machineID": "07ba5fb3842e41cbacfb6debeb628978",
                            "systemUUID": "EB0004FB-EAAD-436A-956F-E55B628C88F3",
                            "bootID": "2be6c810-c6ec-432c-a9bb-b8be466c3910",
                            "kernelVersion": "3.10.0-229.30.1.65.x86_64",
                            "osImage": "EulerOS V2.0SP1",
                            "containerRuntimeVersion": "docker://1.9.1",
                            "kubeletVersion": "v1.2.1.0.93+6922fc7beb4e95-dirty",
                            "kubeProxyVersion": "v1.2.1.0.93+6922fc7beb4e95-dirty"
                        },
                        "images": [
                            {
                                "names": [
                                    "kube-proxy:6c47c54085cf1fdb4a87018a69399b12"
                                ],
                                "sizeBytes": 165861544
                            },
                            {
                                "names": [
                                    "ops_agent:node"
                                ],
                                "sizeBytes": 200482639
                            },
                            {
                                "names": [
                                    "fluentd:1.11"
                                ],
                                "sizeBytes": 617642557
                            },
                            {
                                "names": [
                                    "kube2sky:1.14"
                                ],
                                "sizeBytes": 27804037
                            },
                            {
                                "names": [
                                    "etcd:2.2.1"
                                ],
                                "sizeBytes": 28191895
                            },
                            {
                                "names": [
                                    "skydns:2015-10-13-8c72f8c"
                                ],
                                "sizeBytes": 40547562
                            },
                            {
                                "names": [
                                    "pause:2.0"
                                ],
                                "sizeBytes": 350164
                            },
                            {
                                "names": [
                                    "exechealthz:1.0"
                                ],
                                "sizeBytes": 7095869
                            },
                            {
                                "names": [
                                    "172.16.52.35:443/test1/php-0922:latest"
                                ],
                                "sizeBytes": 244663227
                            }
                        ]
                    }
                },
                "replicas": 1,
                "status": "ACTIVE"
            }
        ]
    }
}

Status Code

Table 17 describes the status code of this API.

Table 17 Status code

Status Code

Description

200

This operation succeeds, and information about all hosts in the cluster is returned.

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