Skip to content

Commit

Permalink
refactor: platform updated organizations to workspaces (#102)
Browse files Browse the repository at this point in the history
* refactor: platform renamed `/organizations` to `/workspaces`

* refactor: add `.created` to `WorkspaceInfo`
  • Loading branch information
fubuloubu authored Aug 5, 2024
1 parent 5298e88 commit cb73778
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions silverback/cluster/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def get_cluster_client(self, cluster_name: str) -> ClusterClient:
@property
@cache
def clusters(self) -> dict[str, ClusterInfo]:
response = self.client.get("/clusters", params=dict(org=str(self.id)))
response = self.client.get("/clusters", params=dict(workspace=str(self.id)))
handle_error_with_response(response)
clusters = response.json()
# TODO: Support paging
Expand All @@ -290,7 +290,7 @@ def create_cluster(
) -> ClusterInfo:
response = self.client.post(
"/clusters/",
params=dict(org=str(self.id)),
params=dict(workspace=str(self.id)),
json=dict(
name=cluster_name,
slug=cluster_slug,
Expand Down Expand Up @@ -331,7 +331,7 @@ def get_cluster_client(self, workspace_name: str, cluster_name: str) -> ClusterC
@property
@cache
def workspaces(self) -> dict[str, Workspace]:
response = self.get("/organizations")
response = self.get("/workspaces")
handle_error_with_response(response)
workspaces = response.json()
# TODO: Support paging
Expand All @@ -345,7 +345,7 @@ def create_workspace(
workspace_name: str = "",
) -> Workspace:
response = self.post(
"/organizations",
"/workspaces",
json=dict(slug=workspace_slug, name=workspace_name),
)
handle_error_with_response(response)
Expand Down
1 change: 1 addition & 0 deletions silverback/cluster/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class WorkspaceInfo(BaseModel):
owner_id: uuid.UUID
name: str
slug: str
created: datetime


class ClusterConfiguration(BaseModel):
Expand Down

0 comments on commit cb73778

Please sign in to comment.