@vercel/sdk
Version:
<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>
172 lines • 10.4 kB
TypeScript
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import { CreateSessionDirectoryRequest, CreateSessionDirectoryResponseBody } from "../models/createsessiondirectoryop.js";
import { CreateSessionSnapshotRequest, CreateSessionSnapshotResponseBody } from "../models/createsessionsnapshotop.js";
import { DeleteDriveRequest, DeleteDriveResponseBody } from "../models/deletedriveop.js";
import { DeleteSandboxRequest, DeleteSandboxResponseBody } from "../models/deletesandboxop.js";
import { DeleteSessionSnapshotRequest, DeleteSessionSnapshotResponseBody } from "../models/deletesessionsnapshotop.js";
import { ExtendSessionTimeoutRequest, ExtendSessionTimeoutResponseBody } from "../models/extendsessiontimeoutop.js";
import { GetNamedSandboxRequest, GetNamedSandboxResponseBody } from "../models/getnamedsandboxop.js";
import { GetOrCreateDriveRequest, GetOrCreateDriveResponse } from "../models/getorcreatedriveop.js";
import { GetSessionCommandRequest, GetSessionCommandResponseBody } from "../models/getsessioncommandop.js";
import { GetSessionRequest, GetSessionResponseBody } from "../models/getsessionop.js";
import { GetSessionSnapshotRequest, GetSessionSnapshotResponseBody } from "../models/getsessionsnapshotop.js";
import { KillSessionCommandRequest, KillSessionCommandResponseBody } from "../models/killsessioncommandop.js";
import { ListDrivesRequest, ListDrivesResponseBody } from "../models/listdrivesop.js";
import { ListSandboxesRequest, ListSandboxesResponseBody } from "../models/listsandboxesop.js";
import { ListSessionCommandsRequest, ListSessionCommandsResponseBody } from "../models/listsessioncommandsop.js";
import { ListSessionSnapshotsRequest, ListSessionSnapshotsResponseBody } from "../models/listsessionsnapshotsop.js";
import { ListSessionsRequest, ListSessionsResponseBody } from "../models/listsessionsop.js";
import { ReadSessionFileRequest } from "../models/readsessionfileop.js";
import { StopSessionRequest, StopSessionResponseBody } from "../models/stopsessionop.js";
import { UpdateSessionNetworkPolicyRequest, UpdateSessionNetworkPolicyResponseBody } from "../models/updatesessionnetworkpolicyop.js";
import { WriteSessionFilesRequest, WriteSessionFilesResponseBody } from "../models/writesessionfilesop.js";
export declare class Sandboxes extends ClientSDK {
/**
* List sandboxes
*
* @remarks
* Retrieves a paginated list of named sandboxes belonging to a specific project. Results can be sorted by creation time or name, and optionally filtered by name prefix.
*/
listSandboxes(request: ListSandboxesRequest, options?: RequestOptions): Promise<ListSandboxesResponseBody>;
/**
* List drives
*
* @remarks
* Retrieves a paginated list of drives belonging to a specific project. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta
*/
listDrives(request: ListDrivesRequest, options?: RequestOptions): Promise<ListDrivesResponseBody>;
/**
* Get or create a drive
*
* @remarks
* Gets an existing drive by project and name, or creates it when it does not exist. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta
*/
getOrCreateDrive(request: GetOrCreateDriveRequest, options?: RequestOptions): Promise<GetOrCreateDriveResponse>;
/**
* Delete a drive
*
* @remarks
* Deletes a drive by project and name. Attached drives cannot be deleted. Stop or replace the session currently using the drive before retrying deletion. Drives are in private beta. Register your interest to get access: https://vercel.com/changelog/drives-for-vercel-sandbox-in-private-beta
*/
deleteDrive(request: DeleteDriveRequest, options?: RequestOptions): Promise<DeleteDriveResponseBody>;
/**
* List snapshots
*
* @remarks
* Retrieves a paginated list of snapshots for a specific project.
*/
listSessionSnapshots(request: ListSessionSnapshotsRequest, options?: RequestOptions): Promise<ListSessionSnapshotsResponseBody>;
/**
* Get a snapshot
*
* @remarks
* Retrieves detailed information about a specific snapshot, including its creation time, size, expiration date, and the source session it was created from.
*/
getSessionSnapshot(request: GetSessionSnapshotRequest, options?: RequestOptions): Promise<GetSessionSnapshotResponseBody>;
/**
* Delete a snapshot
*
* @remarks
* Permanently deletes a snapshot and frees its associated storage. This action cannot be undone. After deletion, the snapshot can no longer be used to create new sessions.
*/
deleteSessionSnapshot(request: DeleteSessionSnapshotRequest, options?: RequestOptions): Promise<DeleteSessionSnapshotResponseBody>;
/**
* List sessions
*
* @remarks
* Retrieves a paginated list of sessions belonging to a specific sandbox. Results are sorted by creation time and paginated using an opaque cursor.
*/
listSessions(request: ListSessionsRequest, options?: RequestOptions): Promise<ListSessionsResponseBody>;
/**
* Get a session
*
* @remarks
* Retrieves detailed information about a specific session, including its current status, resource configuration, and exposed routes.
*/
getSession(request: GetSessionRequest, options?: RequestOptions): Promise<GetSessionResponseBody>;
/**
* Get a named sandbox
*
* @remarks
* Retrieves a named sandbox by name, including its current sandbox and routes. If the sandbox is stopped and resume is true, a new sandbox will be created from the most recent snapshot.
*/
getNamedSandbox(request: GetNamedSandboxRequest, options?: RequestOptions): Promise<GetNamedSandboxResponseBody>;
/**
* Delete a sandbox
*
* @remarks
* Deletes a sandbox by name. If sandboxes are currently running, they will be stopped first. This operation deletes all sandbox entities with the given name and the named sandbox metadata.
*/
deleteSandbox(request: DeleteSandboxRequest, options?: RequestOptions): Promise<DeleteSandboxResponseBody>;
/**
* List commands
*
* @remarks
* Retrieves a list of all commands that have been executed in a session, including their current status, exit codes, and execution times, ordered from the most recent to the oldest.
*/
listSessionCommands(request: ListSessionCommandsRequest, options?: RequestOptions): Promise<ListSessionCommandsResponseBody>;
/**
* Get a command
*
* @remarks
* Retrieves the current status and details of a command executed in a session. Use the `wait` parameter to block until the command finishes execution.
*/
getSessionCommand(request: GetSessionCommandRequest, options?: RequestOptions): Promise<GetSessionCommandResponseBody>;
/**
* Kill a command
*
* @remarks
* Sends a signal to terminate a running command in a session. The signal can be used to gracefully stop (SIGTERM) or forcefully kill (SIGKILL) the process. The command must still be running for this operation to succeed.
*/
killSessionCommand(request: KillSessionCommandRequest, options?: RequestOptions): Promise<KillSessionCommandResponseBody>;
/**
* Stop a session
*
* @remarks
* Stops a running session and releases its allocated resources. All running processes within the session will be terminated. This action cannot be undone. A stopped session cannot be restarted.
*/
stopSession(request: StopSessionRequest, options?: RequestOptions): Promise<StopSessionResponseBody>;
/**
* Extend session timeout
*
* @remarks
* Extends the maximum execution time of a running session. The session must be active and able to accept commands. The total timeout cannot exceed the maximum allowed limit for your account.
*/
extendSessionTimeout(request: ExtendSessionTimeoutRequest, options?: RequestOptions): Promise<ExtendSessionTimeoutResponseBody>;
/**
* Update network policy
*
* @remarks
* Replaces the network access policy of a running session. Use this to control which external hosts the session can communicate with. This is a full replacement. Any previously configured network rules will be overwritten.
*/
updateSessionNetworkPolicy(request: UpdateSessionNetworkPolicyRequest, options?: RequestOptions): Promise<UpdateSessionNetworkPolicyResponseBody>;
/**
* Read a file
*
* @remarks
* Downloads the contents of a file from a session's filesystem. The file content is returned as a binary stream with appropriate Content-Disposition headers for file download.
*/
readSessionFile(request: ReadSessionFileRequest, options?: RequestOptions): Promise<ReadableStream<Uint8Array>>;
/**
* Create a directory
*
* @remarks
* Creates a new directory in a session's filesystem. By default, parent directories are created recursively if they don't exist (similar to `mkdir -p`).
*/
createSessionDirectory(request: CreateSessionDirectoryRequest, options?: RequestOptions): Promise<CreateSessionDirectoryResponseBody>;
/**
* Write files
*
* @remarks
* Uploads and extracts files to a session's filesystem. Files must be uploaded as a gzipped tarball (`.tar.gz`) with the `Content-Type` header set to `application/gzip`. The tarball contents are extracted to the session's working directory, or to a custom directory specified via the `x-cwd` header.
*/
writeSessionFiles(request: WriteSessionFilesRequest, options?: RequestOptions): Promise<WriteSessionFilesResponseBody>;
/**
* Create a snapshot
*
* @remarks
* Creates a point-in-time snapshot of a running session's filesystem. Snapshots can be used to quickly restore a session to a previous state or to create new sessions with pre-configured environments. The session must be running and able to accept commands for a snapshot to be created. The session will be terminated after the snapshot is created.
*/
createSessionSnapshot(request: CreateSessionSnapshotRequest, options?: RequestOptions): Promise<CreateSessionSnapshotResponseBody>;
}
//# sourceMappingURL=sandboxes.d.ts.map