curl --request POST \
--url https://api.tensorlake.ai/sandboxes/{sandbox_id}/file_systems \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_system_id": "<string>",
"mount_path": "<string>",
"read_only": false,
"prefetch": false,
"snapshot_id": "<string>"
}
'import requests
url = "https://api.tensorlake.ai/sandboxes/{sandbox_id}/file_systems"
payload = {
"file_system_id": "<string>",
"mount_path": "<string>",
"read_only": False,
"prefetch": False,
"snapshot_id": "<string>"
}
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({
file_system_id: '<string>',
mount_path: '<string>',
read_only: false,
prefetch: false,
snapshot_id: '<string>'
})
};
fetch('https://api.tensorlake.ai/sandboxes/{sandbox_id}/file_systems', 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}/file_systems",
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([
'file_system_id' => '<string>',
'mount_path' => '<string>',
'read_only' => false,
'prefetch' => false,
'snapshot_id' => '<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.tensorlake.ai/sandboxes/{sandbox_id}/file_systems"
payload := strings.NewReader("{\n \"file_system_id\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false,\n \"prefetch\": false,\n \"snapshot_id\": \"<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.tensorlake.ai/sandboxes/{sandbox_id}/file_systems")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_system_id\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false,\n \"prefetch\": false,\n \"snapshot_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorlake.ai/sandboxes/{sandbox_id}/file_systems")
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 \"file_system_id\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false,\n \"prefetch\": false,\n \"snapshot_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"auto_resume": true,
"id": "<string>",
"namespace": "<string>",
"status": "pending",
"created_at": 123,
"resources": {
"cpus": 123,
"memory_mb": 123,
"disk_mb": 123
},
"timeout_secs": 123,
"allow_unauthenticated_access": true,
"image": "<string>",
"pending_reason": "<string>",
"outcome": "<string>",
"termination_reason": "<string>",
"error_details": "<string>",
"container_id": "<string>",
"executor_id": "<string>",
"ingress_endpoint": "<string>",
"sandbox_url": "<string>",
"pool_id": "<string>",
"network_policy": {
"allow_internet_access": true,
"allow_out": [
"<string>"
],
"deny_out": [
"<string>"
]
},
"exposed_ports": [
32768
],
"template_id": "<string>",
"name": "<string>",
"file_systems": [
{
"file_system_id": "<string>",
"mount_path": "<string>",
"read_only": false,
"prefetch": false,
"snapshot_id": "<string>"
}
],
"snapshot_id": "<string>"
}Attach Filesystem
Attach a filesystem to a running sandbox at an absolute guest mount path. Returns 200 OK once the mount is persisted; the mount applies asynchronously on the live sandbox. If the mount later cannot converge — including a file_system_id that does not exist, or a pinned snapshot_id that is not a permanent snapshot of the filesystem — the sandbox is terminated fail-closed with termination_reason and error_details on the sandbox object, so verify the filesystem exists (for example with tl fs ls) and the snapshot is listed by tl fs history before attaching.
curl --request POST \
--url https://api.tensorlake.ai/sandboxes/{sandbox_id}/file_systems \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_system_id": "<string>",
"mount_path": "<string>",
"read_only": false,
"prefetch": false,
"snapshot_id": "<string>"
}
'import requests
url = "https://api.tensorlake.ai/sandboxes/{sandbox_id}/file_systems"
payload = {
"file_system_id": "<string>",
"mount_path": "<string>",
"read_only": False,
"prefetch": False,
"snapshot_id": "<string>"
}
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({
file_system_id: '<string>',
mount_path: '<string>',
read_only: false,
prefetch: false,
snapshot_id: '<string>'
})
};
fetch('https://api.tensorlake.ai/sandboxes/{sandbox_id}/file_systems', 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}/file_systems",
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([
'file_system_id' => '<string>',
'mount_path' => '<string>',
'read_only' => false,
'prefetch' => false,
'snapshot_id' => '<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.tensorlake.ai/sandboxes/{sandbox_id}/file_systems"
payload := strings.NewReader("{\n \"file_system_id\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false,\n \"prefetch\": false,\n \"snapshot_id\": \"<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.tensorlake.ai/sandboxes/{sandbox_id}/file_systems")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_system_id\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false,\n \"prefetch\": false,\n \"snapshot_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorlake.ai/sandboxes/{sandbox_id}/file_systems")
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 \"file_system_id\": \"<string>\",\n \"mount_path\": \"<string>\",\n \"read_only\": false,\n \"prefetch\": false,\n \"snapshot_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"auto_resume": true,
"id": "<string>",
"namespace": "<string>",
"status": "pending",
"created_at": 123,
"resources": {
"cpus": 123,
"memory_mb": 123,
"disk_mb": 123
},
"timeout_secs": 123,
"allow_unauthenticated_access": true,
"image": "<string>",
"pending_reason": "<string>",
"outcome": "<string>",
"termination_reason": "<string>",
"error_details": "<string>",
"container_id": "<string>",
"executor_id": "<string>",
"ingress_endpoint": "<string>",
"sandbox_url": "<string>",
"pool_id": "<string>",
"network_policy": {
"allow_internet_access": true,
"allow_out": [
"<string>"
],
"deny_out": [
"<string>"
]
},
"exposed_ports": [
32768
],
"template_id": "<string>",
"name": "<string>",
"file_systems": [
{
"file_system_id": "<string>",
"mount_path": "<string>",
"read_only": false,
"prefetch": false,
"snapshot_id": "<string>"
}
],
"snapshot_id": "<string>"
}- This path accepts either the sandbox ID or the sandbox name.
file_system_idis the filesystem’s name — the one created withtl fs create <name>.200 OKmeans the mount is persisted; it applies asynchronously on the live sandbox moments later.snapshot_idpins the mount to a permanent snapshot (requiresread_only: true); see Pinned mounts.- If the mount later cannot converge — including a filesystem that does not exist, or a pinned snapshot that is not a permanent snapshot of the filesystem — the sandbox is terminated fail-closed with
termination_reasonanderror_detailson the sandbox object. Verify the filesystem exists (e.g.tl fs ls) and the snapshot is listed bytl fs historybefore attaching. - Tensorlake returns
400 Bad Requestfor asnapshot_idwithoutread_only, or when the sandbox runs on an executor fleet without filesystem or snapshot-pin support. - Tensorlake returns
409 Conflictwhen the sandbox is not running, the mount path is already in use, the sandbox is at the 8-mount cap, or the sandbox’s executor is momentarily unresolvable. The last case is transient — retry shortly.
Authorizations
Body
Pin the mount to a permanent snapshot of the filesystem (created with tl fs snapshot or a message-bearing tl fs push; ids listed by tl fs history). A pinned mount serves exactly that snapshot and never follows the live filesystem head. Requires read_only to be true — a snapshot_id without read_only is rejected with 400. Pinning an id that is not a permanent snapshot of the filesystem fails the sandbox with termination_reason FileSystemSnapshotNotFound. Omit for an unpinned mount that follows the live filesystem; responses omit the field for unpinned mounts.
Response
Filesystem attach accepted and persisted; the returned sandbox already reflects the new file_systems entry
Was this page helpful?