Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.get(server_id="sv_VE1Wd3aXDXnZJ")
# Handle response
print(res)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.Servers.Get(ctx, "sv_VE1Wd3aXDXnZJ", nil)
if err != nil {
log.Fatal(err)
}
if res.Server != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.servers.get({
serverId: "sv_VE1Wd3aXDXnZJ",
});
console.log(result);
}
run();curl --request GET \
--url https://api.latitude.sh/servers/{server_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/servers/{server_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/servers/{server_id}",
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/{server_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}")
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_VE1Wd3aXDXnZJ",
"type": "servers",
"attributes": {
"tags": [],
"hostname": "Hostname",
"label": "327106NODEQI",
"price": 599,
"role": "Bare Metal",
"primary_ipv4": "9.120.132.45",
"primary_ipv6": "889e:8540:973b:5c04:abce:2551:47ae:a67e",
"status": "on",
"ipmi_status": "Normal",
"created_at": null,
"scheduled_deletion_at": null,
"locked": false,
"rescue_allowed": false,
"region": {
"city": "São Paulo 81",
"country": "Mexico 73",
"site": {
"id": "loc_GMy1DbNgDN50m",
"name": "São Paulo 81",
"slug": "SAO",
"facility": "São Paulo 81",
"rack_id": "rack_6VE1Wd37dXnZJ"
}
},
"team": {
"id": "team_M2WyX3zpQMf5Wvaw6zkotLZx0Ne",
"name": "308 Team",
"slug": "308-team",
"description": "308 Team",
"address": "Suite 667 299 Enoch Lights, Lake Lilli, MT 24573-1532",
"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_LMmAD8E4Owop2",
"name": "Awesome Granite Chair",
"slug": "awesome-granite-chair",
"description": "Mediocre Paper Wallet",
"provisioning_type": "on_demand",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {},
"stats": {
"databases": 0,
"ip_addresses": 2,
"prefixes": 0,
"servers": 1,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
},
"plan": {
"id": "plan_yQrJdN9JO30gv",
"name": "c2.large.arm",
"slug": "c2-large-arm",
"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": "",
"disk": "",
"ram": "",
"nic": "",
"gpu": null
}
}
},
"meta": {}
}Servers
Retrieve server
Returns a server that belongs to the team.
GET
/
servers
/
{server_id}
Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.get(server_id="sv_VE1Wd3aXDXnZJ")
# Handle response
print(res)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.Servers.Get(ctx, "sv_VE1Wd3aXDXnZJ", nil)
if err != nil {
log.Fatal(err)
}
if res.Server != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.servers.get({
serverId: "sv_VE1Wd3aXDXnZJ",
});
console.log(result);
}
run();curl --request GET \
--url https://api.latitude.sh/servers/{server_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/servers/{server_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/servers/{server_id}",
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/{server_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}")
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_VE1Wd3aXDXnZJ",
"type": "servers",
"attributes": {
"tags": [],
"hostname": "Hostname",
"label": "327106NODEQI",
"price": 599,
"role": "Bare Metal",
"primary_ipv4": "9.120.132.45",
"primary_ipv6": "889e:8540:973b:5c04:abce:2551:47ae:a67e",
"status": "on",
"ipmi_status": "Normal",
"created_at": null,
"scheduled_deletion_at": null,
"locked": false,
"rescue_allowed": false,
"region": {
"city": "São Paulo 81",
"country": "Mexico 73",
"site": {
"id": "loc_GMy1DbNgDN50m",
"name": "São Paulo 81",
"slug": "SAO",
"facility": "São Paulo 81",
"rack_id": "rack_6VE1Wd37dXnZJ"
}
},
"team": {
"id": "team_M2WyX3zpQMf5Wvaw6zkotLZx0Ne",
"name": "308 Team",
"slug": "308-team",
"description": "308 Team",
"address": "Suite 667 299 Enoch Lights, Lake Lilli, MT 24573-1532",
"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_LMmAD8E4Owop2",
"name": "Awesome Granite Chair",
"slug": "awesome-granite-chair",
"description": "Mediocre Paper Wallet",
"provisioning_type": "on_demand",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {},
"stats": {
"databases": 0,
"ip_addresses": 2,
"prefixes": 0,
"servers": 1,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
},
"plan": {
"id": "plan_yQrJdN9JO30gv",
"name": "c2.large.arm",
"slug": "c2-large-arm",
"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": "",
"disk": "",
"ram": "",
"nic": "",
"gpu": null
}
}
},
"meta": {}
}Authorizations
Path Parameters
The Server ID
Query Parameters
The credentials are provided as extra attributes that is lazy loaded. To request it, just set extra_fields[servers]=credentials in the query string.
Was this page helpful?
⌘I