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
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. |
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 during pagination query. |
remainingItemCount |
Long |
Number of remaining resources. |
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
API version. Options:
|
kind |
String |
Resource type. Options:
|
metadata |
metadata object |
Specifies the node metadata information. |
spec |
NodeSpec object |
Expected node information. |
status |
NodeStatus object |
Node status. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Node name. |
creationTimestamp |
String |
Creation time. |
Parameter |
Type |
Description |
---|---|---|
phase |
String |
Node status. The options are as follows:
|
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. |
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
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot