class WorkspaceClient
Bases: BaseClient
Client to manage workspaces.
Humans: First, log in via the CLI: sumatra login
Bots: Sorry, no bots allowed
Functions
__init__()
Create connection object.
apply_template(workspace, template)
Apply a template to a workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace |
str
|
Slug of the workspace to apply the template to. |
required |
template |
str
|
Name of the template to apply. |
required |
create_workspace(workspace=None, nickname=None, app=None)
Create a new workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace |
Optional[str]
|
Desired slug of the new workspace. Must consist only of letters, numbers, '-', and '_'. If this slug is taken, a random one will be generated instead, which may be changed later. |
None
|
nickname |
Optional[str]
|
A human readable name for the new workspace. If not provided, the workspace slug will be used. |
None
|
app |
Optional[str]
|
Name of the application ('optimize' or None) |
None
|
Returns:
Type | Description |
---|---|
str
|
slug of newly created workspace |
delete_workspace(workspace)
Deletes the workspace and all associated data. You must be an owner of the workspace to delete it.
Warning: This action is not reversible!
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace |
str
|
Slug of the workspace to delete. |
required |
get_workspaces()
Return workspaces, along with metadata, that the current user has access to
Returns:
Type | Description |
---|---|
list[dict[str, str]]
|
list of dicts containing workspace metadata |