Updating a Node Pool
Function
This API is used to update the configurations of a specified node pool. This API is used when you need to expand the capacity of a node pool, adjust node specifications, optimize resource allocation, or repair node pool configurations. Before using this API, ensure that the node pool exists and you have the administrator permissions. After the update, the configurations of the node pool will be updated, including the number of nodes, node specifications, and network configurations. If the node pool does not exist, the user does not have the permission to operate the node pool, or the configuration parameters are incorrect, 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.
URI
PATCH /v2/{project_id}/pools/{pool_name}/nodepools/{nodepool_name}
|
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 |
|
nodepool_name |
Yes |
String |
Definition: Node pool name. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Content-Type |
Yes |
String |
Definition: Message body type (format). Constraints: N/A Range
Default Value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
spec |
Yes |
NodePoolSpec object |
Definition: Request body for updating a node pool Constraints: 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. It is greater than or equal to the count value in a logical pool. Range: N/A |
|
azs |
No |
Array of PoolNodeAz objects |
Definition: AZ distribution of the node 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. Range: N/A |
|
tags |
No |
Array of UserTags objects |
Definition: Resource tag. This parameter cannot be specified for a non-privileged pool. Range: N/A |
|
network |
No |
NodeNetwork object |
Definition: Network configuration. This parameter cannot be specified for a non-privileged pool. |
|
extendParams |
No |
Map<String,String> |
Definition: Custom configuration parameters.
|
|
creatingStep |
No |
CreatingStep object |
Definition: Information about batch creation. |
|
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 |
Constraints: N/A Range: N/A Default Value: N/A |
|
subnet |
No |
String |
Definition: Subnet ID. Constraints: N/A Range: N/A Default Value: N/A |
|
securityGroups |
No |
Array of strings |
Definition: Security group ID set. Constraints: N/A |
|
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 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
spec |
NodePoolSpec object |
Definition: Request body for updating a node pool Constraints: 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. It is greater than or equal to the count value in a logical pool. Range: N/A |
|
azs |
Array of PoolNodeAz objects |
Definition: AZ distribution of the node 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. Range: N/A |
|
tags |
Array of UserTags objects |
Definition: Resource tag. This parameter cannot be specified for a non-privileged pool. Range: N/A |
|
network |
NodeNetwork object |
Definition: Network configuration. This parameter cannot be specified for a non-privileged pool. |
|
extendParams |
Map<String,String> |
Definition: Custom configuration parameters.
|
|
creatingStep |
CreatingStep object |
Definition: Information about batch creation. |
|
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 |
Constraints: N/A Range: N/A Default Value: N/A |
|
subnet |
String |
Definition: Subnet ID. Constraints: N/A Range: N/A Default Value: N/A |
|
securityGroups |
Array of strings |
Definition: Security group ID set. Constraints: N/A |
|
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 |
|---|---|---|
|
name |
String |
Definition: OS name. Range: N/A |
|
imageId |
String |
Definition: OS image ID. Range: N/A |
|
imageType |
String |
Definition: OS image type. Range:
|
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Range: N/A |
|
error_msg |
String |
Definition: Error message. Range: N/A |
Example Requests
Update a node pool.
PATCH https://{endpoint}/v2/{project_id}/pools/{pool_name}/nodepools/{nodepool_name}
{
"spec" : {
"resources" : {
"nodePool" : "modelarts.vm.2u4g.dcc-Default",
"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.
{
"spec" : {
"resources" : {
"nodePool" : "modelarts.vm.2u4g.dcc-Default",
"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