Creating a Node Pool
Function
This API is used to create a node pool. This API is used when you need to create a node pool with specified configurations when you need to expand compute resources, optimize resource allocation, or deploy new services. Before using this API, ensure that you have the administrator permission and the node pool parameters (such as the number of nodes, specifications, and network configurations) are correctly set. After the creation, the node pool will be created and be available, and the related node information will be recorded. If you do not have the required permission, the parameter settings are incorrect, or system resources are insufficient, the API will return an error message.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
POST /v2/{project_id}/pools/{pool_name}/nodepools
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: User project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
|
pool_name |
Yes |
String |
Definition: Resource pool name. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
apiVersion |
Yes |
String |
Definition: API version. Range: |
|
kind |
Yes |
String |
Definition: Node pool type. Range: |
|
metadata |
Yes |
CreateNodePoolMetaVO object |
Definition: Node pool metadata. |
|
spec |
No |
NodePoolSpec object |
Definition: Node pool expectation. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition: Node pool name. Constraints: N/A Range: N/A Default Value: N/A |
|
annotations |
No |
CreateNodePoolAnnotations object |
Definition: Node pool annotations. Constraints: N/A Range: N/A Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
os.modelarts/billing.mode |
No |
String |
Definition: Billing mode. Constraints: N/A Range: Default Value: N/A |
|
os.modelarts/period.num |
No |
String |
Definition: Subscription period on a yearly/monthly basis, for example, 2. This parameter is mandatory when the billing mode is yearly/monthly. Constraints: N/A Range: N/A Default Value: N/A |
|
os.modelarts/period.type |
No |
String |
Definition: Subscription type on a yearly/monthly basis. This parameter is mandatory when the billing mode is yearly/monthly. Constraints: N/A Range: Default Value: N/A |
|
os.modelarts/auto.renew |
No |
String |
Definition: Specifies whether to automatically renew the subscription. Constraints: N/A Range: Default Value: 0 |
|
os.modelarts/promotion.info |
No |
String |
Definition: Discount selected on the operations platform. Constraints: N/A Range: N/A Default Value: N/A |
|
os.modelarts/service.console.url |
No |
String |
Definition: URL of the page displayed after the subscription order is paid. Constraints: N/A Range: N/A Default Value: N/A |
|
os.modelarts/order.id |
No |
String |
Definition: Order ID, which is mandatory for creating a yearly/monthly resource or changing the billing mode. Constraints: N/A Range: N/A Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resources |
Yes |
PoolResource object |
Definition: List of resources in a node pool, including resource flavors, quantity, and custom configurations. Range: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
flavor |
Yes |
String |
Definition: Resource flavor name, for example, modelarts.vm.gpu.t4u8. Range: N/A. |
|
count |
Yes |
Integer |
Definition: Committed specifications. Range: N/A. |
|
maxCount |
Yes |
Integer |
Definition: Elastic usage of the resource flavor. This parameter value is the same the count value in a physical pool. Range: N/A. |
|
azs |
No |
Array of PoolNodeAz objects |
Definition: AZ information of nodes in the resource pool. |
|
nodePool |
No |
String |
Definition: Node pool name, for example, nodePool-1. Range: N/A. |
|
taints |
No |
Array of Taints objects |
Definition: 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> |
Definition: Kubernetes label, in key-value pair format. |
|
tags |
No |
Array of UserTags objects |
Definition: Resource tag. This parameter cannot be specified for a non-privileged pool. |
|
network |
No |
NodeNetwork object |
Definition: Network configuration. This parameter cannot be specified for a non-privileged pool. |
|
extendParams |
No |
ResourceExtendParams object |
Definition: Custom configuration. |
|
creatingStep |
No |
CreatingStep object |
Definition: Information about batch creation. |
|
rootVolume |
No |
RootVolume object |
Definition: Information about the custom system disk (cloud hard disk). |
|
dataVolumes |
No |
Array of DataVolumeItem objects |
Definition: List of custom data disks (cloud hard disks). |
|
volumeGroupConfigs |
No |
Array of VolumeGroupConfig objects |
Definition: Advanced disk configuration. This parameter is mandatory when a custom data disk exists. |
|
os |
No |
Os object |
Definition: OS image information. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
az |
Yes |
String |
Definition: AZ name. Range: N/A |
|
count |
Yes |
Integer |
Definition: Number of AZ resource instances. Range: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Definition: Key. Range: N/A |
|
value |
No |
String |
Value. |
|
effect |
Yes |
String |
Effect. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Definition: Key. The value cannot start with CCE- or __type_baremetal. Range: N/A |
|
value |
Yes |
String |
Value. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
vpc |
No |
String |
Range: N/A. |
|
subnet |
No |
String |
Definition: Subnet ID. Range: N/A. |
|
securityGroups |
No |
Array of strings |
Definition: Security group ID set. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
step |
No |
Integer |
Definition: Step of a supernode. Constraints: N/A Range: Only the step contained in the resource specification details is supported. Default Value: N/A |
|
type |
No |
String |
Definition: Batch creation type. Constraints: N/A Range: Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volumeType |
Yes |
String |
Definition: Disk type.. Range: |
|
size |
Yes |
String |
Definition: Disk size, in GiB. Range: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volumeType |
Yes |
String |
Definition: Disk type.. Range: |
|
size |
Yes |
String |
Definition: Disk size, in GiB. Range: N/A. |
|
count |
No |
Integer |
Definition: Number of disks. Range: N/A. |
|
extendParams |
Yes |
VolumeExtendParams object |
Definition: Custom disk configuration. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volumeGroup |
Yes |
String |
Definition: Disk group name. Index of the volume group in the dataVolumes. Range: N/A. |
|
dockerThinPool |
No |
Integer |
Definition: Percentage of data disks designated as container disks. This parameter can be specified only when volumeGroup is vgpaas (container disk). Range: N/A. |
|
lvmConfig |
No |
LvmConfig object |
Definition: LVM configuration management. |
|
types |
No |
Array of strings |
Definition: Storage type. Options: |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
lvType |
Yes |
String |
Definition: LVM write mode. Range: |
|
path |
No |
String |
Definition: Disk mount path. This parameter takes effect only in user configuration. The value is an absolute path. Digits, letters, periods (.), hyphens (-), and underscores (_) are allowed. Range: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
No |
String |
Definition: OS name and version, for example, EulorOS 2.5. This parameter can be left blank when a private image is specified. Range: N/A. |
|
imageId |
No |
String |
Definition: OS image ID. Range: N/A. |
|
imageType |
No |
String |
Definition: OS image type. This parameter must be specified when a private image is set. By default, the preset image is used. You do not need to specify this field. Range: |
|
autoMatch |
No |
String |
Definition: Automatic OS image matching configuration. If this parameter is set, the optimal image is automatically selected, and this parameter is automatically cleared. Range: OS name and version, for example, EulorOS 2.5. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
apiVersion |
String |
Definition: API version. Range: |
|
kind |
String |
Definition: Node pool type. Range: |
|
metadata |
CreateNodePoolMetaVO object |
Definition: Node pool metadata. |
|
spec |
NodePoolSpec object |
Definition: Node pool expectation. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Definition: Node pool name. Constraints: N/A Range: N/A Default Value: N/A |
|
annotations |
CreateNodePoolAnnotations object |
Definition: Node pool annotations. Constraints: N/A Range: N/A Default Value: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
os.modelarts/billing.mode |
String |
Definition: Billing mode. Constraints: N/A Range: Default Value: N/A |
|
os.modelarts/period.num |
String |
Definition: Subscription period on a yearly/monthly basis, for example, 2. This parameter is mandatory when the billing mode is yearly/monthly. Constraints: N/A Range: N/A Default Value: N/A |
|
os.modelarts/period.type |
String |
Definition: Subscription type on a yearly/monthly basis. This parameter is mandatory when the billing mode is yearly/monthly. Constraints: N/A Range: Default Value: N/A |
|
os.modelarts/auto.renew |
String |
Definition: Specifies whether to automatically renew the subscription. Constraints: N/A Range: Default Value: 0 |
|
os.modelarts/promotion.info |
String |
Definition: Discount selected on the operations platform. Constraints: N/A Range: N/A Default Value: N/A |
|
os.modelarts/service.console.url |
String |
Definition: URL of the page displayed after the subscription order is paid. Constraints: N/A Range: N/A Default Value: N/A |
|
os.modelarts/order.id |
String |
Definition: Order ID, which is mandatory for creating a yearly/monthly resource or changing the billing mode. Constraints: N/A Range: N/A Default Value: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
resources |
PoolResource object |
Definition: List of resources in a node pool, including resource flavors, quantity, and custom configurations. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
flavor |
String |
Definition: Resource flavor name, for example, modelarts.vm.gpu.t4u8. Range: N/A. |
|
count |
Integer |
Definition: Committed specifications. Range: N/A. |
|
maxCount |
Integer |
Definition: Elastic usage of the resource flavor. This parameter value is the same the count value in a physical pool. Range: N/A. |
|
azs |
Array of PoolNodeAz objects |
Definition: AZ information of nodes in the resource pool. |
|
nodePool |
String |
Definition: Node pool name, for example, nodePool-1. Range: N/A. |
|
taints |
Array of Taints objects |
Definition: Taints to be added to nodes to set anti-affinity. This parameter cannot be specified for a non-privileged pool. |
|
labels |
Map<String,String> |
Definition: Kubernetes label, in key-value pair format. |
|
tags |
Array of UserTags objects |
Definition: Resource tag. This parameter cannot be specified for a non-privileged pool. |
|
network |
NodeNetwork object |
Definition: Network configuration. This parameter cannot be specified for a non-privileged pool. |
|
extendParams |
ResourceExtendParams object |
Definition: Custom configuration. |
|
creatingStep |
CreatingStep object |
Definition: Information about batch creation. |
|
rootVolume |
RootVolume object |
Definition: Information about the custom system disk (cloud hard disk). |
|
dataVolumes |
Array of DataVolumeItem objects |
Definition: List of custom data disks (cloud hard disks). |
|
volumeGroupConfigs |
Array of VolumeGroupConfig objects |
Definition: Advanced disk configuration. This parameter is mandatory when a custom data disk exists. |
|
os |
Os object |
Definition: OS image information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
az |
String |
Definition: AZ name. Range: N/A |
|
count |
Integer |
Definition: Number of AZ resource instances. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Key. Range: N/A |
|
value |
String |
Value. |
|
effect |
String |
Effect. |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Key. The value cannot start with CCE- or __type_baremetal. Range: N/A |
|
value |
String |
Value. |
|
Parameter |
Type |
Description |
|---|---|---|
|
vpc |
String |
Range: N/A. |
|
subnet |
String |
Definition: Subnet ID. Range: N/A. |
|
securityGroups |
Array of strings |
Definition: Security group ID set. |
|
Parameter |
Type |
Description |
|---|---|---|
|
step |
Integer |
Definition: Step of a supernode. Constraints: N/A Range: Only the step contained in the resource specification details is supported. Default Value: N/A |
|
type |
String |
Definition: Batch creation type. Constraints: N/A Range: Default Value: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
volumeType |
String |
Definition: Disk type.. Range: |
|
size |
String |
Definition: Disk size, in GiB. Range: N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
volumeType |
String |
Definition: Disk type.. Range: |
|
size |
String |
Definition: Disk size, in GiB. Range: N/A. |
|
count |
Integer |
Definition: Number of disks. Range: N/A. |
|
extendParams |
VolumeExtendParams object |
Definition: Custom disk configuration. |
|
Parameter |
Type |
Description |
|---|---|---|
|
volumeGroup |
String |
Definition: Disk group name. Index of the volume group in the dataVolumes. Range: N/A. |
|
dockerThinPool |
Integer |
Definition: Percentage of data disks designated as container disks. This parameter can be specified only when volumeGroup is vgpaas (container disk). Range: N/A. |
|
lvmConfig |
LvmConfig object |
Definition: LVM configuration management. |
|
types |
Array of strings |
Definition: Storage type. Options: |
|
Parameter |
Type |
Description |
|---|---|---|
|
lvType |
String |
Definition: LVM write mode. Range: |
|
path |
String |
Definition: Disk mount path. This parameter takes effect only in user configuration. The value is an absolute path. Digits, letters, periods (.), hyphens (-), and underscores (_) are allowed. Range: N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Definition: OS name and version, for example, EulorOS 2.5. This parameter can be left blank when a private image is specified. Range: N/A. |
|
imageId |
String |
Definition: OS image ID. Range: N/A. |
|
imageType |
String |
Definition: OS image type. This parameter must be specified when a private image is set. By default, the preset image is used. You do not need to specify this field. Range: |
|
autoMatch |
String |
Definition: Automatic OS image matching configuration. If this parameter is set, the optimal image is automatically selected, and this parameter is automatically cleared. Range: OS name and version, for example, EulorOS 2.5. |
Status code: 400
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