@runloop/api-client - v1.4.0
    Preparing search index...

    Class Snapshot

    Object-oriented interface for working with Disk Snapshots.

    The Snapshot class provides a high-level API for managing disk snapshots of devboxes. Snapshots capture the complete state of a devbox's disk and can be used to restore devboxes to a previous state or create new devboxes from saved states.

    Snapshots are typically created from devboxes:

    import { RunloopSDK } from '@runloop/api-client-ts';

    const runloop = new RunloopSDK();
    const devbox = runloop.devbox.create({ name: 'my-devbox' });
    devbox.file.write('my-file.txt', 'Hello, World!');
    const snapshot = await devbox.snapshotDisk({ name: 'backup' });
    const devboxFromSnapshot = await snapshot.createDevbox({ name: 'my-devbox-from-snapshot' });
    ...
    Index

    Constructors

    Accessors

    Methods

    • List all snapshots, optionally filtered by devbox ID or metadata.

      Parameters

      Returns Promise<RunloopSDK.Snapshot[]>

      Array of Snapshot instances

      const runloop = new RunloopSDK();
      // List all snapshots
      const snapshots = await runloop.snapshot.list();

      // Filter by devbox ID
      const snapshots = await runloop.snapshot.list({ devbox_id: 'devbox-123' });
    • Update the snapshot's name and/or metadata. This performs a complete replacement, not a patch.

      Parameters

      • Optionalparams: DiskSnapshotUpdateParams

        New name and/or metadata

      • Optionaloptions: RequestOptions<unknown>

        Request options

      Returns Promise<void>

      Promise that resolves when the update is complete

    • Delete this snapshot.

      Parameters

      • Optionaloptions: RequestOptions<unknown>

        Request options

      Returns Promise<unknown>

      The deletion result

    • Create a new devbox from this snapshot. This is a convenience method that calls Devbox.create() with the snapshot ID and any additional parameters you want to layer on top.

      Parameters

      • Optionalparams: Omit<DevboxCreateParams, "blueprint_id" | "blueprint_name" | "snapshot_id">

        Additional devbox creation parameters (optional)

      • Optionaloptions: RequestOptions<unknown> & { polling?: Partial<PollingOptions<DevboxView>> }

        Request options with optional polling configuration

      Returns Promise<RunloopSDK.Devbox>

      A new Devbox instance created from this snapshot

      const runloop = new RunloopSDK();
      const snapshot = runloop.snapshot.fromId('snapshot-123');
      const devbox = await snapshot.createDevbox({
      name: 'restored-devbox',
      // Additional devbox parameters...
      });