Update Disk
curl --request PATCH \
--url https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size": "10GiB"
}
'import requests
url = "https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id}"
payload = { "size": "10GiB" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({size: '10GiB'})
};
fetch('https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id}', 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/{projectId}/disks/{id}",
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([
'size' => '10GiB'
]),
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/{projectId}/disks/{id}"
payload := strings.NewReader("{\n \"size\": \"10GiB\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"size\": \"10GiB\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"size\": \"10GiB\"\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
Update Disk
Change the size of a 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.
PATCH
/
projects
/
{projectId}
/
disks
/
{id}
Update Disk
curl --request PATCH \
--url https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size": "10GiB"
}
'import requests
url = "https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id}"
payload = { "size": "10GiB" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({size: '10GiB'})
};
fetch('https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id}', 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/{projectId}/disks/{id}",
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([
'size' => '10GiB'
]),
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/{projectId}/disks/{id}"
payload := strings.NewReader("{\n \"size\": \"10GiB\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"size\": \"10GiB\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mkinf.io/v0.1/projects/{projectId}/disks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"size\": \"10GiB\"\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"
}
}Update a disk’s size. Size should be specified in GiB or TiB format (e.g., “10GiB”).
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
New disk size in gibibytes (GiB) or tebibytes (TiB) in the format [Size][GiB|TiB]
Response
200 - application/json
Show child attributes
Show child attributes
⌘I