Suspend a sandbox
curl --request POST \
--url https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend', 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.tensorlake.ai/sandboxes/{sandbox_id}/suspend",
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>"
],
]);
$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.tensorlake.ai/sandboxes/{sandbox_id}/suspend"
req, _ := http.NewRequest("POST", url, nil)
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.tensorlake.ai/sandboxes/{sandbox_id}/suspend")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyLife Cycle Management
Suspend Sandbox
Suspend a named running sandbox by snapshotting it and terminating the live container. Returns 202 Accepted when suspension begins or is already in progress, and 200 OK when the sandbox is already suspended.
POST
/
sandboxes
/
{sandbox_id}
/
suspend
Suspend a sandbox
curl --request POST \
--url https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend', 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.tensorlake.ai/sandboxes/{sandbox_id}/suspend",
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>"
],
]);
$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.tensorlake.ai/sandboxes/{sandbox_id}/suspend"
req, _ := http.NewRequest("POST", url, nil)
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.tensorlake.ai/sandboxes/{sandbox_id}/suspend")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodySuspend a named running sandbox by snapshotting it and terminating the live container.
- This path accepts either the sandbox ID or the sandbox name.
- Only named sandboxes can be suspended. Ephemeral sandboxes return
400 Bad Request. - Tensorlake returns
202 Acceptedwhen suspension starts or is already in progress. - Tensorlake returns
200 OKwhen the sandbox is already suspended.
Was this page helpful?