Execute Command with Multiple Disks
Launches a container with the supplied set of disks each mounted at its
own relative path under /mnt/archil, runs the command to completion,
and shuts down the container. Activation is atomic: every disk mounts
or none of them do.
Relative paths must be non-empty, non-absolute, and contain no . /
.. segments. Mounting two disks at the same relative path is an
error.
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/exec \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"disks": {
"data": "dsk-abc123",
"logs": {
"disk": "dsk-def456",
"subdirectory": "app/logs",
"readOnly": true
}
},
"command": "ls -la /mnt/archil/data /mnt/archil/logs"
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/exec"
payload = {
"disks": {
"data": "dsk-abc123",
"logs": {
"disk": "dsk-def456",
"subdirectory": "app/logs",
"readOnly": True
}
},
"command": "ls -la /mnt/archil/data /mnt/archil/logs"
}
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({
disks: {
data: 'dsk-abc123',
logs: {disk: 'dsk-def456', subdirectory: 'app/logs', readOnly: true}
},
command: 'ls -la /mnt/archil/data /mnt/archil/logs'
})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/exec', 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/exec",
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([
'disks' => [
'data' => 'dsk-abc123',
'logs' => [
'disk' => 'dsk-def456',
'subdirectory' => 'app/logs',
'readOnly' => true
]
],
'command' => 'ls -la /mnt/archil/data /mnt/archil/logs'
]),
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/exec"
payload := strings.NewReader("{\n \"disks\": {\n \"data\": \"dsk-abc123\",\n \"logs\": {\n \"disk\": \"dsk-def456\",\n \"subdirectory\": \"app/logs\",\n \"readOnly\": true\n }\n },\n \"command\": \"ls -la /mnt/archil/data /mnt/archil/logs\"\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/exec")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"disks\": {\n \"data\": \"dsk-abc123\",\n \"logs\": {\n \"disk\": \"dsk-def456\",\n \"subdirectory\": \"app/logs\",\n \"readOnly\": true\n }\n },\n \"command\": \"ls -la /mnt/archil/data /mnt/archil/logs\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/exec")
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 \"disks\": {\n \"data\": \"dsk-abc123\",\n \"logs\": {\n \"disk\": \"dsk-def456\",\n \"subdirectory\": \"app/logs\",\n \"readOnly\": true\n }\n },\n \"command\": \"ls -la /mnt/archil/data /mnt/archil/logs\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"exitCode": 0,
"stdout": "<string>",
"stderr": "<string>",
"timing": {
"totalMs": 2450,
"queueMs": 150,
"executeMs": 2300
}
}
}{
"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
Map of relative path under /mnt/archil to the disk to mount
there. At least one entry is required. Relative paths must be
non-empty, non-absolute, and contain no . or .. segments.
Each value is either a plain disk ID string (mounts the disk's root, read-write) or an object that additionally selects a subdirectory of the disk and/or marks the mount as read-only.
Show child attributes
Show child attributes
{
"data": "dsk-abc123",
"logs": {
"disk": "dsk-def456",
"subdirectory": "app/logs",
"readOnly": true
}
}
Shell command to execute inside the container
"ls -la /mnt/archil/data /mnt/archil/logs"
Was this page helpful?
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/exec \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"disks": {
"data": "dsk-abc123",
"logs": {
"disk": "dsk-def456",
"subdirectory": "app/logs",
"readOnly": true
}
},
"command": "ls -la /mnt/archil/data /mnt/archil/logs"
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/exec"
payload = {
"disks": {
"data": "dsk-abc123",
"logs": {
"disk": "dsk-def456",
"subdirectory": "app/logs",
"readOnly": True
}
},
"command": "ls -la /mnt/archil/data /mnt/archil/logs"
}
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({
disks: {
data: 'dsk-abc123',
logs: {disk: 'dsk-def456', subdirectory: 'app/logs', readOnly: true}
},
command: 'ls -la /mnt/archil/data /mnt/archil/logs'
})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/exec', 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/exec",
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([
'disks' => [
'data' => 'dsk-abc123',
'logs' => [
'disk' => 'dsk-def456',
'subdirectory' => 'app/logs',
'readOnly' => true
]
],
'command' => 'ls -la /mnt/archil/data /mnt/archil/logs'
]),
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/exec"
payload := strings.NewReader("{\n \"disks\": {\n \"data\": \"dsk-abc123\",\n \"logs\": {\n \"disk\": \"dsk-def456\",\n \"subdirectory\": \"app/logs\",\n \"readOnly\": true\n }\n },\n \"command\": \"ls -la /mnt/archil/data /mnt/archil/logs\"\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/exec")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"disks\": {\n \"data\": \"dsk-abc123\",\n \"logs\": {\n \"disk\": \"dsk-def456\",\n \"subdirectory\": \"app/logs\",\n \"readOnly\": true\n }\n },\n \"command\": \"ls -la /mnt/archil/data /mnt/archil/logs\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/exec")
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 \"disks\": {\n \"data\": \"dsk-abc123\",\n \"logs\": {\n \"disk\": \"dsk-def456\",\n \"subdirectory\": \"app/logs\",\n \"readOnly\": true\n }\n },\n \"command\": \"ls -la /mnt/archil/data /mnt/archil/logs\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"exitCode": 0,
"stdout": "<string>",
"stderr": "<string>",
"timing": {
"totalMs": 2450,
"queueMs": 150,
"executeMs": 2300
}
}
}{
"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"
}