import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const devboxSnapshotView = await client.devboxes.snapshotDiskAsync('id');
console.log(devboxSnapshotView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
devbox_snapshot_view = client.devboxes.snapshot_disk_async(
id="id",
)
print(devbox_snapshot_view.id)curl --request POST \
--url https://api.runloop.ai/v1/devboxes/{id}/snapshot_disk_async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"metadata": {},
"commit_message": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/devboxes/{id}/snapshot_disk_async",
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' => '<string>',
'metadata' => [
],
'commit_message' => '<string>'
]),
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.runloop.ai/v1/devboxes/{id}/snapshot_disk_async"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"metadata\": {},\n \"commit_message\": \"<string>\"\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.runloop.ai/v1/devboxes/{id}/snapshot_disk_async")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"metadata\": {},\n \"commit_message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/devboxes/{id}/snapshot_disk_async")
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 \"name\": \"<string>\",\n \"metadata\": {},\n \"commit_message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"create_time_ms": 123,
"metadata": {},
"source_devbox_id": "<string>",
"name": "<string>",
"source_blueprint_id": "<string>",
"commit_message": "<string>",
"size_bytes": 123
}Start an asynchronous disk snapshot of a running Devbox.
Start an asynchronous disk snapshot of a devbox with the specified name and metadata. The snapshot operation will continue in the background and can be monitored using the query endpoint.
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const devboxSnapshotView = await client.devboxes.snapshotDiskAsync('id');
console.log(devboxSnapshotView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
devbox_snapshot_view = client.devboxes.snapshot_disk_async(
id="id",
)
print(devbox_snapshot_view.id)curl --request POST \
--url https://api.runloop.ai/v1/devboxes/{id}/snapshot_disk_async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"metadata": {},
"commit_message": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/devboxes/{id}/snapshot_disk_async",
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' => '<string>',
'metadata' => [
],
'commit_message' => '<string>'
]),
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.runloop.ai/v1/devboxes/{id}/snapshot_disk_async"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"metadata\": {},\n \"commit_message\": \"<string>\"\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.runloop.ai/v1/devboxes/{id}/snapshot_disk_async")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"metadata\": {},\n \"commit_message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/devboxes/{id}/snapshot_disk_async")
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 \"name\": \"<string>\",\n \"metadata\": {},\n \"commit_message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"create_time_ms": 123,
"metadata": {},
"source_devbox_id": "<string>",
"name": "<string>",
"source_blueprint_id": "<string>",
"commit_message": "<string>",
"size_bytes": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The Devbox ID.
Body
Response
Snapshot operation started successfully.
The unique identifier of the snapshot.
Creation time of the Snapshot (Unix timestamp milliseconds).
User defined metadata associated with the snapshot.
Show child attributes
Show child attributes
The source Devbox ID this snapshot was created from.
(Optional) The custom name of the snapshot.
(Optional) The source Blueprint ID this snapshot was created from.
(Optional) The commit message of the snapshot (max 1000 characters).
(Optional) The size of the snapshot in bytes, relative to the base blueprint.
Was this page helpful?
