Go (SDK)
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.UpdateLksCluster(ctx, "<id>", components.UpdateLksCluster{
Data: components.UpdateLksClusterData{
Type: components.UpdateLksClusterTypeLksClusters,
Attributes: &components.UpdateLksClusterAttributes{
Name: latitudeshgosdk.Pointer("production-eu"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.LksCluster != nil {
// handle response
}
}curl --request PATCH \
--url https://api.latitude.sh/lks/clusters/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "lks_clusters",
"attributes": {
"name": "production-eu"
}
}
}
'import requests
url = "https://api.latitude.sh/lks/clusters/{id}"
payload = { "data": {
"type": "lks_clusters",
"attributes": { "name": "production-eu" }
} }
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_clusters', attributes: {name: 'production-eu'}}})
};
fetch('https://api.latitude.sh/lks/clusters/{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/{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_clusters',
'attributes' => [
'name' => 'production-eu'
]
]
]),
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/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"lks_clusters\",\n \"attributes\": {\n \"name\": \"production-eu\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/lks/clusters/{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_clusters\",\n \"attributes\": {\n \"name\": \"production-eu\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "lksc_pRMLydp0dQKr1",
"type": "lks_clusters",
"attributes": {
"name": "production",
"description": "",
"project_id": "proj_6059EqYkOQj8p",
"site": "DAL2",
"status": "upgrading",
"message": "upgrading the cluster",
"reason": "Upgrading",
"control_plane_endpoint": "https://lksc-prmlydp0dqkr1.lks.latitude.sh:6443",
"kubeconfig_url": "/lks/clusters/lksc_pRMLydp0dQKr1/kubeconfig",
"kubernetes_version": "1.36.3",
"platform_version": "lks-v1.36.3-002",
"network": {
"pod_cidrs": [
"10.0.0.0/12"
],
"service_cidrs": [
"10.96.0.0/15"
],
"node_cidrs": [
"10.16.0.0/21"
]
},
"created_at": "2026-09-01T12:00:00Z",
"updated_at": "2026-09-01T12:18:00Z"
}
}
}LKS
Update an LKS cluster
Renames a cluster, edits its description, or upgrades the control plane. At least one of name, description or kubernetes_version must be provided.
Setting a newer kubernetes_version consents to a control-plane upgrade; the value must be a patch listed by GET /lks/available_versions with available_for_upgrade: true and must not be lower than the current one. Node pools are upgraded separately and must never run a patch newer than the control plane.
The cluster must be idle: a cluster that is provisioning, updating, scaling, upgrading, paused or deleting rejects the request with 409.
PATCH
/
lks
/
clusters
/
{id}
Go (SDK)
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.UpdateLksCluster(ctx, "<id>", components.UpdateLksCluster{
Data: components.UpdateLksClusterData{
Type: components.UpdateLksClusterTypeLksClusters,
Attributes: &components.UpdateLksClusterAttributes{
Name: latitudeshgosdk.Pointer("production-eu"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.LksCluster != nil {
// handle response
}
}curl --request PATCH \
--url https://api.latitude.sh/lks/clusters/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "lks_clusters",
"attributes": {
"name": "production-eu"
}
}
}
'import requests
url = "https://api.latitude.sh/lks/clusters/{id}"
payload = { "data": {
"type": "lks_clusters",
"attributes": { "name": "production-eu" }
} }
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_clusters', attributes: {name: 'production-eu'}}})
};
fetch('https://api.latitude.sh/lks/clusters/{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/{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_clusters',
'attributes' => [
'name' => 'production-eu'
]
]
]),
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/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"lks_clusters\",\n \"attributes\": {\n \"name\": \"production-eu\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/lks/clusters/{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_clusters\",\n \"attributes\": {\n \"name\": \"production-eu\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "lksc_pRMLydp0dQKr1",
"type": "lks_clusters",
"attributes": {
"name": "production",
"description": "",
"project_id": "proj_6059EqYkOQj8p",
"site": "DAL2",
"status": "upgrading",
"message": "upgrading the cluster",
"reason": "Upgrading",
"control_plane_endpoint": "https://lksc-prmlydp0dqkr1.lks.latitude.sh:6443",
"kubeconfig_url": "/lks/clusters/lksc_pRMLydp0dQKr1/kubeconfig",
"kubernetes_version": "1.36.3",
"platform_version": "lks-v1.36.3-002",
"network": {
"pod_cidrs": [
"10.0.0.0/12"
],
"service_cidrs": [
"10.96.0.0/15"
],
"node_cidrs": [
"10.16.0.0/21"
]
},
"created_at": "2026-09-01T12:00:00Z",
"updated_at": "2026-09-01T12:18:00Z"
}
}
}Was this page helpful?