Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.update_deploy_config(server_id="sv_lkg1DeYLDvZE5", type_=latitudesh_python_sdk.UpdateServerDeployConfigServersType.DEPLOY_CONFIG)
# Handle response
print(res)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.UpdateDeployConfig(ctx, "sv_lkg1DeYLDvZE5", operations.UpdateServerDeployConfigServersRequestBody{
Type: operations.UpdateServerDeployConfigServersTypeDeployConfig,
})
if err != nil {
log.Fatal(err)
}
if res.DeployConfig != 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.updateDeployConfig({
serverId: "sv_lkg1DeYLDvZE5",
requestBody: {
type: "deploy_config",
},
});
console.log(result);
}
run();curl --request PATCH \
--url https://api.latitude.sh/servers/{server_id}/deploy_config \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "deploy_config",
"attributes": {
"ssh_keys": [
"ssh_m5xyZOnNOWM0l"
],
"user_data": "ud_5LA73qkjdaJ2o",
"raid": "raid-1",
"operating_system": "ubuntu_20_04_x64_lts",
"partitions": [
{
"path": "/",
"size_in_gb": 300,
"filesystem_type": "ext4"
}
],
"hostname": "my-hostname"
}
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'deploy_config',
attributes: {
ssh_keys: ['ssh_m5xyZOnNOWM0l'],
user_data: 'ud_5LA73qkjdaJ2o',
raid: 'raid-1',
operating_system: 'ubuntu_20_04_x64_lts',
partitions: [{path: '/', size_in_gb: 300, filesystem_type: 'ext4'}],
hostname: 'my-hostname'
}
}
})
};
fetch('https://api.latitude.sh/servers/{server_id}/deploy_config', 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}/deploy_config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'deploy_config',
'attributes' => [
'ssh_keys' => [
'ssh_m5xyZOnNOWM0l'
],
'user_data' => 'ud_5LA73qkjdaJ2o',
'raid' => 'raid-1',
'operating_system' => 'ubuntu_20_04_x64_lts',
'partitions' => [
[
'path' => '/',
'size_in_gb' => 300,
'filesystem_type' => 'ext4'
]
],
'hostname' => 'my-hostname'
]
]
]),
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.patch("https://api.latitude.sh/servers/{server_id}/deploy_config")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"deploy_config\",\n \"attributes\": {\n \"ssh_keys\": [\n \"ssh_m5xyZOnNOWM0l\"\n ],\n \"user_data\": \"ud_5LA73qkjdaJ2o\",\n \"raid\": \"raid-1\",\n \"operating_system\": \"ubuntu_20_04_x64_lts\",\n \"partitions\": [\n {\n \"path\": \"/\",\n \"size_in_gb\": 300,\n \"filesystem_type\": \"ext4\"\n }\n ],\n \"hostname\": \"my-hostname\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/deploy_config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"deploy_config\",\n \"attributes\": {\n \"ssh_keys\": [\n \"ssh_m5xyZOnNOWM0l\"\n ],\n \"user_data\": \"ud_5LA73qkjdaJ2o\",\n \"raid\": \"raid-1\",\n \"operating_system\": \"ubuntu_20_04_x64_lts\",\n \"partitions\": [\n {\n \"path\": \"/\",\n \"size_in_gb\": 300,\n \"filesystem_type\": \"ext4\"\n }\n ],\n \"hostname\": \"my-hostname\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "sv_lkg1DeYLDvZE5",
"type": "deploy_config",
"attributes": {
"ssh_keys": [
"ssh_m5xyZOnNOWM0l"
],
"user_data": "ud_5LA73qkjdaJ2o",
"raid": "raid-1",
"operating_system": "ubuntu_20_04_x64_lts",
"hostname": "my-hostname",
"ipxe_url": null,
"ipxe": null,
"partitions": [
{
"path": "/",
"size_in_gb": 300,
"filesystem_type": "ext4"
}
]
}
},
"meta": {}
}Servers
Update deploy config
PATCH
/
servers
/
{server_id}
/
deploy_config
Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.update_deploy_config(server_id="sv_lkg1DeYLDvZE5", type_=latitudesh_python_sdk.UpdateServerDeployConfigServersType.DEPLOY_CONFIG)
# Handle response
print(res)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.UpdateDeployConfig(ctx, "sv_lkg1DeYLDvZE5", operations.UpdateServerDeployConfigServersRequestBody{
Type: operations.UpdateServerDeployConfigServersTypeDeployConfig,
})
if err != nil {
log.Fatal(err)
}
if res.DeployConfig != 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.updateDeployConfig({
serverId: "sv_lkg1DeYLDvZE5",
requestBody: {
type: "deploy_config",
},
});
console.log(result);
}
run();curl --request PATCH \
--url https://api.latitude.sh/servers/{server_id}/deploy_config \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "deploy_config",
"attributes": {
"ssh_keys": [
"ssh_m5xyZOnNOWM0l"
],
"user_data": "ud_5LA73qkjdaJ2o",
"raid": "raid-1",
"operating_system": "ubuntu_20_04_x64_lts",
"partitions": [
{
"path": "/",
"size_in_gb": 300,
"filesystem_type": "ext4"
}
],
"hostname": "my-hostname"
}
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'deploy_config',
attributes: {
ssh_keys: ['ssh_m5xyZOnNOWM0l'],
user_data: 'ud_5LA73qkjdaJ2o',
raid: 'raid-1',
operating_system: 'ubuntu_20_04_x64_lts',
partitions: [{path: '/', size_in_gb: 300, filesystem_type: 'ext4'}],
hostname: 'my-hostname'
}
}
})
};
fetch('https://api.latitude.sh/servers/{server_id}/deploy_config', 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}/deploy_config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'deploy_config',
'attributes' => [
'ssh_keys' => [
'ssh_m5xyZOnNOWM0l'
],
'user_data' => 'ud_5LA73qkjdaJ2o',
'raid' => 'raid-1',
'operating_system' => 'ubuntu_20_04_x64_lts',
'partitions' => [
[
'path' => '/',
'size_in_gb' => 300,
'filesystem_type' => 'ext4'
]
],
'hostname' => 'my-hostname'
]
]
]),
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.patch("https://api.latitude.sh/servers/{server_id}/deploy_config")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"deploy_config\",\n \"attributes\": {\n \"ssh_keys\": [\n \"ssh_m5xyZOnNOWM0l\"\n ],\n \"user_data\": \"ud_5LA73qkjdaJ2o\",\n \"raid\": \"raid-1\",\n \"operating_system\": \"ubuntu_20_04_x64_lts\",\n \"partitions\": [\n {\n \"path\": \"/\",\n \"size_in_gb\": 300,\n \"filesystem_type\": \"ext4\"\n }\n ],\n \"hostname\": \"my-hostname\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/deploy_config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"deploy_config\",\n \"attributes\": {\n \"ssh_keys\": [\n \"ssh_m5xyZOnNOWM0l\"\n ],\n \"user_data\": \"ud_5LA73qkjdaJ2o\",\n \"raid\": \"raid-1\",\n \"operating_system\": \"ubuntu_20_04_x64_lts\",\n \"partitions\": [\n {\n \"path\": \"/\",\n \"size_in_gb\": 300,\n \"filesystem_type\": \"ext4\"\n }\n ],\n \"hostname\": \"my-hostname\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "sv_lkg1DeYLDvZE5",
"type": "deploy_config",
"attributes": {
"ssh_keys": [
"ssh_m5xyZOnNOWM0l"
],
"user_data": "ud_5LA73qkjdaJ2o",
"raid": "raid-1",
"operating_system": "ubuntu_20_04_x64_lts",
"hostname": "my-hostname",
"ipxe_url": null,
"ipxe": null,
"partitions": [
{
"path": "/",
"size_in_gb": 300,
"filesystem_type": "ext4"
}
]
}
},
"meta": {}
}Authorizations
Path Parameters
The Server ID
Body
application/jsonapplication/vnd.api+json
Response
200 - application/vnd.api+json
Success
Show child attributes
Show child attributes
Was this page helpful?
⌘I