Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.prefixes.getPrefixes();
console.log(result);
}
run();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.Prefixes.GetPrefixes(ctx, nil, nil)
if err != nil {
log.Fatal(err)
}
if res.Prefixes != nil {
// handle response
}
}curl --request GET \
--url https://api.latitude.sh/prefixes \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/prefixes"
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/prefixes', 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/prefixes",
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/prefixes")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/prefixes")
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": "<string>",
"type": "prefixes",
"attributes": {
"ipv4": "<string>",
"ipv6": "<string>",
"size": 26,
"activated": true,
"capacity": 123,
"ips_used": 123,
"ips_free": 123,
"created_at": "2023-11-07T05:31:56Z",
"project": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
},
"region": {
"id": "<string>",
"name": "<string>",
"location": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
}
}
}
}
],
"meta": {}
}{
"errors": [
{
"code": "<string>",
"status": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Prefixes
List networks
List the customer networks owned by the team
GET
/
prefixes
Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.prefixes.getPrefixes();
console.log(result);
}
run();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.Prefixes.GetPrefixes(ctx, nil, nil)
if err != nil {
log.Fatal(err)
}
if res.Prefixes != nil {
// handle response
}
}curl --request GET \
--url https://api.latitude.sh/prefixes \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/prefixes"
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/prefixes', 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/prefixes",
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/prefixes")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/prefixes")
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": "<string>",
"type": "prefixes",
"attributes": {
"ipv4": "<string>",
"ipv6": "<string>",
"size": 26,
"activated": true,
"capacity": 123,
"ips_used": 123,
"ips_free": 123,
"created_at": "2023-11-07T05:31:56Z",
"project": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
},
"region": {
"id": "<string>",
"name": "<string>",
"location": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
}
}
}
}
],
"meta": {}
}{
"errors": [
{
"code": "<string>",
"status": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Was this page helpful?
⌘I