Updated on 2024-11-29 GMT+08:00

Querying the Cluster Node List

Function

This API is used to query the cluster node list.

URI

GET /v2/{project_id}/clusters/{cluster_id}/nodes

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation

Project ID.

Constraints

N/A

Value range

The value must consist of 1 to 64 characters. Only letters and digits are allowed.

Default value

N/A

cluster_id

Yes

String

Explanation

Cluster ID

Constraints

N/A

Value range

The value can contain 1 to 64 characters, including only letters, digits, underscores (_), and hyphens (-).

Default value

N/A

Table 2 Query parameters.

Parameter

Mandatory

Type

Description

node_group

No

String

Explanation

Name of the node groups to be queried.

Constraints

N/A

Value range

The value can contain 3 to 14 characters.

Default value

N/A

limit

No

Integer

Explanation

Number of records displayed on each page in the returned result.

Constraints

N/A

Value range

≥1

Default value

10

offset

No

Integer

Explanation

Offset from which the job list starts to be queried.

Constraints

N/A

Value range

≥1

Default value

1

node_name

No

String

Explanation

Node name. Fuzzy search is supported.

Constraints

N/A

Value range

N/A

Default value

N/A

sort_key

No

String

Explanation

Sorting key. You can set node names as the key.

Constraints

N/A

Value range

node_name: node name

Default value

N/A

sort_dir

No

String

Explanation

Sorting order. desc indicates descending order, and asc indicates ascending order.

Constraints

N/A

Value range

desc: descending order

asc: ascending order

Default value

N/A

query_node_detail

No

Boolean

Explanation

Whether to query node details. If this parameter is set to true, the interface performance may be affected.

Constraints

N/A

Value range

true: Query node details.

false: Do not query node details.

Default value

false

query_ecs_detail

No

Boolean

Explanation

Whether to query ECS details. ECS APIs may be called.

Constraints

N/A

Value range

true: Query ECS details.

false: Do not query ECS details.

Default value

false

internal_ip

No

String

Explanation

Internal IP address.

Constraints

N/A

Value range

The value can contain 7 to 15 characters.

Default value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameter

Parameter

Type

Description

nodes

Array of ClusterNode objects

Explanation

Node list. For details, see Table 4.

node_total

Integer

Explanation

Number of nodes.

Value range

N/A

Table 4 ClusterNode

Parameter

Type

Description

node_name

String

Explanation

Node name, which is the same as that on Manager.

Value range

N/A

resource_id

String

Explanation

Resource ID. Unique identity of a node. For yearly/monthly nodes, the ID can be used to query bills.

Value range

N/A

node_group_name

String

Explanation

Node group name.

Value range

N/A

node_type

String

Explanation

Node type. Available values include Task, Core, and Master.

Value range

N/A

billing_type

String

Explanation

on-period: yearly/monthly; on-quantity: pay-per-use.

Value range

N/A

deployment_type

String

Explanation

Deployment type. The Server hosts are supported.

Value range

N/A

server_info

ServerInfo object

Explanation

If the deployment type is Server, this parameter cannot be empty. For details, see Table 5.

tags

Array of Tag objects

Explanation

Node tag. For details, see Table 7.

node_detail

NodeDetail object

Explanation

Node monitoring information. This parameter is returned only after IAM synchronization. For details, see Table 8.

node_status

String

Explanation

Node status. Status of operations on the corresponding page.

Value range

N/A

component_infos

Array of ComponentInfo objects

Explanation

Component instance information array. For details, see Table 9.

Table 5 ServerInfo

Parameter

Type

Description

server_id

String

Explanation

Server ID.

Value range

N/A

server_name

String

Explanation

Server name.

Value range

N/A

server_type

String

Explanation

Server type. Available options are ECS and BMS.

Value range

N/A

data_volumes

Array of VolumeInfo objects

Explanation

Data disk. For details, see Table 6.

root_volume

VolumeInfo object

Explanation

System disk. For details, see Table 6.

cpu_type

String

Explanation

CPU type. Available options are x86 and Arm.

Value range

N/A

cpu

String

Explanation

Number of vCPUs.

Value range

N/A

mem

String

Explanation

Memory size.

Value range

N/A

internal_ip

String

Explanation

Internal IP address.

Value range

N/A

Table 6 VolumeInfo

Parameter

Type

Description

type

String

Explanation

Disk type.

Value range

  • SATA: common I/O disk
  • SAS: high I/O disk
  • SSD: ultra-high I/O disk
  • GPSSD: general-purpose SSD disk

size

Integer

Explanation

Disk size. Unit: GB.

Value range

N/A

count

Integer

Explanation

Disk quantity.

Value range

N/A

Table 7 Tag

Parameter

Type

Description

key

String

Explanation

Tag key

Value range

N/A

value

String

Explanation

Tag value.

Value range

N/A

Table 8 NodeDetail

Parameter

Type

Description

running_status

String

Explanation

Running status.

Value range

N/A

cpu_usage

String

Explanation

CPU utilization rate.

Value range

N/A

memory_usage

String

Explanation

Memory utilization rate.

Value range

N/A

disk_usage

String

Explanation

Disk usage.

Value range

N/A

total_memory

String

Explanation

Total memory. Unit: MB.

Value range

N/A

available_memory

String

Explanation

Available memory. Unit: MB.

Value range

N/A

total_hard_disk_space

String

Explanation

Total hard disk space. Unit: GB

Value range

N/A

available_hard_disk_space

String

Explanation

Available hard disk space. Unit: GB

Value range

N/A

network_read

String

Explanation

Network read speed. Unit: Byte/s

Value range

N/A

network_write

String

Explanation

Network write speed. Unit: Byte/s

Value range

N/A

Table 9 ComponentInfo

Parameter

Type

Description

id

String

Explanation

Component ID

Value range

N/A

name

String

Explanation

Component name

Value range

N/A

instance_group_name

String

Explanation

Name of the group to which the component belongs.

Value range

N/A

running_status

String

Explanation

Running status.

Value range

N/A

ha_status

String

Explanation

HA status.

Value range

N/A

config_status

String

Explanation

Configuration status.

Value range

N/A

role_name

String

Explanation

Role name.

Value range

N/A

role_short_name

String

Explanation

Abbreviation of a role name.

Value range

N/A

role_type

String

Explanation

Role type.

Value range

N/A

service_name

String

Explanation

Service name.

Value range

N/A

pair_name

String

Explanation

Pair name.

Value range

N/A

relation_pairs

String

Explanation

Associated pair

Value range

N/A

support_decom

String

Explanation

Whether Decom is supported.

Value range

N/A

support_reinstall

String

Explanation

Whether reinstallation is supported.

Value range

N/A

support_collect_stack_info

String

Explanation

Whether stack information can be collected.

Value range

N/A

Example Request

Query all nodes in a specified node group of a cluster.

/v2/174ee662a7e24cc99bfc858c4558dbf6/clusters/f0a91b14-8884-4ba1-9e8d-0a21086c0ab4/nodes?node_group=master_node_default_group

Example Response

Status code: 200

List node information.

{
  "nodes" : [ {
    "node_name" : "node-master1QxCW",
    "resource_id" : "fc1ed6bb-e3d8-4dc8-8162-ef673bff6b7b",
    "node_group_name" : "master_node_default_group",
    "node_type" : "Master",
    "billing_type" : "on-quantity",
    "deployment_type" : "SERVER",
    "server_info" : {
      "server_id" : "3687f50a-cd4e-4c67-8858-5d6555c8834c",
      "server_name" : "f28fb043-ecbc-401e-936e-fb321ca8d40a_node_master1QxCW",
      "server_type" : "ECS",
      "data_volumes" : [ {
        "type" : "SATA",
        "size" : 200,
        "count" : 1
      } ],
      "root_volume" : {
        "type" : "SATA",
        "size" : 100,
        "count" : 1
      },
      "cpu_type" : "X86",
      "internal_ip" : "192.168.10.142"
    },
    "tags" : [ {
      "key" : "1",
      "value" : "2"
    } ],
    "node_status" : "started"
  } ],
  "node_total" : 1
}

Status Codes

Status Codes

Description

200

List of queried nodes.

Error Codes

For details, see Error Codes.