Creating a Node Pool
Function
This API is used to create a node pool.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
POST /v2/{project_id}/pools/{pool_name}/nodepools
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 name. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
apiVersion |
Yes |
String |
API version. The options are as follows:
|
kind |
Yes |
String |
Node pool type. The options are as follows:
|
metadata |
Yes |
CreateNodePoolMetaVO object |
Node pool metadata. |
spec |
No |
NodePoolSpec object |
Request body for creating a node pool. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Node pool name. |
annotations |
No |
CreateNodePoolAnnotations object |
Node pool annotations. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
os.modelarts/billing.mode |
No |
String |
Billing mode. The options are as follows:
|
os.modelarts/period.num |
No |
String |
Subscription period on a yearly/monthly basis, for example, 2. This parameter is mandatory when the billing mode is yearly/monthly. |
os.modelarts/period.type |
No |
String |
Yearly/Monthly subscription type. The options are as follows:
This parameter is mandatory when the billing mode is yearly/monthly. |
os.modelarts/auto.renew |
No |
String |
Whether to automatically renew the subscription. The options are as follows:
|
os.modelarts/promotion.info |
No |
String |
Discount selected on the operations platform. |
os.modelarts/service.console.url |
No |
String |
URL of the page displayed after the subscription order is paid. |
os.modelarts/order.id |
No |
String |
Order ID, which is mandatory for creating a yearly/monthly resource or changing the billing mode. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
resources |
Yes |
PoolResource object |
List of resources in a node pool, including resource flavors, quantity, and custom configurations. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
flavor |
Yes |
String |
Resource flavor name, for example, modelarts.vm.gpu.t4u8. |
count |
Yes |
Integer |
Minimum count for the flavors in a pool. |
maxCount |
Yes |
Integer |
Elastic usage of the resource flavor. This parameter value is the same as the count value in a physical pool. |
azs |
No |
Array of PoolNodeAz objects |
AZ where resource pool nodes are deployed. |
nodePool |
No |
String |
Node pool name, for example, nodePool-1. |
taints |
No |
Array of Taint objects |
Taints to be added to nodes to set anti-affinity. This parameter cannot be specified for a non-privileged pool. |
labels |
No |
Map<String,String> |
Kubernetes label, in the format of a key-value pair. |
tags |
No |
Array of UserTag objects |
Resource tag. This parameter cannot be specified for a non-privileged pool. |
network |
No |
NodeNetwork object |
Network configuration. This parameter cannot be specified for a non-privileged pool. |
extendParams |
No |
Map<String,String> |
Customize the parameter configurations.
|
creatingStep |
No |
CreatingStep object |
Batch creation information. |
os |
No |
Os object |
OS image information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
az |
Yes |
String |
Constraints: N/A Range: N/A Default Value: N/A |
count |
Yes |
Integer |
Definition: Number of AZ resource instances. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Key. |
value |
No |
String |
Value. |
effect |
Yes |
String |
Effect. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Key. The value cannot start with CCE- or __type_baremetal. |
value |
Yes |
String |
Value. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
vpc |
No |
String |
VPC ID. |
subnet |
No |
String |
Subnet ID. |
securityGroups |
No |
Array of strings |
Security group IDs. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
step |
No |
Integer |
Creation step. |
type |
No |
String |
Batch creation type. The options are as follows:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
Definition: OS name. Constraints: N/A Range: N/A Default Value: N/A |
imageId |
No |
String |
Definition: OS image ID. Constraints: N/A Range: N/A Default Value: N/A |
imageType |
No |
String |
Definition: OS image type. Constraints: N/A Range:
Default Value: N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
API version. The options are as follows:
|
kind |
String |
Node pool type. The options are as follows:
|
metadata |
CreateNodePoolMetaVO object |
Node pool metadata. |
spec |
NodePoolSpec object |
Request body for creating a node pool. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Node pool name. |
annotations |
CreateNodePoolAnnotations object |
Node pool annotations. |
Parameter |
Type |
Description |
---|---|---|
os.modelarts/billing.mode |
String |
Billing mode. The options are as follows:
|
os.modelarts/period.num |
String |
Subscription period on a yearly/monthly basis, for example, 2. This parameter is mandatory when the billing mode is yearly/monthly. |
os.modelarts/period.type |
String |
Yearly/Monthly subscription type. The options are as follows:
This parameter is mandatory when the billing mode is yearly/monthly. |
os.modelarts/auto.renew |
String |
Whether to automatically renew the subscription. The options are as follows:
|
os.modelarts/promotion.info |
String |
Discount selected on the operations platform. |
os.modelarts/service.console.url |
String |
URL of the page displayed after the subscription order is paid. |
os.modelarts/order.id |
String |
Order ID, which is mandatory for creating a yearly/monthly resource or changing the billing mode. |
Parameter |
Type |
Description |
---|---|---|
resources |
PoolResource object |
List of resources in a node pool, including resource flavors, quantity, and custom configurations. |
Parameter |
Type |
Description |
---|---|---|
flavor |
String |
Resource flavor name, for example, modelarts.vm.gpu.t4u8. |
count |
Integer |
Minimum count for the flavors in a pool. |
maxCount |
Integer |
Elastic usage of the resource flavor. This parameter value is the same as the count value in a physical pool. |
azs |
Array of PoolNodeAz objects |
AZ where resource pool nodes are deployed. |
nodePool |
String |
Node pool name, for example, nodePool-1. |
taints |
Array of Taint objects |
Taints to be added to nodes to set anti-affinity. This parameter cannot be specified for a non-privileged pool. |
labels |
Map<String,String> |
Kubernetes label, in the format of a key-value pair. |
tags |
Array of UserTag objects |
Resource tag. This parameter cannot be specified for a non-privileged pool. |
network |
NodeNetwork object |
Network configuration. This parameter cannot be specified for a non-privileged pool. |
extendParams |
Map<String,String> |
Customize the parameter configurations.
|
creatingStep |
CreatingStep object |
Batch creation information. |
os |
Os object |
OS image information. |
Parameter |
Type |
Description |
---|---|---|
az |
String |
Constraints: N/A Range: N/A Default Value: N/A |
count |
Integer |
Definition: Number of AZ resource instances. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Key. The value cannot start with CCE- or __type_baremetal. |
value |
String |
Value. |
Parameter |
Type |
Description |
---|---|---|
vpc |
String |
VPC ID. |
subnet |
String |
Subnet ID. |
securityGroups |
Array of strings |
Security group IDs. |
Parameter |
Type |
Description |
---|---|---|
step |
Integer |
Creation step. |
type |
String |
Batch creation type. The options are as follows:
|
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: OS name. Constraints: N/A Range: N/A Default Value: N/A |
imageId |
String |
Definition: OS image ID. Constraints: N/A Range: N/A Default Value: N/A |
imageType |
String |
Definition: OS image type. Constraints: N/A Range:
Default Value: N/A |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Range: N/A |
error_msg |
String |
Definition: Error message. Range: N/A |
Example Requests
Create a node pool.
POST https://{endpoint}/v2/{project_id}/pools/{pool_name}/nodepools { "kind" : "NodePool", "apiVersion" : "v2", "metadata" : { "name" : "nodepool-1", "annotations" : { } }, "spec" : { "resources" : { "nodePool" : "nodepool-1", "flavor" : "modelarts.vm.2u4g.dcc", "count" : 1, "maxCount" : 1, "network" : { "vpc" : "277e9abc-0e6b-431a-9232-cfd25d5fc566", "subnet" : "03796378-c356-4c14-826b-e4913aa9c8b9", "securityGroups" : [ "0a15b48d-06f1-41e4-b782-ade90087bf59" ] } } } }
Example Responses
Status code: 200
OK.
{ "kind" : "NodePool", "apiVersion" : "v2", "metadata" : { "name" : "nodepool-1", "annotations" : { } }, "spec" : { "resources" : { "nodePool" : "nodepool-1", "flavor" : "modelarts.vm.2u4g.dcc", "count" : 1, "maxCount" : 1, "network" : { "vpc" : "277e9abc-0e6b-431a-9232-cfd25d5fc566", "subnet" : "03796378-c356-4c14-826b-e4913aa9c8b9", "securityGroups" : [ "0a15b48d-06f1-41e4-b782-ade90087bf59" ] } } } }
Status code: 400
Bad request
{ "error_code" : "ModelArts.50004000", "error_msg" : "Bad request." }
Status Codes
Status Code |
Description |
---|---|
200 |
OK. |
400 |
Bad request |
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