Sign Up

VolumeService

Manage named volumes and attach them with create({ volumes }).

Constructors

Constructor

new VolumeService(api: AxiosInstance): VolumeService;

Parameters:

  • api AxiosInstance

Returns:

  • VolumeService

Methods

create()

create(name: string, sizeGib?: number): Promise<Volume>;

Creates a disk volume (ready immediately).

Parameters:

  • name string
  • sizeGib? number

Returns:

  • Promise<Volume>

delete()

delete(volume: Volume | string, options?: VolumeRefOptions): Promise<void>;

Requests deletion and returns once the API accepts it.

Parameters:

  • volume Volume | string
  • options? VolumeRefOptions

Returns:

  • Promise<void>

get()

get(nameOrId: string, create = false, options?: VolumeRefOptions): Promise<Volume>;

Get a volume by id or name; optionally create it when absent.

Parameters:

  • nameOrId string
  • create boolean = false
  • options? VolumeRefOptions

Returns:

  • Promise<Volume>

iter()

iter(options: ListVolumesOptions = {}): AsyncIterable<Volume>;

Parameters:

  • options ListVolumesOptions = {}

Returns:

  • AsyncIterable<Volume>

list()

list(options: ListVolumesOptions = {}): Promise<ListResult<Volume>>;

Parameters:

  • options ListVolumesOptions = {}

Returns:

  • Promise<ListResult<Volume>>

SandboxVolumesService

Pull attached volumes in this sandbox; distinct from the platform volume service.

Constructors

Constructor

new SandboxVolumesService(transport: HttpTransport): SandboxVolumesService;

Parameters:

  • transport HttpTransport

Returns:

  • SandboxVolumesService

Methods

pull()

pull(volumeId: string, options: PullVolumeOptions): Promise<PullVolumeResult>;

One submission/check only. Pending and errors never trigger automatic retries.

Parameters:

  • volumeId string
  • options PullVolumeOptions

Returns:

  • Promise<PullVolumeResult>

PullVolumeOptions

Properties:

  • requestId string - Caller-owned identity. Retain it when checking pending work or retrying.
  • timeout? number - Server wait in milliseconds (0–30000); omitted means 30000. Does not cancel work. Zero submits a new requestId, or returns a known one's last outcome without retrying it; a wait above zero retries pending, unavailable or rate-limited work.

PullVolumeResult

Properties:

  • manifestId string | null
  • requestId string
  • status PullVolumeStatus
  • rawStatus string

ListVolumesOptions

Properties:

  • cursor? string
  • limit? number

Volume

A volume that preserves files between sandboxes.

Properties:

  • id string
  • name string
  • type VolumeType
  • rawType string
  • sizeGib? number | null
  • status VolumeState
  • rawStatus string
  • error? string | null
  • createdAt string
  • updatedAt string
  • lastUsedAt? string | null
  • options? Readonly<Record<string, never>>
  • usedBytes? number | null
  • usedBytesAt? string | null

VolumeRefOptions

Properties:

  • idOnly? boolean

VolumeMount

Properties:

  • volumeId string
  • mountPath string
  • subpath? string
  • readOnly? boolean - Mount without write access. Only bucket volumes support true.

VolumeState

type VolumeState = (typeof API_VOLUME_STATUSES)[number] | 'unknown'

VolumeType

type VolumeType = (typeof API_VOLUME_TYPES)[number] | 'unknown'

PullVolumeStatus

type PullVolumeStatus = 'pulled' | 'unchanged' | 'pending' | 'unknown'