@lizard-build/sdk 0.1.71 → 0.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.mts +14 -16
- package/dist/index.d.ts +14 -16
- package/dist/index.js +9 -11
- package/dist/index.mjs +9 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Lizard SDK for TypeScript
|
|
2
2
|
|
|
3
|
-
Run commands, work with files and execute code in Linux sandboxes
|
|
3
|
+
Run commands, work with files and execute code in Linux sandboxes that run as Firecracker microVMs. The SDK also manages Lizard apps, databases, storage and projects.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -125,7 +125,7 @@ Pass `timeoutMs` to `create()` to set the sandbox lifetime. The default is five
|
|
|
125
125
|
|
|
126
126
|
## Runtime limits
|
|
127
127
|
|
|
128
|
-
Lizard Sandboxes
|
|
128
|
+
Lizard Sandboxes run as Firecracker microVMs, each with its own kernel. Use volumes mounted at `/workspace` to keep files after a sandbox ends. `pause()`/`resume()` keep memory and running processes; `snapshot()` is ready in about 2 s and `Sandbox.restore()` starts a copy in about 0.4 s; `fork()` clones a running sandbox. File watching and sandbox log streaming are not available yet. Volumes can grow but not shrink, and a sandbox with a volume attached cannot be forked. See the [snapshot guide](../../docs/sandboxes.md#pause-resume-snapshots-and-fork).
|
|
129
129
|
|
|
130
130
|
`getHost()` returns a hostname without `https://`; the port is private, so send `sandbox.accessToken` as the `X-Lizard-Access-Token` header (or use `exposePort()`, which also returns a browser `url` carrying the token). File writes accept text or bytes (binary is sent exactly); `readBytes()` supports binary downloads.
|
|
131
131
|
|
package/dist/index.d.mts
CHANGED
|
@@ -714,7 +714,7 @@ declare class Fs {
|
|
|
714
714
|
* }, 1000)
|
|
715
715
|
* ```
|
|
716
716
|
*
|
|
717
|
-
* Not available
|
|
717
|
+
* Not available yet: the call throws `LizardError` (501).
|
|
718
718
|
*/
|
|
719
719
|
watch(path: string, opts?: {
|
|
720
720
|
recursive?: boolean;
|
|
@@ -864,12 +864,12 @@ interface SandboxInfo {
|
|
|
864
864
|
/** Region the sandbox runs in — the volume's region when one is attached. */
|
|
865
865
|
region?: string;
|
|
866
866
|
status?: string;
|
|
867
|
-
/** The sandbox runtime: `'firecracker'` (a microVM),
|
|
867
|
+
/** The sandbox runtime: `'firecracker'` (a microVM), or `null` when unknown. */
|
|
868
868
|
runtime?: 'firecracker' | 'container' | null;
|
|
869
869
|
pauseError?: string | null;
|
|
870
|
-
/** Machine size (`'small' | 'medium' | 'large'`); may be `null` for a sandbox billed by measured usage
|
|
870
|
+
/** Machine size (`'small' | 'medium' | 'large'`); may be `null` for a sandbox billed by measured usage. */
|
|
871
871
|
size?: 'small' | 'medium' | 'large' | null;
|
|
872
|
-
/** Flat hourly price in USD for `size`, billed per second while running; may be `null` when billed by measured usage
|
|
872
|
+
/** Flat hourly price in USD for `size`, billed per second while running; may be `null` when billed by measured usage. */
|
|
873
873
|
pricePerHour?: number | null;
|
|
874
874
|
cpus?: number;
|
|
875
875
|
memoryMb?: number;
|
|
@@ -1011,7 +1011,7 @@ interface SandboxSnapshot {
|
|
|
1011
1011
|
*/
|
|
1012
1012
|
type SnapshotScope = 'user' | 'workspace' | 'project';
|
|
1013
1013
|
interface SnapshotOpts {
|
|
1014
|
-
/** Warm copies to keep ready
|
|
1014
|
+
/** Warm copies to keep ready for an older snapshot. Firecracker snapshots ignore it: they restore from disk. */
|
|
1015
1015
|
poolSize?: number;
|
|
1016
1016
|
/** Where it may be restored. Default `'user'`: any of your projects and workspaces; with a key
|
|
1017
1017
|
* limited to a workspace or project, only what the key covers (a wider scope is narrowed). */
|
|
@@ -1259,11 +1259,11 @@ declare class Sandbox extends SandboxClient {
|
|
|
1259
1259
|
* snapshot. A Firecracker snapshot is `ready` as soon as this returns: about 2 s, up to
|
|
1260
1260
|
* a few minutes for a sandbox that filled most of its memory (its memory is uploaded
|
|
1261
1261
|
* first), so the call waits up to 11 minutes. Start copies of it with {@link Sandbox.restore}
|
|
1262
|
-
* (about 0.4 s each). The source keeps running.
|
|
1262
|
+
* (about 0.4 s each). The source keeps running. Firecracker snapshots ignore `poolSize`.
|
|
1263
1263
|
*/
|
|
1264
1264
|
snapshot(name?: string, opts?: SnapshotOpts): Promise<SandboxSnapshot>;
|
|
1265
1265
|
unexpose(port: number): Promise<void>;
|
|
1266
|
-
/** Stream the sandbox's logs. Not available
|
|
1266
|
+
/** Stream the sandbox's logs. Not available yet (`LizardError`, 501). */
|
|
1267
1267
|
logs(opts?: {
|
|
1268
1268
|
tail?: number;
|
|
1269
1269
|
signal?: AbortSignal;
|
|
@@ -1286,7 +1286,7 @@ declare class Sandbox extends SandboxClient {
|
|
|
1286
1286
|
/** Change where a snapshot you took may be restored. */
|
|
1287
1287
|
static setSnapshotScope(snapshotId: string, scope: SnapshotScope, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
|
|
1288
1288
|
static setSnapshotWarmPool(snapshotId: string, poolSize: number, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
|
|
1289
|
-
/** Release idle warm copies
|
|
1289
|
+
/** Release idle warm copies of an older snapshot; retain saved state and existing claimed sandboxes. Firecracker snapshots have no warm copies. */
|
|
1290
1290
|
static pauseSnapshot(snapshotId: string, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
|
|
1291
1291
|
/** Refill the configured warm pool without another capture. */
|
|
1292
1292
|
static resumeSnapshot(snapshotId: string, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
|
|
@@ -1957,7 +1957,7 @@ interface VolumeInfo {
|
|
|
1957
1957
|
status: string;
|
|
1958
1958
|
/** Id of the sandbox the volume is attached to, or `null` when it is free. */
|
|
1959
1959
|
attachedTo?: string | null;
|
|
1960
|
-
/** Creation time: an ISO-8601 string
|
|
1960
|
+
/** Creation time: an ISO-8601 string, or unix milliseconds for an older volume. */
|
|
1961
1961
|
createdAt: string | number;
|
|
1962
1962
|
/**
|
|
1963
1963
|
* Whether `sizeGb` is actually enforced as a hard limit on the volume's node.
|
|
@@ -2026,13 +2026,11 @@ declare class Volume {
|
|
|
2026
2026
|
/**
|
|
2027
2027
|
* Resize a volume, by name or by id, to `sizeGb`.
|
|
2028
2028
|
*
|
|
2029
|
-
* A
|
|
2030
|
-
*
|
|
2031
|
-
*
|
|
2029
|
+
* A volume grows in place and online: a sandbox with the volume attached keeps
|
|
2030
|
+
* running and sees the new size. A smaller size throws `LizardError` (400) with
|
|
2031
|
+
* `code: 'volume_shrink_unsupported'`.
|
|
2032
2032
|
*
|
|
2033
|
-
*
|
|
2034
|
-
* so no data is copied and a mounted sandbox sees the new size immediately. Both
|
|
2035
|
-
* growing and shrinking are allowed, but a shrink must leave at least 10% of the
|
|
2033
|
+
* An older volume can also shrink, but the shrink must leave at least 10% of the
|
|
2036
2034
|
* new size free — otherwise it throws `ConflictError` with
|
|
2037
2035
|
* `code: 'volume_too_full_to_shrink'`.
|
|
2038
2036
|
*
|
|
@@ -2042,7 +2040,7 @@ declare class Volume {
|
|
|
2042
2040
|
* `volume_capacity_unavailable`, and `volume_resize_timeout` (a `TimeoutError`;
|
|
2043
2041
|
* the size is left unchanged).
|
|
2044
2042
|
*
|
|
2045
|
-
* @returns The volume's updated info, including `sizeEnforced` for
|
|
2043
|
+
* @returns The volume's updated info, including `sizeEnforced` for an older volume.
|
|
2046
2044
|
*/
|
|
2047
2045
|
static resize(projectId: string, nameOrId: string, sizeGb: number, opts?: ConnectionOpts): Promise<VolumeInfo>;
|
|
2048
2046
|
getInfo(projectId: string): Promise<VolumeInfo>;
|
package/dist/index.d.ts
CHANGED
|
@@ -714,7 +714,7 @@ declare class Fs {
|
|
|
714
714
|
* }, 1000)
|
|
715
715
|
* ```
|
|
716
716
|
*
|
|
717
|
-
* Not available
|
|
717
|
+
* Not available yet: the call throws `LizardError` (501).
|
|
718
718
|
*/
|
|
719
719
|
watch(path: string, opts?: {
|
|
720
720
|
recursive?: boolean;
|
|
@@ -864,12 +864,12 @@ interface SandboxInfo {
|
|
|
864
864
|
/** Region the sandbox runs in — the volume's region when one is attached. */
|
|
865
865
|
region?: string;
|
|
866
866
|
status?: string;
|
|
867
|
-
/** The sandbox runtime: `'firecracker'` (a microVM),
|
|
867
|
+
/** The sandbox runtime: `'firecracker'` (a microVM), or `null` when unknown. */
|
|
868
868
|
runtime?: 'firecracker' | 'container' | null;
|
|
869
869
|
pauseError?: string | null;
|
|
870
|
-
/** Machine size (`'small' | 'medium' | 'large'`); may be `null` for a sandbox billed by measured usage
|
|
870
|
+
/** Machine size (`'small' | 'medium' | 'large'`); may be `null` for a sandbox billed by measured usage. */
|
|
871
871
|
size?: 'small' | 'medium' | 'large' | null;
|
|
872
|
-
/** Flat hourly price in USD for `size`, billed per second while running; may be `null` when billed by measured usage
|
|
872
|
+
/** Flat hourly price in USD for `size`, billed per second while running; may be `null` when billed by measured usage. */
|
|
873
873
|
pricePerHour?: number | null;
|
|
874
874
|
cpus?: number;
|
|
875
875
|
memoryMb?: number;
|
|
@@ -1011,7 +1011,7 @@ interface SandboxSnapshot {
|
|
|
1011
1011
|
*/
|
|
1012
1012
|
type SnapshotScope = 'user' | 'workspace' | 'project';
|
|
1013
1013
|
interface SnapshotOpts {
|
|
1014
|
-
/** Warm copies to keep ready
|
|
1014
|
+
/** Warm copies to keep ready for an older snapshot. Firecracker snapshots ignore it: they restore from disk. */
|
|
1015
1015
|
poolSize?: number;
|
|
1016
1016
|
/** Where it may be restored. Default `'user'`: any of your projects and workspaces; with a key
|
|
1017
1017
|
* limited to a workspace or project, only what the key covers (a wider scope is narrowed). */
|
|
@@ -1259,11 +1259,11 @@ declare class Sandbox extends SandboxClient {
|
|
|
1259
1259
|
* snapshot. A Firecracker snapshot is `ready` as soon as this returns: about 2 s, up to
|
|
1260
1260
|
* a few minutes for a sandbox that filled most of its memory (its memory is uploaded
|
|
1261
1261
|
* first), so the call waits up to 11 minutes. Start copies of it with {@link Sandbox.restore}
|
|
1262
|
-
* (about 0.4 s each). The source keeps running.
|
|
1262
|
+
* (about 0.4 s each). The source keeps running. Firecracker snapshots ignore `poolSize`.
|
|
1263
1263
|
*/
|
|
1264
1264
|
snapshot(name?: string, opts?: SnapshotOpts): Promise<SandboxSnapshot>;
|
|
1265
1265
|
unexpose(port: number): Promise<void>;
|
|
1266
|
-
/** Stream the sandbox's logs. Not available
|
|
1266
|
+
/** Stream the sandbox's logs. Not available yet (`LizardError`, 501). */
|
|
1267
1267
|
logs(opts?: {
|
|
1268
1268
|
tail?: number;
|
|
1269
1269
|
signal?: AbortSignal;
|
|
@@ -1286,7 +1286,7 @@ declare class Sandbox extends SandboxClient {
|
|
|
1286
1286
|
/** Change where a snapshot you took may be restored. */
|
|
1287
1287
|
static setSnapshotScope(snapshotId: string, scope: SnapshotScope, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
|
|
1288
1288
|
static setSnapshotWarmPool(snapshotId: string, poolSize: number, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
|
|
1289
|
-
/** Release idle warm copies
|
|
1289
|
+
/** Release idle warm copies of an older snapshot; retain saved state and existing claimed sandboxes. Firecracker snapshots have no warm copies. */
|
|
1290
1290
|
static pauseSnapshot(snapshotId: string, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
|
|
1291
1291
|
/** Refill the configured warm pool without another capture. */
|
|
1292
1292
|
static resumeSnapshot(snapshotId: string, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
|
|
@@ -1957,7 +1957,7 @@ interface VolumeInfo {
|
|
|
1957
1957
|
status: string;
|
|
1958
1958
|
/** Id of the sandbox the volume is attached to, or `null` when it is free. */
|
|
1959
1959
|
attachedTo?: string | null;
|
|
1960
|
-
/** Creation time: an ISO-8601 string
|
|
1960
|
+
/** Creation time: an ISO-8601 string, or unix milliseconds for an older volume. */
|
|
1961
1961
|
createdAt: string | number;
|
|
1962
1962
|
/**
|
|
1963
1963
|
* Whether `sizeGb` is actually enforced as a hard limit on the volume's node.
|
|
@@ -2026,13 +2026,11 @@ declare class Volume {
|
|
|
2026
2026
|
/**
|
|
2027
2027
|
* Resize a volume, by name or by id, to `sizeGb`.
|
|
2028
2028
|
*
|
|
2029
|
-
* A
|
|
2030
|
-
*
|
|
2031
|
-
*
|
|
2029
|
+
* A volume grows in place and online: a sandbox with the volume attached keeps
|
|
2030
|
+
* running and sees the new size. A smaller size throws `LizardError` (400) with
|
|
2031
|
+
* `code: 'volume_shrink_unsupported'`.
|
|
2032
2032
|
*
|
|
2033
|
-
*
|
|
2034
|
-
* so no data is copied and a mounted sandbox sees the new size immediately. Both
|
|
2035
|
-
* growing and shrinking are allowed, but a shrink must leave at least 10% of the
|
|
2033
|
+
* An older volume can also shrink, but the shrink must leave at least 10% of the
|
|
2036
2034
|
* new size free — otherwise it throws `ConflictError` with
|
|
2037
2035
|
* `code: 'volume_too_full_to_shrink'`.
|
|
2038
2036
|
*
|
|
@@ -2042,7 +2040,7 @@ declare class Volume {
|
|
|
2042
2040
|
* `volume_capacity_unavailable`, and `volume_resize_timeout` (a `TimeoutError`;
|
|
2043
2041
|
* the size is left unchanged).
|
|
2044
2042
|
*
|
|
2045
|
-
* @returns The volume's updated info, including `sizeEnforced` for
|
|
2043
|
+
* @returns The volume's updated info, including `sizeEnforced` for an older volume.
|
|
2046
2044
|
*/
|
|
2047
2045
|
static resize(projectId: string, nameOrId: string, sizeGb: number, opts?: ConnectionOpts): Promise<VolumeInfo>;
|
|
2048
2046
|
getInfo(projectId: string): Promise<VolumeInfo>;
|
package/dist/index.js
CHANGED
|
@@ -866,7 +866,7 @@ var Fs = class {
|
|
|
866
866
|
* }, 1000)
|
|
867
867
|
* ```
|
|
868
868
|
*
|
|
869
|
-
* Not available
|
|
869
|
+
* Not available yet: the call throws `LizardError` (501).
|
|
870
870
|
*/
|
|
871
871
|
async watch(path, opts) {
|
|
872
872
|
const res = await fetch(`${this.config.apiUrl}/api/sandboxes/${this.sandboxId}/files/watch`, {
|
|
@@ -1331,7 +1331,7 @@ var Sandbox = class extends SandboxClient {
|
|
|
1331
1331
|
* snapshot. A Firecracker snapshot is `ready` as soon as this returns: about 2 s, up to
|
|
1332
1332
|
* a few minutes for a sandbox that filled most of its memory (its memory is uploaded
|
|
1333
1333
|
* first), so the call waits up to 11 minutes. Start copies of it with {@link Sandbox.restore}
|
|
1334
|
-
* (about 0.4 s each). The source keeps running.
|
|
1334
|
+
* (about 0.4 s each). The source keeps running. Firecracker snapshots ignore `poolSize`.
|
|
1335
1335
|
*/
|
|
1336
1336
|
snapshot(name = `Snapshot ${this.sandboxId}`, opts = {}) {
|
|
1337
1337
|
return new PlatformClient(this.resolveOpts()).post(`/api/sandboxes/${this.sandboxId}/snapshot`, { name, poolSize: opts.poolSize ?? 5, scope: opts.scope }, SNAPSHOT_TIMEOUT_MS);
|
|
@@ -1339,7 +1339,7 @@ var Sandbox = class extends SandboxClient {
|
|
|
1339
1339
|
unexpose(port) {
|
|
1340
1340
|
return new PlatformClient(this.resolveOpts()).delete(`/api/sandboxes/${this.sandboxId}/expose/${port}`);
|
|
1341
1341
|
}
|
|
1342
|
-
/** Stream the sandbox's logs. Not available
|
|
1342
|
+
/** Stream the sandbox's logs. Not available yet (`LizardError`, 501). */
|
|
1343
1343
|
logs(opts = {}) {
|
|
1344
1344
|
return new PlatformClient(this.resolveOpts()).events(query(`/api/sandboxes/${this.sandboxId}/logs`, { tail: opts.tail }), { signal: opts.signal });
|
|
1345
1345
|
}
|
|
@@ -1378,7 +1378,7 @@ var Sandbox = class extends SandboxClient {
|
|
|
1378
1378
|
static setSnapshotWarmPool(snapshotId, poolSize, opts) {
|
|
1379
1379
|
return new PlatformClient(opts ?? {}).patch(`/api/sandbox-snapshots/${encodeURIComponent(snapshotId)}`, { poolSize });
|
|
1380
1380
|
}
|
|
1381
|
-
/** Release idle warm copies
|
|
1381
|
+
/** Release idle warm copies of an older snapshot; retain saved state and existing claimed sandboxes. Firecracker snapshots have no warm copies. */
|
|
1382
1382
|
static pauseSnapshot(snapshotId, opts) {
|
|
1383
1383
|
return new PlatformClient(opts ?? {}).post(`/api/sandbox-snapshots/${encodeURIComponent(snapshotId)}/pause`, {});
|
|
1384
1384
|
}
|
|
@@ -1999,13 +1999,11 @@ var Volume = class _Volume {
|
|
|
1999
1999
|
/**
|
|
2000
2000
|
* Resize a volume, by name or by id, to `sizeGb`.
|
|
2001
2001
|
*
|
|
2002
|
-
* A
|
|
2003
|
-
*
|
|
2004
|
-
*
|
|
2002
|
+
* A volume grows in place and online: a sandbox with the volume attached keeps
|
|
2003
|
+
* running and sees the new size. A smaller size throws `LizardError` (400) with
|
|
2004
|
+
* `code: 'volume_shrink_unsupported'`.
|
|
2005
2005
|
*
|
|
2006
|
-
*
|
|
2007
|
-
* so no data is copied and a mounted sandbox sees the new size immediately. Both
|
|
2008
|
-
* growing and shrinking are allowed, but a shrink must leave at least 10% of the
|
|
2006
|
+
* An older volume can also shrink, but the shrink must leave at least 10% of the
|
|
2009
2007
|
* new size free — otherwise it throws `ConflictError` with
|
|
2010
2008
|
* `code: 'volume_too_full_to_shrink'`.
|
|
2011
2009
|
*
|
|
@@ -2015,7 +2013,7 @@ var Volume = class _Volume {
|
|
|
2015
2013
|
* `volume_capacity_unavailable`, and `volume_resize_timeout` (a `TimeoutError`;
|
|
2016
2014
|
* the size is left unchanged).
|
|
2017
2015
|
*
|
|
2018
|
-
* @returns The volume's updated info, including `sizeEnforced` for
|
|
2016
|
+
* @returns The volume's updated info, including `sizeEnforced` for an older volume.
|
|
2019
2017
|
*/
|
|
2020
2018
|
static async resize(projectId, nameOrId, sizeGb, opts) {
|
|
2021
2019
|
const config = new ConnectionConfig(opts);
|
package/dist/index.mjs
CHANGED
|
@@ -812,7 +812,7 @@ var Fs = class {
|
|
|
812
812
|
* }, 1000)
|
|
813
813
|
* ```
|
|
814
814
|
*
|
|
815
|
-
* Not available
|
|
815
|
+
* Not available yet: the call throws `LizardError` (501).
|
|
816
816
|
*/
|
|
817
817
|
async watch(path, opts) {
|
|
818
818
|
const res = await fetch(`${this.config.apiUrl}/api/sandboxes/${this.sandboxId}/files/watch`, {
|
|
@@ -1277,7 +1277,7 @@ var Sandbox = class extends SandboxClient {
|
|
|
1277
1277
|
* snapshot. A Firecracker snapshot is `ready` as soon as this returns: about 2 s, up to
|
|
1278
1278
|
* a few minutes for a sandbox that filled most of its memory (its memory is uploaded
|
|
1279
1279
|
* first), so the call waits up to 11 minutes. Start copies of it with {@link Sandbox.restore}
|
|
1280
|
-
* (about 0.4 s each). The source keeps running.
|
|
1280
|
+
* (about 0.4 s each). The source keeps running. Firecracker snapshots ignore `poolSize`.
|
|
1281
1281
|
*/
|
|
1282
1282
|
snapshot(name = `Snapshot ${this.sandboxId}`, opts = {}) {
|
|
1283
1283
|
return new PlatformClient(this.resolveOpts()).post(`/api/sandboxes/${this.sandboxId}/snapshot`, { name, poolSize: opts.poolSize ?? 5, scope: opts.scope }, SNAPSHOT_TIMEOUT_MS);
|
|
@@ -1285,7 +1285,7 @@ var Sandbox = class extends SandboxClient {
|
|
|
1285
1285
|
unexpose(port) {
|
|
1286
1286
|
return new PlatformClient(this.resolveOpts()).delete(`/api/sandboxes/${this.sandboxId}/expose/${port}`);
|
|
1287
1287
|
}
|
|
1288
|
-
/** Stream the sandbox's logs. Not available
|
|
1288
|
+
/** Stream the sandbox's logs. Not available yet (`LizardError`, 501). */
|
|
1289
1289
|
logs(opts = {}) {
|
|
1290
1290
|
return new PlatformClient(this.resolveOpts()).events(query(`/api/sandboxes/${this.sandboxId}/logs`, { tail: opts.tail }), { signal: opts.signal });
|
|
1291
1291
|
}
|
|
@@ -1324,7 +1324,7 @@ var Sandbox = class extends SandboxClient {
|
|
|
1324
1324
|
static setSnapshotWarmPool(snapshotId, poolSize, opts) {
|
|
1325
1325
|
return new PlatformClient(opts ?? {}).patch(`/api/sandbox-snapshots/${encodeURIComponent(snapshotId)}`, { poolSize });
|
|
1326
1326
|
}
|
|
1327
|
-
/** Release idle warm copies
|
|
1327
|
+
/** Release idle warm copies of an older snapshot; retain saved state and existing claimed sandboxes. Firecracker snapshots have no warm copies. */
|
|
1328
1328
|
static pauseSnapshot(snapshotId, opts) {
|
|
1329
1329
|
return new PlatformClient(opts ?? {}).post(`/api/sandbox-snapshots/${encodeURIComponent(snapshotId)}/pause`, {});
|
|
1330
1330
|
}
|
|
@@ -1945,13 +1945,11 @@ var Volume = class _Volume {
|
|
|
1945
1945
|
/**
|
|
1946
1946
|
* Resize a volume, by name or by id, to `sizeGb`.
|
|
1947
1947
|
*
|
|
1948
|
-
* A
|
|
1949
|
-
*
|
|
1950
|
-
*
|
|
1948
|
+
* A volume grows in place and online: a sandbox with the volume attached keeps
|
|
1949
|
+
* running and sees the new size. A smaller size throws `LizardError` (400) with
|
|
1950
|
+
* `code: 'volume_shrink_unsupported'`.
|
|
1951
1951
|
*
|
|
1952
|
-
*
|
|
1953
|
-
* so no data is copied and a mounted sandbox sees the new size immediately. Both
|
|
1954
|
-
* growing and shrinking are allowed, but a shrink must leave at least 10% of the
|
|
1952
|
+
* An older volume can also shrink, but the shrink must leave at least 10% of the
|
|
1955
1953
|
* new size free — otherwise it throws `ConflictError` with
|
|
1956
1954
|
* `code: 'volume_too_full_to_shrink'`.
|
|
1957
1955
|
*
|
|
@@ -1961,7 +1959,7 @@ var Volume = class _Volume {
|
|
|
1961
1959
|
* `volume_capacity_unavailable`, and `volume_resize_timeout` (a `TimeoutError`;
|
|
1962
1960
|
* the size is left unchanged).
|
|
1963
1961
|
*
|
|
1964
|
-
* @returns The volume's updated info, including `sizeEnforced` for
|
|
1962
|
+
* @returns The volume's updated info, including `sizeEnforced` for an older volume.
|
|
1965
1963
|
*/
|
|
1966
1964
|
static async resize(projectId, nameOrId, sizeGb, opts) {
|
|
1967
1965
|
const config = new ConnectionConfig(opts);
|
package/package.json
CHANGED