Skip to content
DocsAll docs
Console

Session workspaces

Create and delete the workspaces of a session, which the session starts, stops and deletes.

Last updated

On this page

Description and operation

General

The workspaces of a session are managed workspaces. They are created in the session and stay in it for their whole life. Each one reaches the environment of the session. A session can hold any number of workspaces, for example one for each component of an application.

ItemManaged workspace
CreatedIn the session.
Started and stoppedWith the session. A managed workspace cannot be started or stopped on its own.
DeletedIn the session, or when the session ends.
session fieldThe name of the session.

A standalone workspace, created outside a session, cannot join a session later. See Workspace types.

Sandboxes

A sandbox created with session is a managed workspace that ends with the session. See Sandboxes.

Quota

Each workspace counts against the owner's quota as a standalone workspace does. See Quota and limits.

Tasks

Create a workspace in a session

Reason for the task: Give the session a workspace that reaches the services of its environment.

Job set-up

Procedure

  1. Create the workspace. Called from a session, workspace_create creates it in that session.

    Python
    kl.sessions.create_workspace(session="dev", workspace="backend", quota_gb=20)
    TypeScript
    await kl.sessions.createWorkspace({ session: "dev", workspace: "backend", quotaGb: 20 });
    Go
    if _, err := kl.Sessions.CreateWorkspace(kloudlite.CreateSessionWorkspace{Session: "dev", CreateWorkspace: kloudlite.CreateWorkspace{Workspace: "backend", QuotaGb: 20}}); err != nil {    log.Fatal(err)}
    Ruby
    kl.sessions.create_workspace(session: "dev", workspace: "backend", quota_gb: 20)
    Java
    kl.sessions().createWorkspace("dev", new Kloudlite.CreateWorkspace().workspace("backend").quotaGb(20));
    CLI
    kloudlite sessions create-workspace backend --session dev --quota-gb 20

Close-out

  1. Make sure that the session's workspaces include the new workspace.

Delete a workspace in a session

Reason for the task: Remove a workspace that the session no longer needs.

Job set-up

CAUTION

The workspace is deleted, and its intercepts in this session are released. Its snapshots remain.

Procedure

  1. Delete the workspace.

    Python
    kl.sessions.delete_workspace(session="dev", workspace="backend")
    TypeScript
    await kl.sessions.deleteWorkspace({ session: "dev", workspace: "backend" });
    Go
    if err := kl.Sessions.DeleteWorkspace(kloudlite.DeleteSessionWorkspace{Session: "dev", Workspace: "backend"}); err != nil {    log.Fatal(err)}
    Ruby
    kl.sessions.delete_workspace(session: "dev", workspace: "backend")
    Java
    kl.sessions().deleteWorkspace("dev", "backend");
    CLI
    kloudlite sessions delete-workspace backend --session dev

Close-out

  1. Make sure that the session's workspaces no longer include the workspace.

Troubleshooting

SymptomPossible causeCorrective action
409 with backend is managed by session dev; use the sessionThe call starts, stops or deletes a workspace that belongs to a session.Control it through its session: stop the session, or delete the workspace in the session.
404 with not foundThe session or workspace does not exist, or is not yours.Check the name. Use team/name for a team.