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

Obtaining Nodes

Function

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

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

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

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 during pagination query.

remainingItemCount

Long

Number of remaining resources.

Table 5 Node

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v2

kind

String

Resource type. Options:

  • Node: node

metadata

metadata object

Specifies the node metadata information.

spec

NodeSpec object

Expected node information.

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. The options are as follows:

  • Available: The node is available.

  • Creating: The node is being created.

  • Deleting: The node is being deleted.

  • Abnormal: The node is not running properly.

  • Checking: The node is performing a self-check.

az

String

Indicates the AZ where the node is located.

privateIp

String

Node IP address

resources

NodeResource object

Node resource information.

availableResources

NodeResource object

Available resources of a node.

Table 9 NodeResource

Parameter

Type

Description

cpu

String

Number of CPU resources.

memory

String

Indicates the amount of memory resources.

nvidia.com/gpu

String

Number of GPU resources on a GPU node.

huawei.com/ascend-snt3

String

Number of NPUs on the Ascend node

huawei.com/ascend-snt9

String

Number of NPUs on the Ascend node

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error codes of ModelArts.

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" : "cn-north-7c",
      "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" : "cn-north-7c",
      "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" : "cn-north-7c",
      "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.