Skip to main content

Snapshot

Datalayer Core


Datalayer Core / Snapshot

Class: Snapshot

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:45

Snapshot domain model that wraps API responses with convenient methods. Provides runtime snapshot management with data refresh and lifecycle operations.

Example​

const snapshot = await runtime.createSnapshot('my-checkpoint');
const runtime = await snapshot.restore();

Constructors​

Constructor​

new Snapshot(data, sdk): Snapshot

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:56

Create a Snapshot instance.

Parameters​

data​

RuntimeSnapshot

Snapshot data from API

sdk​

DatalayerClient

SDK instance

Returns​

Snapshot

Properties​

_data​

protected _data: RuntimeSnapshot

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:46

Accessors​

description​

Get Signature​

get description(): string

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:94

Description of the snapshot.

Returns​

string


environment​

Get Signature​

get environment(): string

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:100

Name of the environment used by the runtime.

Returns​

string


name​

Get Signature​

get name(): string

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:88

Name of the snapshot.

Returns​

string


uid​

Get Signature​

get uid(): string

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:82

Unique identifier for the snapshot.

Returns​

string


updatedAt​

Get Signature​

get updatedAt(): Date

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:106

When the snapshot was last updated.

Returns​

Date

Methods​

delete()​

delete(): Promise<void>

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:119

Delete this snapshot permanently. After deletion, subsequent calls to dynamic methods will throw errors.

Returns​

Promise<void>


rawData()​

rawData(): RuntimeSnapshot

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:173

Get the raw snapshot data exactly as received from the API. This preserves the original snake_case naming from the API response.

Returns​

RuntimeSnapshot

Raw snapshot data from API


restore()​

restore(minutesLimit): Promise<Runtime>

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:133

Create a runtime from this snapshot (restore functionality).

Parameters​

minutesLimit​

number

Returns​

Promise<Runtime>

Created Runtime instance


toJSON()​

toJSON(): SnapshotJSON

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:156

Get snapshot data in camelCase format. Returns only the core fields that consumers need. This provides a stable interface regardless of API changes. Note: Returns current cached state - call getStatus() first if you need fresh data.

Returns​

SnapshotJSON

Core snapshot data with camelCase properties


toString()​

toString(): string

Defined in: tech/datalayer/core/src/client/models/Snapshot.ts:179

String representation of the snapshot.

Returns​

string