Create Disk
Creates a new disk with the specified configuration. A default disk
token user is automatically generated and returned in the response,
so the disk is immediately mountable. The one-time disk token appears
in authorizedUsers[].token and cannot be retrieved again. (This
disk token is scoped to the new disk and is separate from the API
key you used to make this request.)
To provide your own users instead, pass the deprecated authMethods
field or call AddDiskUser after creation.
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/disks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-data-disk",
"mounts": [
{
"type": "s3",
"bucketName": "my-bucket",
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"sessionToken": "<string>",
"bucketPrefix": "data/"
}
],
"authMethods": [
{
"type": "token",
"nickname": "<string>",
"principal": "<string>",
"tokenSuffix": "<string>"
}
]
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/disks"
payload = {
"name": "my-data-disk",
"mounts": [
{
"type": "s3",
"bucketName": "my-bucket",
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"sessionToken": "<string>",
"bucketPrefix": "data/"
}
],
"authMethods": [
{
"type": "token",
"nickname": "<string>",
"principal": "<string>",
"tokenSuffix": "<string>"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'my-data-disk',
mounts: [
{
type: 's3',
bucketName: 'my-bucket',
accessKeyId: '<string>',
secretAccessKey: '<string>',
sessionToken: '<string>',
bucketPrefix: 'data/'
}
],
authMethods: [
{
type: 'token',
nickname: '<string>',
principal: '<string>',
tokenSuffix: '<string>'
}
]
})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/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://control.green.us-east-1.aws.prod.archil.com/api/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([
'name' => 'my-data-disk',
'mounts' => [
[
'type' => 's3',
'bucketName' => 'my-bucket',
'accessKeyId' => '<string>',
'secretAccessKey' => '<string>',
'sessionToken' => '<string>',
'bucketPrefix' => 'data/'
]
],
'authMethods' => [
[
'type' => 'token',
'nickname' => '<string>',
'principal' => '<string>',
'tokenSuffix' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://control.green.us-east-1.aws.prod.archil.com/api/disks"
payload := strings.NewReader("{\n \"name\": \"my-data-disk\",\n \"mounts\": [\n {\n \"type\": \"s3\",\n \"bucketName\": \"my-bucket\",\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"bucketPrefix\": \"data/\"\n }\n ],\n \"authMethods\": [\n {\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://control.green.us-east-1.aws.prod.archil.com/api/disks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-data-disk\",\n \"mounts\": [\n {\n \"type\": \"s3\",\n \"bucketName\": \"my-bucket\",\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"bucketPrefix\": \"data/\"\n }\n ],\n \"authMethods\": [\n {\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/disks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-data-disk\",\n \"mounts\": [\n {\n \"type\": \"s3\",\n \"bucketName\": \"my-bucket\",\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"bucketPrefix\": \"data/\"\n }\n ],\n \"authMethods\": [\n {\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"diskId": "dsk-0123456789abcdef",
"authorizedUsers": [
{
"principal": "<string>",
"nickname": "<string>",
"tokenSuffix": "<string>",
"token": "<string>",
"identifier": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": true,
"data": {
"diskId": "dsk-0123456789abcdef",
"authorizedUsers": [
{
"principal": "<string>",
"nickname": "<string>",
"tokenSuffix": "<string>",
"token": "<string>",
"identifier": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}Authorizations
API key
Body
Disk name (alphanumeric, dashes, underscores)
1 - 100^[a-zA-Z0-9_-]+$"my-data-disk"
Storage mount to attach. Omit for archil-managed storage.
1Mount configuration for Amazon S3 buckets
- S3
- Google Cloud Storage
- Cloudflare R2
- S3-Compatible
- Azure Blob Storage
Show child attributes
Show child attributes
Deprecated. Use AddDiskUser after creation instead. When provided, suppresses the default auto-generated token user.
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/disks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-data-disk",
"mounts": [
{
"type": "s3",
"bucketName": "my-bucket",
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"sessionToken": "<string>",
"bucketPrefix": "data/"
}
],
"authMethods": [
{
"type": "token",
"nickname": "<string>",
"principal": "<string>",
"tokenSuffix": "<string>"
}
]
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/disks"
payload = {
"name": "my-data-disk",
"mounts": [
{
"type": "s3",
"bucketName": "my-bucket",
"accessKeyId": "<string>",
"secretAccessKey": "<string>",
"sessionToken": "<string>",
"bucketPrefix": "data/"
}
],
"authMethods": [
{
"type": "token",
"nickname": "<string>",
"principal": "<string>",
"tokenSuffix": "<string>"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'my-data-disk',
mounts: [
{
type: 's3',
bucketName: 'my-bucket',
accessKeyId: '<string>',
secretAccessKey: '<string>',
sessionToken: '<string>',
bucketPrefix: 'data/'
}
],
authMethods: [
{
type: 'token',
nickname: '<string>',
principal: '<string>',
tokenSuffix: '<string>'
}
]
})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/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://control.green.us-east-1.aws.prod.archil.com/api/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([
'name' => 'my-data-disk',
'mounts' => [
[
'type' => 's3',
'bucketName' => 'my-bucket',
'accessKeyId' => '<string>',
'secretAccessKey' => '<string>',
'sessionToken' => '<string>',
'bucketPrefix' => 'data/'
]
],
'authMethods' => [
[
'type' => 'token',
'nickname' => '<string>',
'principal' => '<string>',
'tokenSuffix' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://control.green.us-east-1.aws.prod.archil.com/api/disks"
payload := strings.NewReader("{\n \"name\": \"my-data-disk\",\n \"mounts\": [\n {\n \"type\": \"s3\",\n \"bucketName\": \"my-bucket\",\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"bucketPrefix\": \"data/\"\n }\n ],\n \"authMethods\": [\n {\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://control.green.us-east-1.aws.prod.archil.com/api/disks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-data-disk\",\n \"mounts\": [\n {\n \"type\": \"s3\",\n \"bucketName\": \"my-bucket\",\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"bucketPrefix\": \"data/\"\n }\n ],\n \"authMethods\": [\n {\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/disks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-data-disk\",\n \"mounts\": [\n {\n \"type\": \"s3\",\n \"bucketName\": \"my-bucket\",\n \"accessKeyId\": \"<string>\",\n \"secretAccessKey\": \"<string>\",\n \"sessionToken\": \"<string>\",\n \"bucketPrefix\": \"data/\"\n }\n ],\n \"authMethods\": [\n {\n \"type\": \"token\",\n \"nickname\": \"<string>\",\n \"principal\": \"<string>\",\n \"tokenSuffix\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"diskId": "dsk-0123456789abcdef",
"authorizedUsers": [
{
"principal": "<string>",
"nickname": "<string>",
"tokenSuffix": "<string>",
"token": "<string>",
"identifier": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": true,
"data": {
"diskId": "dsk-0123456789abcdef",
"authorizedUsers": [
{
"principal": "<string>",
"nickname": "<string>",
"tokenSuffix": "<string>",
"token": "<string>",
"identifier": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}{
"success": false,
"error": "Invalid request parameters"
}