Obtaining Nodes in a Resource Pool

Function

This API is used to obtain nodes in a resource pool.

URI

GET /v2/{project_id}/pools/{pool_name}/nodes

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

pool_name

Yes

String

Resource pool ID. The value is the metadata.name field in the resource pool details.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

continue

No

String

Previous query location in pagination query.

limit

No

Integer

Number of records returned for a single pagination query.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v2

kind

String

Resource type. Options:

  • NodeList: nodes

metadata

NodeListMetadata object

Metadata of the resource list, including pagination information.

items

Array of Node objects

Nodes.

Table 4 NodeListMetadata

Parameter

Type

Description

continue

String

Next query position in pagination query

remainingItemCount

Long

Remaining resources

Table 5 Node

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v2

kind

String

Resource type. Options:

  • Node: node

metadata

NodeMetadata object

Node metadata information, including the node name, creation time, and billing mode.

spec

NodeSpec object

Node description.

status

NodeStatus object

Node status.

Table 6 NodeMetadata

Parameter

Type

Description

name

String

Node name.

creationTimestamp

String

Creation time.

labels

NodeLabels object

Label information of a node.

annotations

NodeVOAnnotations object

Node annotations.

Table 7 NodeLabels

Parameter

Type

Description

os.modelarts.node/cluster

String

Name of the cluster where the node is located

os.modelarts.node/batch.uid

String

ID of a batch creation.

os.modelarts.node/batch.name

String

Name of a batch creation.

os.modelarts.node/volcano.scheduler.cabinet-exclusive

String

Whether the node is exclusively occupied by the job of the entire cabinet. If yes, the label exists and its value is the ID of the exclusive training job.

cce.kubectl.kubernetes.io/cabinet

String

IP address of the TOR switch where the node is located. Use hyphens (-) to separate multiple IP addresses.

Table 8 NodeVOAnnotations

Parameter

Type

Description

os.modelarts/npu-topology-placement

String

Topology of the 910 card placement. The bits are numbered from 0 to 15 from right to left. Bit 1 indicates that the card is occupied.

os.modelarts.node/drain

String

Node drainage information.

Table 9 NodeSpec

Parameter

Type

Description

flavor

String

Node specifications

hostNetwork

NodeNetwork object

Node network information

Table 10 NodeNetwork

Parameter

Type

Description

vpc

String

VPC ID

subnet

String

Subnet ID

securityGroups

Array of strings

Security group IDs

Table 11 NodeStatus

Parameter

Type

Description

phase

String

Node status. Options:

  • Available: The node is available.

  • Creating: The node is being created.

  • Deleting: The node is being deleted.

  • Abnormal: The node is not running properly.

az

String

AZ to which the node belongs

privateIp

String

IP address of a node

resources

NodeResource object

Node resources

availableResources

NodeResource object

Available node resources

taints

Array of Taint objects

Node taints.

Table 12 NodeResource

Parameter

Type

Description

cpu

String

CPUs.

memory

String

Memory.

nvidia.com/gpu

String

GPUs.

Table 13 Taint

Parameter

Type

Description

key

String

Taint key to be applied to the node.

value

String

Taint value associated with the taint key.

effect

String

Impact of a taint on containers that do not tolerate it. Options:

  • NoSchedule: New pods cannot be scheduled to the node with this taint, but pods that have been running on the node can continue to run.

  • PreferNoSchedule: Do not schedule new pods to nodes with this taint. This is not completely forbidden.

  • NoExecute: Pods running on the node with this taint will be evicted if they cannot tolerate it.

timeAdded

String

Time when a taint is added.

Status code: 404

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Obtain nodes in a resource pool.

GET https://{endpoint}/v2/{project_id}/pools/{pool_name}/nodes

{ }

Example Responses

Status code: 200

OK

{
  "kind" : "NodeList",
  "apiVersion" : "v2",
  "metadata" : { },
  "items" : [ {
    "kind" : "Node",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "os-node-created-zlncn",
      "creationTimestamp" : "2022-09-16T05:32:44Z"
    },
    "spec" : {
      "flavor" : "modelarts.vm.cpu.4ud"
    },
    "status" : {
      "phase" : "Available",
      "az" : "xx-xxxx-xx",
      "privateIp" : "192.168.0.1",
      "resources" : {
        "cpu" : "3920m",
        "memory" : "6270Mi"
      },
      "availableResources" : {
        "cpu" : "2970m",
        "memory" : "4558Mi"
      }
    }
  }, {
    "kind" : "Node",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "os-node-created-4s522",
      "creationTimestamp" : "2022-09-16T03:20:53Z"
    },
    "spec" : {
      "flavor" : "modelarts.vm.cpu.4ud"
    },
    "status" : {
      "phase" : "Available",
      "az" : "xx-xxxx-xx",
      "privateIp" : "192.168.0.2",
      "resources" : {
        "cpu" : "3920m",
        "memory" : "6270Mi"
      },
      "availableResources" : {
        "cpu" : "2970m",
        "memory" : "4558Mi"
      }
    }
  }, {
    "kind" : "Node",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "os-node-created-v7hfj",
      "creationTimestamp" : "2022-09-16T09:16:37Z"
    },
    "spec" : {
      "flavor" : "modelarts.vm.cpu.4ud"
    },
    "status" : {
      "phase" : "Available",
      "az" : "xx-xxxx-xx",
      "privateIp" : "192.168.0.3",
      "resources" : {
        "cpu" : "3920m",
        "memory" : "6270Mi"
      },
      "availableResources" : {
        "cpu" : "3720m",
        "memory" : "5670Mi"
      }
    }
  } ]
}

Status code: 404

Not found.

{
  "error_code" : "ModelArts.50015001",
  "error_msg" : "pool not found"
}

Status Codes

Status Code

Description

200

OK

404

Not found.

Error Codes

See Error Codes.