Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.projects.get_project(project_id="<id>")
# 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.Projects.GetProject(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.Object != 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.projects.getProject({
projectId: "<id>",
});
console.log(result);
}
run();curl --request GET \
--url https://api.latitude.sh/projects/{project_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/projects/{project_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/projects/{project_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/projects/{project_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/projects/{project_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": "<string>",
"type": "projects",
"attributes": {
"tags": [
{}
],
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"billing_type": "Yearly",
"billing_method": "Normal",
"cost": "<string>",
"bandwidth_alert": true,
"environment": "Development",
"provisioning_type": "<string>",
"stats": {
"databases": 123,
"ip_addresses": 123,
"prefixes": 123,
"servers": 123,
"storages": 123,
"virtual_machines": 123,
"vlans": 123
},
"billing": {
"subscription_id": "<string>",
"type": "<string>",
"method": "<string>"
},
"team": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"address": "<string>",
"currency": {
"id": "<string>",
"code": "<string>",
"name": "<string>",
"currency_id": 123
},
"status": "<string>",
"feature_flags": [
"<string>"
],
"limits": {
"bare_metal": 123,
"bare_metal_gpu": 123,
"virtual_machine": 123,
"virtual_machine_gpu": 123,
"elastic_ip": 123,
"bgp_session_per_ip": 123,
"public_network": 123,
"virtual_network": 123,
"database": 123,
"filesystem": 123,
"block_storage": 123
}
},
"created_at": "<string>",
"updated_at": "<string>"
}
},
"meta": {}
}Projects
Retrieve project
Returns a single project belonging to the current team
GET
/
projects
/
{project_id}
Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.projects.get_project(project_id="<id>")
# 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.Projects.GetProject(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.Object != 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.projects.getProject({
projectId: "<id>",
});
console.log(result);
}
run();curl --request GET \
--url https://api.latitude.sh/projects/{project_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/projects/{project_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/projects/{project_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/projects/{project_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/projects/{project_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": "<string>",
"type": "projects",
"attributes": {
"tags": [
{}
],
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"billing_type": "Yearly",
"billing_method": "Normal",
"cost": "<string>",
"bandwidth_alert": true,
"environment": "Development",
"provisioning_type": "<string>",
"stats": {
"databases": 123,
"ip_addresses": 123,
"prefixes": 123,
"servers": 123,
"storages": 123,
"virtual_machines": 123,
"vlans": 123
},
"billing": {
"subscription_id": "<string>",
"type": "<string>",
"method": "<string>"
},
"team": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"address": "<string>",
"currency": {
"id": "<string>",
"code": "<string>",
"name": "<string>",
"currency_id": 123
},
"status": "<string>",
"feature_flags": [
"<string>"
],
"limits": {
"bare_metal": 123,
"bare_metal_gpu": 123,
"virtual_machine": 123,
"virtual_machine_gpu": 123,
"elastic_ip": 123,
"bgp_session_per_ip": 123,
"public_network": 123,
"virtual_network": 123,
"database": 123,
"filesystem": 123,
"block_storage": 123
}
},
"created_at": "<string>",
"updated_at": "<string>"
}
},
"meta": {}
}Was this page helpful?
⌘I