WorkspaceClient
class WorkspaceClient(lightctl.client.base_client.BaseClient)
| Helper functions for acessing the workspaces in a cluster
|
| Example:
| wc = WorkspaceClient()
| workspaces = wc.list_workspaces()
| new_workspace = wc.create_workspace("test_workspace")
|
| Methods defined here:
|
| create_workspace(self, name: str)
| Create a new workspace
|
| Args:
| name (str): Name of workspace
|
| Returns:
| dict: The workspace created
|
| Example:
| wc = workspace_client()
| new_workspace = wc.create_workspace("new_workspace")
| print(f'Name of workspace is {new_workspace["name"]}, uuid of workspace is {new_workspace["uuid"]}')
|
| delete_workspace(self, workspace_id: str) -> Dict
| Delete a workspace
|
| Args:
| workspace_id (str): UUID of workspace
|
| Returns:
| str: The uuid of the workspace deleted
|
| list_workspaces(self) -> List[Dict]
| Get all workspaces
|
| Returns:
| list: a list of workspaces
|
| workspaces_url(self) -> str
| Returns:
| str: The workspaces endpoint, used for getting existing workspaces, creating new workspaces, and deleting workspaces
|
Updated 11 months ago