curl --request POST \
--url https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep"
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Outerlayer-App-Id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep', 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.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"dataPlaneUrl": "<string>",
"id": "<string>",
"machine": "small",
"metadata": {},
"name": "<string>",
"secret": "<string>",
"state": "<string>",
"tokenHeader": "<string>",
"urlToken": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Keep one of the factory's managed sandboxes, paused, after its build ends
Keeps the sandbox, paused, so that it outlives its claim. The caller must hold the live claim the sandbox was made for. The gateway marks the sandbox kept, changes its secret at the provider, and pauses it, in that order. No answer gives out the new secret, and no secret that left the gateway opens the sandbox. The answer is the sandbox with an empty secret and urlToken. A repeat of the call for a sandbox that is kept and paused makes no call to the provider, and answers with an empty dataPlaneUrl. A kept sandbox is not billed after its claim is released. It ends after 24 hours, when a newer kept sandbox of the same work item replaces it, or when the factory holds more than 10. A pause that gets no answer in 30 seconds does not fail the call. The every-minute check ends a kept sandbox that still runs 5 minutes after the keep. Refusals: claim_expired (410, the claim is released or expired, or the caller holds a newer one), claim_not_held (403), sandbox_not_found (404), managed_sandboxes_off (403), managed_sandboxes_unavailable (403) and sandbox_provider_refused (502). A refused secret change leaves the sandbox running and not kept. A refused pause ends the sandbox. The response is sent with Cache-Control: no-store.
curl --request POST \
--url https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep"
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Outerlayer-App-Id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep', 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.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/managed-sandboxes/{sandboxId}/keep")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"dataPlaneUrl": "<string>",
"id": "<string>",
"machine": "small",
"metadata": {},
"name": "<string>",
"secret": "<string>",
"state": "<string>",
"tokenHeader": "<string>",
"urlToken": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}