Workspaces
Manage Strongly workspaces.
Access it as client.workspaces on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.
Quick start
from strongly import Strongly
client = Strongly()
# List (auto-paginates as you iterate) # filters: search, status, project_id
for workspace in client.workspaces.list():
print(workspace.id)
# Create
created = client.workspaces.create(
name="...",
description="...",
environment_type="...",
)
print(created.id)
# Read it back
fetched = client.workspaces.retrieve(created.id)
# Delete (returns None; raises on failure)
client.workspaces.delete(created.id)
Methods
Core
list
list(*, search: Optional[str] = None, status: Optional[str] = None, project_id: Optional[str] = None, limit: Optional[int] = None) -> SyncPaginator[Workspace]
List workspaces with pagination and filters.
create
create(*, name: str, description: str, environment_type: str, image: Optional[str] = None, resources: Optional[Mapping[str, Any]] = None, project_id: Optional[str] = None, capacity_type: Optional[str] = None, use_spot_instances: Optional[bool] = None) -> Workspace
Create a workspace.
Args:
name: Workspace name.
description: Workspace description.
environment_type: Environment type for the workspace.
image: Optional container image override.
resources: Optional resource request/limit map.
project_id: Create the workspace inside this project.
capacity_type: "spot" to request spot instances.
use_spot_instances: Whether to use spot instances.
retrieve
retrieve(workspace_id: str) -> Workspace
Retrieve a single workspace by id.
update
update(workspace_id: str, *, name: Optional[str] = None, description: Optional[str] = None, image: Optional[str] = None, resources: Optional[Mapping[str, Any]] = None, environment_type: Optional[str] = None) -> Workspace
Update a workspace and return the updated record.
delete
delete(workspace_id: str) -> None
Delete a workspace. Raises on failure; returns nothing.
Lifecycle & actions
start
start(workspace_id: str) -> Dict[str, Any]
Start a workspace.
stop
stop(workspace_id: str) -> Dict[str, Any]
Stop a workspace.
restart
restart(workspace_id: str) -> Dict[str, Any]
Restart a workspace.
Other
logs
logs(workspace_id: str, *, type: Optional[str] = None) -> WorkspaceLogs
Get a workspace's logs.
metrics
metrics(workspace_id: str) -> WorkspaceMetrics
Get a workspace's resource metrics.
status
status(workspace_id: str) -> WorkspaceStatus
Get a workspace's status.
sync
sync(workspace_id: str) -> Dict[str, Any]
Trigger a sync of the workspace's contents.