• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. API
  5. Cluster Management
  6. Obtaining Information About All Node Pools in a Specified Cluster

Obtaining Information About All Node Pools in a Specified Cluster

Function

This API is used to obtain information about all node pools in a specified cluster.

URI

GET /api/v3/projects/{project_id}/clusters/{cluster_id}/nodepools

Table 1 describes the parameters of this API.

Table 1 Description

Parameter

Mandatory

Description

project_id

Yes

Project ID.

cluster_id

Yes

Cluster ID.

Request

Request parameters:

For details about the request parameters, see Table 2.

Example request:

{
    "metadata": {},
    "spec": {
        "spec": {
            "id": "99f200ef-3938-4983-84a2-2f7b5b8e0778",
            "eip": {
                "bandwidth": {}
            },
            "IsDynamic": false
        }
    },
    "status": {
        "privateEndpoint": "https://192.168.0.240:5443",
        "publicEndpoint": "https://10.185.68.171:5443"
    }
}

Response

Response parameters:

Table 2 describes response parameters.

Table 2 Response parameters

Parameter

Type

Description

kind

String

API type. The value is fixed to List.

apiVersion

String

API version. The value is fixed to v3.

items

Table 3

-

Table 3 Data structure of the items field

Parameter

Type

Description

kind

String

API type. The value is fixed to NodePool.

apiVersion

String

API version. The value is fixed to v3.

metadata

Table 4

Node pool metadata.

spec

Table 5

Detailed node pool parameters.

status

Table 10

Node pool status.

Table 4 Data structure of the metadata field

Parameter

Type

Description

name

String

Name of the node pool.

uid

String

UID of the node pool.

Table 5 Data structure of the spec field

Parameter

Type

Description

nodeTemplate

Table 6

Detailed parameters of the node pool template.

initialNodeCount

Integer

Number of initialized nodes in the node pool.

autoscaling

Table 11

Auto scaling parameters.

nodeManagement

Table 12

Node management parameters.

Table 6 Data structure of the nodeTemplate field

Parameter

Type

Description

flavor

String

Node specifications. For details, see the flavorRef parameter in Help Center > Elastic Cloud Server > API Reference > Extension ECS APIs > Lifecycle Management > Creating ECSs.

az

String

Name of the AZ where the node resides. For details, see the availability_zone parameter in Help Center > Elastic Cloud Server > API Reference > Extension ECS APIs > Lifecycle Management > Creating ECSs.

os

String

OS of the node.

login

Table 7

Parameters for logging in to the node.

rootVolume

String

System disk parameters of the node.

publicIP

Table 8

Elastic IP address parameters of a node.

Table 7 Data structure of the login field

Parameter

Type

Description

sshKey

String

Name of the key pair used for login.

Table 8 Data structure of the publicIP field

Parameter

Type

Description

eip

Table 9

Elastic IP address.

Table 9 Data structure of the eip field

Parameter

Type

Description

bandwidth

String

Bandwidth parameters of the elastic IP address.

Table 10 Data structure of the status field

Parameter

Type

Description

currentNode

Integer

Number of nodes in the node pool.

Table 11 Data structure of the autoscaling field

Parameter

Type

Description

enable

Boolean

Whether to enable auto scaling.

maxNodeCount

Int

Maximum number of nodes allowed if auto scaling is enabled.

Table 12 Data structure of the nodeManagement field

Parameter

Type

Description

serverGroupReference

String

Relationship with the IaaS cloud server group.

Response example:

{
    "kind": "List",
    "apiVersion": "v3",
    "items": [
        {
            "kind": "NodePool",
            "apiVersion": "v3",
            "metadata": {
                "name": "eu-de-02#s1.large#EulerOS 2.2",
                "uid": "eu-de-02#s1.large#EulerOS 2.2"
            },
            "spec": {
                "nodeTemplate": {
                    "flavor": "s1.large",
                    "az": "eu-de-02",
                    "os": "EulerOS 2.2",
                    "login": {
                        "userPassword": {}
                    },
                    "rootVolume": {},
                    "publicIP": {
                        "eip": {
                            "bandwidth": {}
                        }
                    },
                    "billingMode": 0
                },
                "autoscaling": {
                    "enable": true,
                    "maxNodeCount": 50
                },
                "nodeManagement": {}
            },
            "status": {
                "currentNode": 1
            }
        }
    ]
}

Status Code

Table 13 describes the status code of this API.

Table 13 Status code

Status Code

Description

200

Information about all node pools in the cluster is successfully obtained.

For details about error status codes, see Status Codes.