Create a sandbox
curl --request POST \
--url https://api.ravion.com/sandboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"executionEnvironmentId": "<string>",
"cpu": 32,
"diskGib": 512,
"env": {},
"idleTimeoutSeconds": 43200,
"memoryMib": 131328,
"moduleInstanceId": "<string>",
"onResume": [
"<string>"
],
"retentionSeconds": 1296030
}
}
'import requests
url = "https://api.ravion.com/sandboxes"
payload = { "data": {
"executionEnvironmentId": "<string>",
"cpu": 32,
"diskGib": 512,
"env": {},
"idleTimeoutSeconds": 43200,
"memoryMib": 131328,
"moduleInstanceId": "<string>",
"onResume": ["<string>"],
"retentionSeconds": 1296030
} }
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({
data: {
executionEnvironmentId: '<string>',
cpu: 32,
diskGib: 512,
env: {},
idleTimeoutSeconds: 43200,
memoryMib: 131328,
moduleInstanceId: '<string>',
onResume: ['<string>'],
retentionSeconds: 1296030
}
})
};
fetch('https://api.ravion.com/sandboxes', 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.ravion.com/sandboxes",
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([
'data' => [
'executionEnvironmentId' => '<string>',
'cpu' => 32,
'diskGib' => 512,
'env' => [
],
'idleTimeoutSeconds' => 43200,
'memoryMib' => 131328,
'moduleInstanceId' => '<string>',
'onResume' => [
'<string>'
],
'retentionSeconds' => 1296030
]
]),
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.ravion.com/sandboxes"
payload := strings.NewReader("{\n \"data\": {\n \"executionEnvironmentId\": \"<string>\",\n \"cpu\": 32,\n \"diskGib\": 512,\n \"env\": {},\n \"idleTimeoutSeconds\": 43200,\n \"memoryMib\": 131328,\n \"moduleInstanceId\": \"<string>\",\n \"onResume\": [\n \"<string>\"\n ],\n \"retentionSeconds\": 1296030\n }\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.ravion.com/sandboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"executionEnvironmentId\": \"<string>\",\n \"cpu\": 32,\n \"diskGib\": 512,\n \"env\": {},\n \"idleTimeoutSeconds\": 43200,\n \"memoryMib\": 131328,\n \"moduleInstanceId\": \"<string>\",\n \"onResume\": [\n \"<string>\"\n ],\n \"retentionSeconds\": 1296030\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/sandboxes")
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 \"data\": {\n \"executionEnvironmentId\": \"<string>\",\n \"cpu\": 32,\n \"diskGib\": 512,\n \"env\": {},\n \"idleTimeoutSeconds\": 43200,\n \"memoryMib\": 131328,\n \"moduleInstanceId\": \"<string>\",\n \"onResume\": [\n \"<string>\"\n ],\n \"retentionSeconds\": 1296030\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"cpu": 123,
"createdAt": "2023-11-07T05:31:56Z",
"diskGib": 123,
"envKeys": [
"<string>"
],
"executionEnvironmentId": "<string>",
"id": "<string>",
"idleTimeoutSeconds": 123,
"memoryMib": 123,
"organizationId": "<string>",
"ports": [
{
"domain": "<string>",
"port": 32768,
"status": "PENDING",
"takeover": true,
"url": "<string>",
"error": "<string>"
}
],
"retentionSeconds": 123,
"status": "PENDING",
"updatedAt": "2023-11-07T05:31:56Z",
"app": {
"appId": "<string>",
"moduleInstanceId": "<string>",
"branch": "<string>",
"commit": "<string>"
},
"expiresAt": "2023-11-07T05:31:56Z",
"host": {
"hostId": "<string>",
"since": "2023-11-07T05:31:56Z"
},
"lastActiveAt": "2023-11-07T05:31:56Z",
"moduleInstanceId": "<string>",
"onResume": [
"<string>"
],
"pausedAt": "2023-11-07T05:31:56Z",
"statusReason": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}Sandboxes
Create a sandbox
Create a sandbox in an execution environment’s sandbox pool. The sandbox comes back PENDING; poll it until it is RUNNING before starting commands.
POST
/
sandboxes
Create a sandbox
curl --request POST \
--url https://api.ravion.com/sandboxes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"executionEnvironmentId": "<string>",
"cpu": 32,
"diskGib": 512,
"env": {},
"idleTimeoutSeconds": 43200,
"memoryMib": 131328,
"moduleInstanceId": "<string>",
"onResume": [
"<string>"
],
"retentionSeconds": 1296030
}
}
'import requests
url = "https://api.ravion.com/sandboxes"
payload = { "data": {
"executionEnvironmentId": "<string>",
"cpu": 32,
"diskGib": 512,
"env": {},
"idleTimeoutSeconds": 43200,
"memoryMib": 131328,
"moduleInstanceId": "<string>",
"onResume": ["<string>"],
"retentionSeconds": 1296030
} }
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({
data: {
executionEnvironmentId: '<string>',
cpu: 32,
diskGib: 512,
env: {},
idleTimeoutSeconds: 43200,
memoryMib: 131328,
moduleInstanceId: '<string>',
onResume: ['<string>'],
retentionSeconds: 1296030
}
})
};
fetch('https://api.ravion.com/sandboxes', 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.ravion.com/sandboxes",
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([
'data' => [
'executionEnvironmentId' => '<string>',
'cpu' => 32,
'diskGib' => 512,
'env' => [
],
'idleTimeoutSeconds' => 43200,
'memoryMib' => 131328,
'moduleInstanceId' => '<string>',
'onResume' => [
'<string>'
],
'retentionSeconds' => 1296030
]
]),
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.ravion.com/sandboxes"
payload := strings.NewReader("{\n \"data\": {\n \"executionEnvironmentId\": \"<string>\",\n \"cpu\": 32,\n \"diskGib\": 512,\n \"env\": {},\n \"idleTimeoutSeconds\": 43200,\n \"memoryMib\": 131328,\n \"moduleInstanceId\": \"<string>\",\n \"onResume\": [\n \"<string>\"\n ],\n \"retentionSeconds\": 1296030\n }\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.ravion.com/sandboxes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"executionEnvironmentId\": \"<string>\",\n \"cpu\": 32,\n \"diskGib\": 512,\n \"env\": {},\n \"idleTimeoutSeconds\": 43200,\n \"memoryMib\": 131328,\n \"moduleInstanceId\": \"<string>\",\n \"onResume\": [\n \"<string>\"\n ],\n \"retentionSeconds\": 1296030\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/sandboxes")
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 \"data\": {\n \"executionEnvironmentId\": \"<string>\",\n \"cpu\": 32,\n \"diskGib\": 512,\n \"env\": {},\n \"idleTimeoutSeconds\": 43200,\n \"memoryMib\": 131328,\n \"moduleInstanceId\": \"<string>\",\n \"onResume\": [\n \"<string>\"\n ],\n \"retentionSeconds\": 1296030\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"cpu": 123,
"createdAt": "2023-11-07T05:31:56Z",
"diskGib": 123,
"envKeys": [
"<string>"
],
"executionEnvironmentId": "<string>",
"id": "<string>",
"idleTimeoutSeconds": 123,
"memoryMib": 123,
"organizationId": "<string>",
"ports": [
{
"domain": "<string>",
"port": 32768,
"status": "PENDING",
"takeover": true,
"url": "<string>",
"error": "<string>"
}
],
"retentionSeconds": 123,
"status": "PENDING",
"updatedAt": "2023-11-07T05:31:56Z",
"app": {
"appId": "<string>",
"moduleInstanceId": "<string>",
"branch": "<string>",
"commit": "<string>"
},
"expiresAt": "2023-11-07T05:31:56Z",
"host": {
"hostId": "<string>",
"since": "2023-11-07T05:31:56Z"
},
"lastActiveAt": "2023-11-07T05:31:56Z",
"moduleInstanceId": "<string>",
"onResume": [
"<string>"
],
"pausedAt": "2023-11-07T05:31:56Z",
"statusReason": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}Body
application/json
What to create a sandbox with. Omitted sizes and timeouts take the defaults named on each field.
Show child attributes
Show child attributes
Response
The request has succeeded and a new resource has been created as a result.
A sandbox: a development microVM you run commands in.
Show child attributes
Show child attributes
Was this page helpful?