Skip to main content
One page for everything the volume API does, so the task pages can stay about the task. If you have not created a volume yet, start with Mount a volume.

Prerequisites

  • An API key from the console, exported as BOXLITE_API_KEY. See API keys.
  • A REST runtime. Managed volumes need one — a local runtime has no volume backend to resolve a reference against.

Name a volume and mount it by that name

A volume has both a server-assigned id and a name, and either one mounts it. When you create a volume without a name, the server uses the id as the name. Choosing your own name is what lets a worker mount the volume it wants without knowing the id. The two halves can live in different processes that never exchange an id:
Names are unique within your organization, so a name is a stable address across processes and across time. An id is stable too, but you have to carry it somewhere.

Parameters and returns

The runtime you build with Boxlite.rest(...) carries a volumes API. volumes is a property, so write rt.volumes — no parentheses — and await the four methods hanging off it. In Node the same four methods are create(name?), list(), get(id), and remove(id, force?). VolumeInfo fields are read-only: To work with a volume you already have, pass its name or id straight to the box’s volumes field, or call get() first to confirm it exists.

Mount a volume into a box

Mounting is configured at creation time through the volumes field on the box options. Each element is a (volume, mount_path) pair. The first element is a managed volume’s name or id — not a path on your machine. That is the mental switch to make coming from open source. The mount path has to be an absolute path that is not the root and not a system directory. The service rejects the box otherwise: For the full box options table and exec semantics, see the Python SDK reference or the Node.js SDK reference. For host-directory mount forms, see Volumes and mounts.

Read-only mounts

Read-only managed volumes are not supported. The SDK refuses the mount before the request leaves your process, rather than mounting it writable and letting you believe it is protected:
Mount read-write and enforce read-only behavior in your own code, or use a separate volume for data no box should modify.

What is different from open source

Host bind mounts are rejected over REST. In open source, volumes=[("/home/you/data", "/data")] mounts a directory from your machine. On Cloud that first element must be a managed volume’s name or id. The SDK refuses the box before any network request goes out:
So the mistake surfaces immediately, rather than as a box that starts with an empty mount. If you are porting code, replace every host path with a managed volume reference.
For host-directory mount options, read-only mounts, and copy_in / copy_out, see Volumes and mounts. For the complete side-by-side, see Cloud vs open source.

Troubleshooting

Next steps

Mount a volume

Create one, mount it, write and read through it.

Volume operations

List, inspect, and delete volumes.