package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Lks.UpdateLksNodePool(ctx, "<id>", "<id>", components.UpdateLksNodePool{
Data: components.UpdateLksNodePoolData{
Type: components.UpdateLksNodePoolTypeLksNodePools,
Attributes: &components.UpdateLksNodePoolAttributes{
Count: latitudeshgosdk.Pointer[int64](4),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.LksNodePool != nil {
// handle response
}
}curl --request PATCH \
--url https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "lks_node_pools",
"attributes": {
"count": 4
}
}
}
'import requests
url = "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}"
payload = { "data": {
"type": "lks_node_pools",
"attributes": { "count": 4 }
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {type: 'lks_node_pools', attributes: {count: 4}}})
};
fetch('https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'lks_node_pools',
'attributes' => [
'count' => 4
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"lks_node_pools\",\n \"attributes\": {\n \"count\": 4\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"lks_node_pools\",\n \"attributes\": {\n \"count\": 4\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "lksnp_9dQKr1pRMLyd",
"type": "lks_node_pools",
"attributes": {
"name": "pool-a",
"type": "bare_metal",
"mode": "on_demand",
"plan": "c2-small-x86",
"description": "",
"count": 4,
"max_pods_per_node": null,
"kubernetes_version": "1.36.3",
"platform_version": "lks-v1.36.3-002",
"status": "scaling",
"message": "scaling the node pool",
"reason": "Scaling",
"ready_nodes": 2,
"labels": {
"workload": "general"
},
"taints": [
{
"key": "dedicated",
"value": "gpu",
"effect": "NoSchedule"
}
],
"created_at": "2026-09-01T12:05:00Z",
"updated_at": "2026-09-01T12:22:00Z"
}
}
}Update a node pool
Scales, renames, upgrades or re-labels a node pool. At least one attribute must be provided.
labels and taints are declarative replacements, not merges: omit the field to leave it untouched, send the whole map/list to replace it, or send {} / [] to clear it.
A newer kubernetes_version rolls a node-recreating upgrade; it must not be lower than the pool’s current patch nor newer than the control-plane patch. max_pods_per_node is immutable — a PATCH that carries it is rejected with 422 even if the value is unchanged.
The node pool must be idle: one that is provisioning, updating, scaling, upgrading, paused or deleting rejects the request with 409.
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Lks.UpdateLksNodePool(ctx, "<id>", "<id>", components.UpdateLksNodePool{
Data: components.UpdateLksNodePoolData{
Type: components.UpdateLksNodePoolTypeLksNodePools,
Attributes: &components.UpdateLksNodePoolAttributes{
Count: latitudeshgosdk.Pointer[int64](4),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.LksNodePool != nil {
// handle response
}
}curl --request PATCH \
--url https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "lks_node_pools",
"attributes": {
"count": 4
}
}
}
'import requests
url = "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}"
payload = { "data": {
"type": "lks_node_pools",
"attributes": { "count": 4 }
} }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {type: 'lks_node_pools', attributes: {count: 4}}})
};
fetch('https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'lks_node_pools',
'attributes' => [
'count' => 4
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"lks_node_pools\",\n \"attributes\": {\n \"count\": 4\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"lks_node_pools\",\n \"attributes\": {\n \"count\": 4\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "lksnp_9dQKr1pRMLyd",
"type": "lks_node_pools",
"attributes": {
"name": "pool-a",
"type": "bare_metal",
"mode": "on_demand",
"plan": "c2-small-x86",
"description": "",
"count": 4,
"max_pods_per_node": null,
"kubernetes_version": "1.36.3",
"platform_version": "lks-v1.36.3-002",
"status": "scaling",
"message": "scaling the node pool",
"reason": "Scaling",
"ready_nodes": 2,
"labels": {
"workload": "general"
},
"taints": [
{
"key": "dedicated",
"value": "gpu",
"effect": "NoSchedule"
}
],
"created_at": "2026-09-01T12:05:00Z",
"updated_at": "2026-09-01T12:22:00Z"
}
}
}Authorizations
Path Parameters
The cluster ID (format: lksc_<hash>).
The node pool ID (format: lksnp_<hash>).
Body
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
Was this page helpful?