@datalayer/core
Version:
**Datalayer Core**
103 lines (102 loc) • 2.4 kB
TypeScript
import { IRuntimeOptions } from '..';
import type { IRuntimeSnapshot, IDatalayerEnvironment, IRuntimePod } from '../../models';
/**
* Get available Environments.
*/
export declare function getEnvironments(): Promise<IDatalayerEnvironment[]>;
/**
* Create a Runtime.
*/
export declare function createRuntime(options: IRuntimeOptions): Promise<IRuntimePod>;
/**
* Get the Runtimes.
*/
export declare function getRuntimes(): Promise<IRuntimePod[]>;
/**
* Delete a Runtime
*/
export declare function deleteRuntime(options: {
/**
* Runtime ID
*/
id: string;
/**
* Deletion reason
*/
reason?: string;
}): Promise<void>;
/**
* Snapshot a Runtime.
*/
export declare function snapshotRuntime(options: {
/**
* Runtime ID.
*/
id: string;
/**
* Snapshot name.
*/
name?: string;
/**
* Snapshot description.
*/
description?: string;
/**
* Whether to stop the kernel after the snapshot completion or not.
*/
stop?: boolean;
}): Promise<IRuntimeSnapshot>;
/**
* Get Runtime Snapshots.
*/
export declare function getRuntimeSnapshots(): Promise<IRuntimeSnapshot[]>;
/**
* Load a Runtime Snapshot within a kernel.
*/
export declare function loadRuntimeSnapshot(options: {
/**
* Runtime ID
*/
id: string;
/**
* Snapshot UID
*/
from: string;
}): Promise<void>;
/**
* Returns the Runtime Snapshot download URL.
*
* @param id Snapshot UID to download
* @returns The download URL
*/
export declare function createRuntimeSnapshotDownloadURL(id: string): string;
/**
* Export a Runtime Snapshot.
*
* @param id Runtime snapshot UID to download
*/
export declare function exportRuntimeSnapshot(id: string): void;
/**
* Delete a Runtime Snapshot.
*/
export declare function deleteRuntimeSnapshot(id: string): Promise<void>;
/**
* Update Runtime Snapshot metadata.
*/
export declare function updateRuntimeSnapshot(id: string, metadata: {
name?: string;
description?: string;
}): Promise<void>;
/**
* Upload a Runtime Snapshot.
*
* Note: The promise will be rejected if the runtime state is empty.
*/
export declare function uploadRuntimeSnapshot(options: {
file: File | Blob;
metadata: {
filename: string;
[key: string]: string;
};
onProgress?: (bytesUploaded: number, bytesTotal: number) => void;
}): Promise<void>;