TypeScript Runtimes
Runtime Collection
Section titled “Runtime Collection”| Interface | Purpose |
|---|---|
runta.runtimes.create(name, options) | Create a runtime. |
runta.runtimes.list(status?) | List runtimes, optionally filtered by status. |
runta.runtimes.get(idOrName) | Fetch one runtime by UUID or display name. |
const runtime = await runta.runtimes.create("worker", { vcpus: 1, memoryMiB: 1024, idleSuspendAfterSecs: 300,});const running = await runta.runtimes.list("running");
const byId = await runta.runtimes.get("runtime-id");const byName = await runta.runtimes.get("runtime-display-name");Runtime Methods
Section titled “Runtime Methods”| Method | Purpose |
|---|---|
runtime.start() | Boot a stopped runtime. |
runtime.stop() | Stop a runtime. |
runtime.delete() | Delete a runtime. |
runtime.restore(checkpointId, options) | Restore a new runtime from a checkpoint. |
await runtime.start();await runtime.stop();await runtime.delete();Restore from a checkpoint:
const restored = await runtime.restore(checkpoint.id, { name: "worker-restored",});