Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.unlock(server_id="sv_e8pKq0xYqWAob")
# 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.Unlock(ctx, "sv_e8pKq0xYqWAob")
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.unlock({
serverId: "sv_e8pKq0xYqWAob",
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/servers/{server_id}/unlock \
--header 'Authorization: <api-key>'const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/servers/{server_id}/unlock', 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}/unlock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.post("https://api.latitude.sh/servers/{server_id}/unlock")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/unlock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "sv_e8pKq0xYqWAob",
"type": "servers",
"attributes": {
"hostname": "Fantastic Copper Shirt",
"label": "275299NODEZB",
"price": 599,
"ipmi_status": "Normal",
"scheduled_deletion_at": null,
"status": "unknown",
"role": "Storage",
"primary_ipv4": "95.231.106.4",
"created_at": null,
"locked": false,
"team": {
"id": "team_L8E8kyLxxotB4WNL0Pnrhbla8NW",
"name": "472 Team",
"slug": "472-team",
"description": "472 Team",
"address": "992 Noe Neck, Lake Germanberg, FL 06343",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
},
"project": {
"id": "proj_aNmodjQZObE8W",
"name": "Enormous Marble Clock",
"slug": "enormous-marble-clock",
"description": "Synergistic Granite Gloves",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": "sub_qmelg7r2lao5z3",
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 1,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
},
"region": {
"city": "Sydney 134",
"country": "Australia 149",
"site": {
"id": "loc_kjQwdEmXdYNVP",
"name": "Sydney 134",
"slug": "SYD115",
"facility": "Sydney 134"
}
}
}
}
}Servers
Unlock server
Unlocks the server. A locked server cannot be deleted or modified and no actions can be performed on it.
POST
/
servers
/
{server_id}
/
unlock
Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.unlock(server_id="sv_e8pKq0xYqWAob")
# 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.Unlock(ctx, "sv_e8pKq0xYqWAob")
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.unlock({
serverId: "sv_e8pKq0xYqWAob",
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/servers/{server_id}/unlock \
--header 'Authorization: <api-key>'const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/servers/{server_id}/unlock', 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}/unlock",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.post("https://api.latitude.sh/servers/{server_id}/unlock")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/unlock")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "sv_e8pKq0xYqWAob",
"type": "servers",
"attributes": {
"hostname": "Fantastic Copper Shirt",
"label": "275299NODEZB",
"price": 599,
"ipmi_status": "Normal",
"scheduled_deletion_at": null,
"status": "unknown",
"role": "Storage",
"primary_ipv4": "95.231.106.4",
"created_at": null,
"locked": false,
"team": {
"id": "team_L8E8kyLxxotB4WNL0Pnrhbla8NW",
"name": "472 Team",
"slug": "472-team",
"description": "472 Team",
"address": "992 Noe Neck, Lake Germanberg, FL 06343",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
},
"project": {
"id": "proj_aNmodjQZObE8W",
"name": "Enormous Marble Clock",
"slug": "enormous-marble-clock",
"description": "Synergistic Granite Gloves",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": "sub_qmelg7r2lao5z3",
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 1,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
},
"region": {
"city": "Sydney 134",
"country": "Australia 149",
"site": {
"id": "loc_kjQwdEmXdYNVP",
"name": "Sydney 134",
"slug": "SYD115",
"facility": "Sydney 134"
}
}
}
}
}Was this page helpful?
⌘I