Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.create_ipmi_session(server_id="sv_Qkm7dXaRq8nZV")
# 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.CreateIpmiSession(ctx, "sv_Qkm7dXaRq8nZV")
if err != nil {
log.Fatal(err)
}
if res.IpmiSession != 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.createIpmiSession({
serverId: "sv_Qkm7dXaRq8nZV",
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/servers/{server_id}/remote_access \
--header 'Authorization: <api-key>'const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/servers/{server_id}/remote_access', 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}/remote_access",
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}/remote_access")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/remote_access")
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": "ipmi_mw49QDB5qagKb",
"type": "ipmi_sessions",
"attributes": {
"ipmi_address": "10.0.10.1",
"ipmi_url": null,
"ipmi_username": "customer_access",
"ipmi_password": "ipmi_password"
}
}
}Servers
Create IPMI credentials
Generates IPMI credentials for a given server. Remote access creates a VPN connection to the internal network of your server so you can connect to its IPMI.
You will have to use a VPN client such as https://openvpn.net to connect. See VPN Sessions API to create a VPN connection.
Related guide: https://docs.latitude.sh/docs/ipmi
POST
/
servers
/
{server_id}
/
remote_access
Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.servers.create_ipmi_session(server_id="sv_Qkm7dXaRq8nZV")
# 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.CreateIpmiSession(ctx, "sv_Qkm7dXaRq8nZV")
if err != nil {
log.Fatal(err)
}
if res.IpmiSession != 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.createIpmiSession({
serverId: "sv_Qkm7dXaRq8nZV",
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/servers/{server_id}/remote_access \
--header 'Authorization: <api-key>'const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/servers/{server_id}/remote_access', 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}/remote_access",
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}/remote_access")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/servers/{server_id}/remote_access")
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": "ipmi_mw49QDB5qagKb",
"type": "ipmi_sessions",
"attributes": {
"ipmi_address": "10.0.10.1",
"ipmi_url": null,
"ipmi_username": "customer_access",
"ipmi_password": "ipmi_password"
}
}
}Was this page helpful?
⌘I