Go (SDK)
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Lks.ListLksNodePools(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.LksNodePools != nil {
// handle response
}
}curl --request GET \
--url https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
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": 2,
"max_pods_per_node": null,
"kubernetes_version": "1.36.3",
"platform_version": "lks-v1.36.3-002",
"status": "ready",
"message": "",
"reason": "",
"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"
}
}
],
"meta": {
"total": 1
}
}{
"errors": [
{
"code": "USER_AUTHORIZATION_ERROR",
"title": "User Authorization Error",
"detail": "You are not authorized to perform this action.",
"status": "403",
"meta": {}
}
]
}{
"errors": [
{
"code": "NOT_FOUND",
"title": "Cluster Not Found",
"detail": "Cluster 'lksc_pRMLydp0dQKr1' not found",
"status": "404",
"meta": {}
}
]
}{
"errors": [
{
"code": "UPSTREAM_SERVICE_ERROR",
"title": "Bad Gateway",
"detail": "NetBox is temporarily unavailable. Please try again.",
"status": "502",
"meta": {}
}
]
}LKS
List node pools
Lists every node pool of an LKS cluster. The response is not paginated; meta.total is the number of node pools returned.
GET
/
lks
/
clusters
/
{cluster_id}
/
nodepools
Go (SDK)
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Lks.ListLksNodePools(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.LksNodePools != nil {
// handle response
}
}curl --request GET \
--url https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/lks/clusters/{cluster_id}/nodepools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
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": 2,
"max_pods_per_node": null,
"kubernetes_version": "1.36.3",
"platform_version": "lks-v1.36.3-002",
"status": "ready",
"message": "",
"reason": "",
"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"
}
}
],
"meta": {
"total": 1
}
}{
"errors": [
{
"code": "USER_AUTHORIZATION_ERROR",
"title": "User Authorization Error",
"detail": "You are not authorized to perform this action.",
"status": "403",
"meta": {}
}
]
}{
"errors": [
{
"code": "NOT_FOUND",
"title": "Cluster Not Found",
"detail": "Cluster 'lksc_pRMLydp0dQKr1' not found",
"status": "404",
"meta": {}
}
]
}{
"errors": [
{
"code": "UPSTREAM_SERVICE_ERROR",
"title": "Bad Gateway",
"detail": "NetBox is temporarily unavailable. Please try again.",
"status": "502",
"meta": {}
}
]
}Was this page helpful?