Go (SDK)
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.BlockStorage.UnmapVolume(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.blockStorage.postStorageVolumesUnmap({
id: "<id>",
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/storage/volumes/{id}/unmap \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/storage/volumes/{id}/unmap"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/storage/volumes/{id}/unmap', 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/storage/volumes/{id}/unmap",
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/storage/volumes/{id}/unmap")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/storage/volumes/{id}/unmap")
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": "<string>",
"type": "volumes",
"attributes": {
"name": "<string>",
"size_in_gb": 123,
"created_at": "2023-11-07T05:31:56Z",
"namespace_id": 123,
"connector_id": "<string>",
"initiators": [
{
"nqn": "<string>"
}
],
"block": {
"status": "<string>",
"nqn": "<string>",
"nsid": 123,
"server_id": "<string>",
"storage_network": {
"vid": 123,
"host_cidr": "<string>",
"gateway": "<string>",
"routes": [
"<string>"
],
"block_gateway": "<string>",
"block_port": 123
}
},
"keyring": "<string>",
"cluster_user": "<string>",
"volume_path": "<string>",
"region": {
"city": "<string>",
"country": "<string>",
"site": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"facility": "<string>"
}
},
"project": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"billing_type": "<string>",
"provisioning_type": "<string>",
"billing_method": "<string>",
"bandwidth_alert": true,
"environment": "<string>",
"billing": {
"subscription_id": "<string>",
"type": "<string>",
"method": "<string>"
},
"stats": {
"databases": 123,
"ip_addresses": 123,
"prefixes": 123,
"servers": 123,
"storages": 123,
"virtual_machines": 123,
"vlans": 123
}
},
"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
}
}
}
},
"meta": {}
}Block Storage
Unmap volume
Unmaps a high performance volume from the server it is currently mapped to.
POST
/
storage
/
volumes
/
{id}
/
unmap
Go (SDK)
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.BlockStorage.UnmapVolume(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.blockStorage.postStorageVolumesUnmap({
id: "<id>",
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/storage/volumes/{id}/unmap \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/storage/volumes/{id}/unmap"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/storage/volumes/{id}/unmap', 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/storage/volumes/{id}/unmap",
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/storage/volumes/{id}/unmap")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/storage/volumes/{id}/unmap")
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": "<string>",
"type": "volumes",
"attributes": {
"name": "<string>",
"size_in_gb": 123,
"created_at": "2023-11-07T05:31:56Z",
"namespace_id": 123,
"connector_id": "<string>",
"initiators": [
{
"nqn": "<string>"
}
],
"block": {
"status": "<string>",
"nqn": "<string>",
"nsid": 123,
"server_id": "<string>",
"storage_network": {
"vid": 123,
"host_cidr": "<string>",
"gateway": "<string>",
"routes": [
"<string>"
],
"block_gateway": "<string>",
"block_port": 123
}
},
"keyring": "<string>",
"cluster_user": "<string>",
"volume_path": "<string>",
"region": {
"city": "<string>",
"country": "<string>",
"site": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"facility": "<string>"
}
},
"project": {
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"billing_type": "<string>",
"provisioning_type": "<string>",
"billing_method": "<string>",
"bandwidth_alert": true,
"environment": "<string>",
"billing": {
"subscription_id": "<string>",
"type": "<string>",
"method": "<string>"
},
"stats": {
"databases": 123,
"ip_addresses": 123,
"prefixes": 123,
"servers": 123,
"storages": 123,
"virtual_machines": 123,
"vlans": 123
}
},
"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
}
}
}
},
"meta": {}
}Was this page helpful?