Obtaining Nodes
Function
This API is used to obtain nodes in a resource pool.
URI
GET /v2/{project_id}/pools/{pool_name}/nodes
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
pool_name |
Yes |
String |
Name of a resource pool. |
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
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
API version. Options: |
kind |
String |
Resource type. Options: |
metadata |
NodeListMetadata object |
Metadata of resources. |
items |
Array of Node objects |
Nodes. |
Parameter |
Type |
Description |
---|---|---|
continue |
String |
Next query position in pagination query |
remainingItemCount |
Long |
Remaining resources |
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
API version. Options: |
kind |
String |
Resource type. Options: |
metadata |
metadata object |
Basic node information. |
spec |
NodeSpec object |
Node description. |
status |
NodeStatus object |
Node status. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Node name. |
creationTimestamp |
String |
Creation time. |
Parameter |
Type |
Description |
---|---|---|
phase |
String |
Node status. Options: |
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 |
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
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.