Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
latitudesh.servers.reinstall(server_id="sv_aNmodj6ydbE8W", data={
"type": latitudesh_python_sdk.CreateServerReinstallServersType.REINSTALLS,
"attributes": {
"operating_system": latitudesh_python_sdk.CreateServerReinstallServersOperatingSystem.IPXE,
"hostname": "BRC1",
"ipxe": "https://some-host.com/image.ipxe",
},
})
# Use the SDK ...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.Reinstall(ctx, "sv_aNmodj6ydbE8W", operations.CreateServerReinstallServersRequestBody{
Data: operations.CreateServerReinstallServersData{
Type: operations.CreateServerReinstallServersTypeReinstalls,
Attributes: &operations.CreateServerReinstallServersAttributes{
OperatingSystem: operations.CreateServerReinstallServersOperatingSystemIpxe.ToPointer(),
Hostname: latitudeshgosdk.Pointer("BRC1"),
Ipxe: latitudeshgosdk.Pointer("https://some-host.com/image.ipxe"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
await latitudesh.servers.reinstall({
serverId: "sv_aNmodj6ydbE8W",
requestBody: {
data: {
type: "reinstalls",
attributes: {
operatingSystem: "ipxe",
hostname: "BRC1",
ipxe: "https://some-host.com/image.ipxe",
},
},
},
});
}
run();curl --request POST \
--url https://api.latitude.sh/servers/{server_id}/reinstall \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "reinstalls",
"attributes": {
"operating_system": "ipxe",
"ipxe": "https://some-host.com/image.ipxe",
"hostname": "BRC1"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'reinstalls',
attributes: {
operating_system: 'ipxe',
ipxe: 'https://some-host.com/image.ipxe',
hostname: 'BRC1'
}
}
})
};
fetch('https://api.latitude.sh/servers/{server_id}/reinstall', 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}/reinstall",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'reinstalls',
'attributes' => [
'operating_system' => 'ipxe',
'ipxe' => 'https://some-host.com/image.ipxe',
'hostname' => 'BRC1'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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}/reinstall")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"reinstalls\",\n \"attributes\": {\n \"operating_system\": \"ipxe\",\n \"ipxe\": \"https://some-host.com/image.ipxe\",\n \"hostname\": \"BRC1\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/reinstall")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"reinstalls\",\n \"attributes\": {\n \"operating_system\": \"ipxe\",\n \"ipxe\": \"https://some-host.com/image.ipxe\",\n \"hostname\": \"BRC1\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{}Servers
Run Server Reinstall
POST
/
servers
/
{server_id}
/
reinstall
Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
latitudesh.servers.reinstall(server_id="sv_aNmodj6ydbE8W", data={
"type": latitudesh_python_sdk.CreateServerReinstallServersType.REINSTALLS,
"attributes": {
"operating_system": latitudesh_python_sdk.CreateServerReinstallServersOperatingSystem.IPXE,
"hostname": "BRC1",
"ipxe": "https://some-host.com/image.ipxe",
},
})
# Use the SDK ...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.Reinstall(ctx, "sv_aNmodj6ydbE8W", operations.CreateServerReinstallServersRequestBody{
Data: operations.CreateServerReinstallServersData{
Type: operations.CreateServerReinstallServersTypeReinstalls,
Attributes: &operations.CreateServerReinstallServersAttributes{
OperatingSystem: operations.CreateServerReinstallServersOperatingSystemIpxe.ToPointer(),
Hostname: latitudeshgosdk.Pointer("BRC1"),
Ipxe: latitudeshgosdk.Pointer("https://some-host.com/image.ipxe"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
await latitudesh.servers.reinstall({
serverId: "sv_aNmodj6ydbE8W",
requestBody: {
data: {
type: "reinstalls",
attributes: {
operatingSystem: "ipxe",
hostname: "BRC1",
ipxe: "https://some-host.com/image.ipxe",
},
},
},
});
}
run();curl --request POST \
--url https://api.latitude.sh/servers/{server_id}/reinstall \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "reinstalls",
"attributes": {
"operating_system": "ipxe",
"ipxe": "https://some-host.com/image.ipxe",
"hostname": "BRC1"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'reinstalls',
attributes: {
operating_system: 'ipxe',
ipxe: 'https://some-host.com/image.ipxe',
hostname: 'BRC1'
}
}
})
};
fetch('https://api.latitude.sh/servers/{server_id}/reinstall', 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}/reinstall",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'reinstalls',
'attributes' => [
'operating_system' => 'ipxe',
'ipxe' => 'https://some-host.com/image.ipxe',
'hostname' => 'BRC1'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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}/reinstall")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"reinstalls\",\n \"attributes\": {\n \"operating_system\": \"ipxe\",\n \"ipxe\": \"https://some-host.com/image.ipxe\",\n \"hostname\": \"BRC1\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/reinstall")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"reinstalls\",\n \"attributes\": {\n \"operating_system\": \"ipxe\",\n \"ipxe\": \"https://some-host.com/image.ipxe\",\n \"hostname\": \"BRC1\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{}Was this page helpful?
⌘I