from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.list(filter_project="proj_g1mbDwrZqLv5B", filter_region="SAO", filter_ram_eql=32, filter_ram_gte=40, filter_ram_lte=40, filter_tags="tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e", page_size=20, page_number=1)
while res is not None:
# Handle items
res = res.next()package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Servers.List(ctx, operations.GetServersRequest{
FilterProject: latitudeshgosdk.Pointer("proj_g1mbDwrZqLv5B"),
FilterRegion: latitudeshgosdk.Pointer("SAO"),
FilterRAMEql: latitudeshgosdk.Pointer[int64](32),
FilterRAMGte: latitudeshgosdk.Pointer[int64](40),
FilterRAMLte: latitudeshgosdk.Pointer[int64](40),
FilterTags: latitudeshgosdk.Pointer("tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e"),
})
if err != nil {
log.Fatal(err)
}
if res.Servers != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.servers.list({
filterTags: "tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://api.latitude.sh/servers \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/servers', 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/servers",
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/servers")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers")
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": "sv_WeGoqAanqP7nz",
"type": "servers",
"attributes": {
"tags": [
{
"id": "tag_pjAkRjVzw0tlYBA2WX1eHzW7w79",
"name": "tag1",
"description": "Autem tempora est aperiam.",
"color": "#160303"
},
{
"id": "tag_yARk1KLJAvslWY7k5wNBCaKEV7e",
"name": "tag2",
"description": "Vitae cupiditate doloribus optio.",
"color": "#ee6dee"
}
],
"hostname": "Hostname",
"label": "832845NODEKG",
"price": 599,
"role": "Bare Metal",
"primary_ipv4": "19.98.98.65",
"primary_ipv6": "49e5:fef3:7891:16df:ccf6:93bb:a930:4dc0",
"status": "on",
"ipmi_status": "Normal",
"created_at": null,
"scheduled_deletion_at": null,
"locked": false,
"rescue_allowed": false,
"region": {
"city": "São Paulo 74",
"country": "Singapore 66",
"site": {
"id": "loc_695BdKjrOevVo",
"name": "São Paulo 74",
"slug": "SAO",
"facility": "São Paulo 74",
"rack_id": "rack_VLMmAD8EOwop2"
}
},
"team": {
"id": "team_Ygapr2KkrMur4QneZ00yUEGl4W2",
"name": "292 Team",
"slug": "292-team",
"description": "292 Team",
"address": "Apt. 180 27016 Chi Prairie, Kenyaport, CA 12866",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
},
"status": "verified",
"feature_flags": [],
"limits": {
"bare_metal": null,
"bare_metal_gpu": 1,
"virtual_machine": 5,
"virtual_machine_gpu": 3,
"elastic_ip": 5,
"virtual_network": 5,
"database": null,
"filesystem": null,
"block_storage": null
}
},
"project": {
"id": "proj_Z8rodmnGq1jLB",
"name": "Incredible Linen Car",
"slug": "incredible-linen-car",
"description": "Lightweight Iron Chair",
"provisioning_type": "on_demand",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {},
"stats": {
"databases": 1,
"ip_addresses": 8,
"prefixes": 0,
"servers": 3,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
},
"plan": {
"id": "plan_pbV0Dg1Rd4AWz",
"name": "g3.h100.small-51",
"slug": "plan-slug",
"billing": "hourly"
},
"interfaces": [
{
"role": "ipmi",
"name": "IPMI",
"mac_address": "00:11:22:33:44:55",
"description": "IPMI Interface"
},
{
"role": "internal",
"name": "PXE",
"mac_address": "66:77:88:99:aa:bb",
"description": "PXE Interface"
},
{
"role": "unknown",
"name": "PO1",
"mac_address": null,
"description": "LAG interface (no associated MAC record)"
}
],
"operating_system": {
"name": "Ubuntu (18.04 x64 LTS)",
"slug": "ubuntu_18_04_x64_lts",
"version": "18.04 x64 LTS",
"features": {
"raid": true,
"ssh_keys": true
},
"distro": {
"name": "Ubuntu",
"slug": "ubuntu",
"series": "bionic"
}
},
"specs": {
"cpu": "Xeon E-2186G CPU @ 3.80GHz (6 cores)",
"disk": "500 GB SSD",
"ram": "32 GB",
"nic": "",
"gpu": null
}
}
}
],
"meta": {}
}List servers
Returns a list of all servers belonging to the team.
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.list(filter_project="proj_g1mbDwrZqLv5B", filter_region="SAO", filter_ram_eql=32, filter_ram_gte=40, filter_ram_lte=40, filter_tags="tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e", page_size=20, page_number=1)
while res is not None:
# Handle items
res = res.next()package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Servers.List(ctx, operations.GetServersRequest{
FilterProject: latitudeshgosdk.Pointer("proj_g1mbDwrZqLv5B"),
FilterRegion: latitudeshgosdk.Pointer("SAO"),
FilterRAMEql: latitudeshgosdk.Pointer[int64](32),
FilterRAMGte: latitudeshgosdk.Pointer[int64](40),
FilterRAMLte: latitudeshgosdk.Pointer[int64](40),
FilterTags: latitudeshgosdk.Pointer("tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e"),
})
if err != nil {
log.Fatal(err)
}
if res.Servers != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.servers.list({
filterTags: "tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://api.latitude.sh/servers \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/servers', 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/servers",
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/servers")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers")
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": "sv_WeGoqAanqP7nz",
"type": "servers",
"attributes": {
"tags": [
{
"id": "tag_pjAkRjVzw0tlYBA2WX1eHzW7w79",
"name": "tag1",
"description": "Autem tempora est aperiam.",
"color": "#160303"
},
{
"id": "tag_yARk1KLJAvslWY7k5wNBCaKEV7e",
"name": "tag2",
"description": "Vitae cupiditate doloribus optio.",
"color": "#ee6dee"
}
],
"hostname": "Hostname",
"label": "832845NODEKG",
"price": 599,
"role": "Bare Metal",
"primary_ipv4": "19.98.98.65",
"primary_ipv6": "49e5:fef3:7891:16df:ccf6:93bb:a930:4dc0",
"status": "on",
"ipmi_status": "Normal",
"created_at": null,
"scheduled_deletion_at": null,
"locked": false,
"rescue_allowed": false,
"region": {
"city": "São Paulo 74",
"country": "Singapore 66",
"site": {
"id": "loc_695BdKjrOevVo",
"name": "São Paulo 74",
"slug": "SAO",
"facility": "São Paulo 74",
"rack_id": "rack_VLMmAD8EOwop2"
}
},
"team": {
"id": "team_Ygapr2KkrMur4QneZ00yUEGl4W2",
"name": "292 Team",
"slug": "292-team",
"description": "292 Team",
"address": "Apt. 180 27016 Chi Prairie, Kenyaport, CA 12866",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
},
"status": "verified",
"feature_flags": [],
"limits": {
"bare_metal": null,
"bare_metal_gpu": 1,
"virtual_machine": 5,
"virtual_machine_gpu": 3,
"elastic_ip": 5,
"virtual_network": 5,
"database": null,
"filesystem": null,
"block_storage": null
}
},
"project": {
"id": "proj_Z8rodmnGq1jLB",
"name": "Incredible Linen Car",
"slug": "incredible-linen-car",
"description": "Lightweight Iron Chair",
"provisioning_type": "on_demand",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {},
"stats": {
"databases": 1,
"ip_addresses": 8,
"prefixes": 0,
"servers": 3,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
},
"plan": {
"id": "plan_pbV0Dg1Rd4AWz",
"name": "g3.h100.small-51",
"slug": "plan-slug",
"billing": "hourly"
},
"interfaces": [
{
"role": "ipmi",
"name": "IPMI",
"mac_address": "00:11:22:33:44:55",
"description": "IPMI Interface"
},
{
"role": "internal",
"name": "PXE",
"mac_address": "66:77:88:99:aa:bb",
"description": "PXE Interface"
},
{
"role": "unknown",
"name": "PO1",
"mac_address": null,
"description": "LAG interface (no associated MAC record)"
}
],
"operating_system": {
"name": "Ubuntu (18.04 x64 LTS)",
"slug": "ubuntu_18_04_x64_lts",
"version": "18.04 x64 LTS",
"features": {
"raid": true,
"ssh_keys": true
},
"distro": {
"name": "Ubuntu",
"slug": "ubuntu",
"series": "bionic"
}
},
"specs": {
"cpu": "Xeon E-2186G CPU @ 3.80GHz (6 cores)",
"disk": "500 GB SSD",
"ram": "32 GB",
"nic": "",
"gpu": null
}
}
}
],
"meta": {}
}Authorizations
Query Parameters
The project ID or Slug to filter by
The region Slug to filter by
The hostname of server to filter by
The created at greater than equal date to filter by
The created at less than equal date to filter by
The label of server to filter by
The status of server to filter by
The platform/plan name of the server to filter by
Filter by the existence of an associated GPU
Filter servers with RAM size (in GB) equals the provided value.
Filter servers with RAM size (in GB) greater than or equal the provided value.
Filter servers with RAM size (in GB) less than or equal the provided value.
Filter servers with disk size (in GB) equal to the provided value.
Filter servers with disk size (in GB) greater than or equal to the provided value.
Filter servers with disk size (in GB) less than or equal to the provided value.
The tags IDs to filter by, separated by comma, e.g. filter[tags]=tag_1,tag_2will return servers with tag_1 AND tag_2
The credentials are provided as extra attributes that are lazy loaded. To request it, just set extra_fields[servers]=credentials in the query string.
Number of items to return per page
x >= 1Page number to return (starts at 1)
x >= 1Request aggregate stats in the response meta. Use count to get the total number of records, returned as meta.stats.total.count.
Was this page helpful?