From 9201ec4af8581aea89244e40ea8ecc3a3493c117 Mon Sep 17 00:00:00 2001 From: fubuloubu <3859395+fubuloubu@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:29:17 -0400 Subject: [PATCH 1/2] refactor: platform renamed `/organizations` to `/workspaces` --- silverback/cluster/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/silverback/cluster/client.py b/silverback/cluster/client.py index fd06ae8e..f4ad5f53 100644 --- a/silverback/cluster/client.py +++ b/silverback/cluster/client.py @@ -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 @@ -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, @@ -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 @@ -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) From 89450ceff42e5a516cd1ef1767359eddccbf1a46 Mon Sep 17 00:00:00 2001 From: fubuloubu <3859395+fubuloubu@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:29:41 -0400 Subject: [PATCH 2/2] refactor: add `.created` to `WorkspaceInfo` --- silverback/cluster/types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/silverback/cluster/types.py b/silverback/cluster/types.py index 428cd371..755b7bdb 100644 --- a/silverback/cluster/types.py +++ b/silverback/cluster/types.py @@ -12,6 +12,7 @@ class WorkspaceInfo(BaseModel): owner_id: uuid.UUID name: str slug: str + created: datetime class ClusterConfiguration(BaseModel):