Create Disk
curl --request POST \
--url https://api.mkinf.io/v0.1/projects/{id}/disks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"block_size": 4096,
"location": "us-northcentral1-a",
"name": "my-disk",
"size": "10GiB",
"type": "persistent-ssd"
}
'import requests
url = "https://api.mkinf.io/v0.1/projects/{id}/disks"
payload = {
"block_size": 4096,
"location": "us-northcentral1-a",
"name": "my-disk",
"size": "10GiB",
"type": "persistent-ssd"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
block_size: 4096,
location: 'us-northcentral1-a',
name: 'my-disk',
size: '10GiB',
type: 'persistent-ssd'
})
};
fetch('https://api.mkinf.io/v0.1/projects/{id}/disks', 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.mkinf.io/v0.1/projects/{id}/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 => json_encode([
'block_size' => 4096,
'location' => 'us-northcentral1-a',
'name' => 'my-disk',
'size' => '10GiB',
'type' => 'persistent-ssd'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mkinf.io/v0.1/projects/{id}/disks"
payload := strings.NewReader("{\n \"block_size\": 4096,\n \"location\": \"us-northcentral1-a\",\n \"name\": \"my-disk\",\n \"size\": \"10GiB\",\n \"type\": \"persistent-ssd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mkinf.io/v0.1/projects/{id}/disks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"block_size\": 4096,\n \"location\": \"us-northcentral1-a\",\n \"name\": \"my-disk\",\n \"size\": \"10GiB\",\n \"type\": \"persistent-ssd\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mkinf.io/v0.1/projects/{id}/disks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"block_size\": 4096,\n \"location\": \"us-northcentral1-a\",\n \"name\": \"my-disk\",\n \"size\": \"10GiB\",\n \"type\": \"persistent-ssd\"\n}"
response = http.request(request)
puts response.read_body{
"operation": {
"completed_at": "2021-12-03T19:59:34Z",
"metadata": {},
"operation_id": "F6EF489C-086E-458D-B812-7962964A28C9",
"result": {},
"started_at": "2021-12-03T19:58:34Z",
"state": "IN_PROGRESS"
}
}Storage
Create Disk
Create a new disk. Size should be in gibibytes (GiB) or tebibytes (TiB) in the format [Size][GiB|TiB]. E.g. 10GiB. A successful response from this resource will contain the async operation.
POST
/
projects
/
{id}
/
disks
Create Disk
curl --request POST \
--url https://api.mkinf.io/v0.1/projects/{id}/disks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"block_size": 4096,
"location": "us-northcentral1-a",
"name": "my-disk",
"size": "10GiB",
"type": "persistent-ssd"
}
'import requests
url = "https://api.mkinf.io/v0.1/projects/{id}/disks"
payload = {
"block_size": 4096,
"location": "us-northcentral1-a",
"name": "my-disk",
"size": "10GiB",
"type": "persistent-ssd"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
block_size: 4096,
location: 'us-northcentral1-a',
name: 'my-disk',
size: '10GiB',
type: 'persistent-ssd'
})
};
fetch('https://api.mkinf.io/v0.1/projects/{id}/disks', 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.mkinf.io/v0.1/projects/{id}/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 => json_encode([
'block_size' => 4096,
'location' => 'us-northcentral1-a',
'name' => 'my-disk',
'size' => '10GiB',
'type' => 'persistent-ssd'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mkinf.io/v0.1/projects/{id}/disks"
payload := strings.NewReader("{\n \"block_size\": 4096,\n \"location\": \"us-northcentral1-a\",\n \"name\": \"my-disk\",\n \"size\": \"10GiB\",\n \"type\": \"persistent-ssd\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mkinf.io/v0.1/projects/{id}/disks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"block_size\": 4096,\n \"location\": \"us-northcentral1-a\",\n \"name\": \"my-disk\",\n \"size\": \"10GiB\",\n \"type\": \"persistent-ssd\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mkinf.io/v0.1/projects/{id}/disks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"block_size\": 4096,\n \"location\": \"us-northcentral1-a\",\n \"name\": \"my-disk\",\n \"size\": \"10GiB\",\n \"type\": \"persistent-ssd\"\n}"
response = http.request(request)
puts response.read_body{
"operation": {
"completed_at": "2021-12-03T19:59:34Z",
"metadata": {},
"operation_id": "F6EF489C-086E-458D-B812-7962964A28C9",
"result": {},
"started_at": "2021-12-03T19:58:34Z",
"state": "IN_PROGRESS"
}
}Create a new disk in a project.
Required Parameters
name: Disk namesize: Size in GiB or TiB (e.g., “10GiB”)location: Deployment location
Optional Parameters
block_size: Block size in bytes (512 or 4096)type: Disk type (“persistent-ssd” or “shared-volume”)
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Project id
Body
application/json
Disk name
Disk size in gibibytes (GiB) or tebibytes (TiB) in the format [Size][GiB|TiB]
Location
Block size in bytes 512 or 4096
Disk type
Available options:
persistent-ssd, shared-volume Response
200 - application/json
Show child attributes
Show child attributes
⌘I