Interface for making requests to the Session API.

interface ISessionAPIClient {
    serverSettings: ServerConnection.ISettings;
    getModel(id: string): Promise<Session.IModel>;
    listRunning(): Promise<Session.IModel[]>;
    shutdown(id: string): Promise<void>;
    startNew(options: ISessionOptions): Promise<Session.IModel>;
    update(
        model: Pick<Session.IModel, "id"> & DeepPartial<
            Omit<Session.IModel, "id">,
        >,
    ): Promise<Session.IModel>;
}

Implemented by

Properties

serverSettings: ServerConnection.ISettings

The server settings used by the client.

Methods

  • Shut down a session by id.

    Parameters

    • id: string

      The id of the session to shut down.

    Returns Promise<void>

    A promise that resolves when the session is shut down.

    Uses the Jupyter Server API and validates the response model.

    The promise is fulfilled on a valid response and rejected otherwise.