Updated on 2024-06-13 GMT+08:00

Obtaining Nodes

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.

pool_name

Yes

String

Name of a resource pool.

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 resources.

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

metadata object

Basic node information.

spec

NodeSpec object

Node description.

status

NodeStatus object

Node status.

Table 6 metadata

Parameter

Type

Description

name

String

Node name.

creationTimestamp

String

Creation time.

Table 7 NodeSpec

Parameter

Type

Description

flavor

String

Node specifications

Table 8 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

Table 9 NodeResource

Parameter

Type

Description

cpu

String

CPUs.

memory

String

Memory.

nvidia.com/gpu

String

GPUs.

huawei.com/ascend-310

String

Ascend 310.

huawei.com/ascend-1980

String

Ascend snt9.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

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.