Volume
Named volumes are managed by microsandbox and stored at~/.microsandbox/volumes/<name>/. They persist independently of any sandbox.
Static methods
Volume.create()
| Name | Type | Description |
|---|---|---|
| config | VolumeConfig | Volume configuration |
| Type | Description |
|---|---|
Volume | Created volume with name and path properties |
Volume.get()
| Name | Type | Description |
|---|---|---|
| name | string | Volume name |
| Type | Description |
|---|---|
VolumeHandle | Volume handle |
Volume.list()
| Type | Description |
|---|---|
Array<VolumeInfo> | All volumes |
Volume.remove()
| Name | Type | Description |
|---|---|---|
| name | string | Volume name |
Mount
Static factory for creating mount configurations used inSandboxConfig.volumes.
Mount.bind()
| Name | Type | Description |
|---|---|---|
| path | string | Directory path on the host |
| opts? | { readonly?: boolean } | Mount options |
Mount.named()
Volume.create()).
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Volume name |
| opts? | { readonly?: boolean } | Mount options |
Mount.tmpfs()
| Name | Type | Description |
|---|---|---|
| opts? | { sizeMib?: number, readonly?: boolean } | Tmpfs options |
Types
VolumeConfig
| Field | Type | Default | Description |
|---|---|---|---|
| labels? | Record<string, string> | {} | Metadata labels |
| name | string | - | Volume name (required) |
| quotaMib? | number | - | Maximum storage size in MiB |
VolumeHandle
| Property / Method | Type | Description |
|---|---|---|
| createdAt | number | null | Creation timestamp (ms since epoch) |
| labels | Record<string, string> | Metadata labels |
| name | string | Volume name |
| quotaMib | number | null | Storage quota |
| remove() | Promise<void> | Delete this volume |
| usedBytes | number | Current disk usage in bytes |
VolumeInfo
| Field | Type | Description |
|---|---|---|
| createdAt | number | null | Creation timestamp |
| labels | Record<string, string> | Metadata labels |
| name | string | Volume name |
| quotaMib | number | null | Storage quota |
| usedBytes | number | Current disk usage |