Create Disk
curl --request POST \
--url https://api.tenbytecloud.com/v1/storage/disks \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: <api-key>' \
--data 'size_gb=<string>' \
--data billing_account_id=123 \
--data 'display_name=<string>' \
--data 'source_image_type=<string>' \
--data 'source_image=<string>'import requests
url = "https://api.tenbytecloud.com/v1/storage/disks"
payload = {
"size_gb": "<string>",
"billing_account_id": "123",
"display_name": "<string>",
"source_image_type": "<string>",
"source_image": "<string>"
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
size_gb: '<string>',
billing_account_id: '123',
display_name: '<string>',
source_image_type: '<string>',
source_image: '<string>'
})
};
fetch('https://api.tenbytecloud.com/v1/storage/disks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenbytecloud.com/v1/storage/disks"
payload := strings.NewReader("size_gb=%3Cstring%3E&billing_account_id=123&display_name=%3Cstring%3E&source_image_type=%3Cstring%3E&source_image=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbytecloud.com/v1/storage/disks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "size_gb=%3Cstring%3E&billing_account_id=123&display_name=%3Cstring%3E&source_image_type=%3Cstring%3E&source_image=%3Cstring%3E"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.tenbytecloud.com/v1/storage/disks")
.header("apikey", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("size_gb=%3Cstring%3E&billing_account_id=123&display_name=%3Cstring%3E&source_image_type=%3Cstring%3E&source_image=%3Cstring%3E")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbytecloud.com/v1/storage/disks");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddParameter("size_gb", "<string>");
request.AddParameter("billing_account_id", "123");
request.AddParameter("display_name", "<string>");
request.AddParameter("source_image_type", "<string>");
request.AddParameter("source_image", "<string>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbytecloud.com/v1/storage/disks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "size_gb=%3Cstring%3E&billing_account_id=123&display_name=%3Cstring%3E&source_image_type=%3Cstring%3E&source_image=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"uuid": "05a61876-86f3-4b05-b0ec-53ee6fa03ced",
"status": "Active",
"size_gb": 50,
"source_image_type": "EMPTY",
"created_at": "2022-09-01T12:03:14.355+0000"
}Block Storage
Create Disk
Creates a new block storage disk. Can be empty, a copy of an OS base image, an existing disk, or a snapshot. Location-specific endpoint.
POST
/
storage
/
disks
Create Disk
curl --request POST \
--url https://api.tenbytecloud.com/v1/storage/disks \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: <api-key>' \
--data 'size_gb=<string>' \
--data billing_account_id=123 \
--data 'display_name=<string>' \
--data 'source_image_type=<string>' \
--data 'source_image=<string>'import requests
url = "https://api.tenbytecloud.com/v1/storage/disks"
payload = {
"size_gb": "<string>",
"billing_account_id": "123",
"display_name": "<string>",
"source_image_type": "<string>",
"source_image": "<string>"
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
size_gb: '<string>',
billing_account_id: '123',
display_name: '<string>',
source_image_type: '<string>',
source_image: '<string>'
})
};
fetch('https://api.tenbytecloud.com/v1/storage/disks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenbytecloud.com/v1/storage/disks"
payload := strings.NewReader("size_gb=%3Cstring%3E&billing_account_id=123&display_name=%3Cstring%3E&source_image_type=%3Cstring%3E&source_image=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbytecloud.com/v1/storage/disks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "size_gb=%3Cstring%3E&billing_account_id=123&display_name=%3Cstring%3E&source_image_type=%3Cstring%3E&source_image=%3Cstring%3E"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.tenbytecloud.com/v1/storage/disks")
.header("apikey", "<api-key>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("size_gb=%3Cstring%3E&billing_account_id=123&display_name=%3Cstring%3E&source_image_type=%3Cstring%3E&source_image=%3Cstring%3E")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbytecloud.com/v1/storage/disks");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddParameter("size_gb", "<string>");
request.AddParameter("billing_account_id", "123");
request.AddParameter("display_name", "<string>");
request.AddParameter("source_image_type", "<string>");
request.AddParameter("source_image", "<string>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbytecloud.com/v1/storage/disks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "size_gb=%3Cstring%3E&billing_account_id=123&display_name=%3Cstring%3E&source_image_type=%3Cstring%3E&source_image=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"uuid": "05a61876-86f3-4b05-b0ec-53ee6fa03ced",
"status": "Active",
"size_gb": 50,
"source_image_type": "EMPTY",
"created_at": "2022-09-01T12:03:14.355+0000"
}Authorizations
Body
application/x-www-form-urlencoded
Response
200 - application/json
Created disk
The response is of type object.
⌘I