Desk workspaces
Create and delete the workspaces of a desk, which the desk starts, stops, and deletes.
Last updated
On this page
Overview
The workspaces of a desk are managed workspaces. They are created in the desk and stay in it for their whole life. Each one reaches the environment of the desk. A desk can hold any number of workspaces, for example one for each component of an application.
| Item | Managed workspace |
|---|---|
| Created | In the desk. |
| Started and stopped | With the desk. A managed workspace cannot be started or stopped on its own. |
| Deleted | In the desk, or when the desk is deleted. |
desk field | The name of the desk. |
A standalone workspace, created outside a desk, cannot join a desk later. See Workspace types.
Capsules
A capsule created with desk is a managed workspace that ends with the desk. See Capsules.
Quota
Each workspace counts against the owner's quota as a standalone workspace does. See Quota and limits.
Tasks
Create a workspace in a desk
Reason for the task
Give the desk a workspace that reaches the services of its environment.
Job set-up
- Access: you.
- References:
POST /v1/desks/{id}/workspaces.
Procedure
Create the workspace. Called from a desk,
workspacewithactionset tocreatecreates it in that desk.kl.desks.create_workspace(desk="dev", workspace="backend")await kl.desks.createWorkspace({ desk: "dev", workspace: "backend" });if _, err := kl.Desks.CreateWorkspace(kloudlite.CreateDeskWorkspace{Desk: "dev", CreateWorkspace: kloudlite.CreateWorkspace{Workspace: "backend", QuotaGb: 20}}); err != nil { log.Fatal(err)}kl.desks.create_workspace(desk: "dev", workspace: "backend")kl.desks().createWorkspace("dev", new Kloudlite.CreateWorkspace().workspace("backend"));kode desks create-workspace backend --desk dev
Close-out
- Make sure that the desk's workspaces include the new workspace.
Delete a workspace in a desk
Reason for the task
Remove a workspace that the desk no longer needs.
Job set-up
- Access: you.
- References:
DELETE /v1/desks/{id}/workspaces/{workspace}.
The workspace is deleted, and its intercepts in this desk are released. Its snapshots remain.
Procedure
Delete the workspace.
kl.desks.delete_workspace(desk="dev", workspace="backend")await kl.desks.deleteWorkspace({ desk: "dev", workspace: "backend" });if err := kl.Desks.DeleteWorkspace(kloudlite.DeleteDeskWorkspace{Desk: "dev", Workspace: "backend"}); err != nil { log.Fatal(err)}kl.desks.delete_workspace(desk: "dev", workspace: "backend")kl.desks().deleteWorkspace("dev", "backend");kode desks delete-workspace backend --desk dev
Close-out
- Make sure that the desk's workspaces no longer include the workspace.
Troubleshooting
| Symptom | Possible cause | Corrective action |
|---|---|---|
409 with workspace backend belongs to desk dev; start the desk: kode desks start --desk dev | The workspace belongs to a desk, and the call starts it directly. | Start the desk instead: run kode desks start --desk dev. |
409 with backend is managed by desk dev; use the desk | The call starts, stops, or deletes a workspace that belongs to a desk. | Control it through its desk: start or stop the desk, or delete the workspace in the desk. Run kode desks start. |
404 with not found | The desk or workspace does not exist, or is not yours. | Check the name. Use team/name for a team. |