Skip to content

Commit

Permalink
feat(cluster): configuration info is moved to OpenAPI schema
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Feb 5, 2025
1 parent 6d983ab commit 841eb75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
8 changes: 3 additions & 5 deletions silverback/cluster/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
BotHealth,
BotInfo,
BotLogEntry,
ClusterConfiguration,
ClusterHealth,
ClusterInfo,
ClusterState,
RegistryCredentialsInfo,
StreamInfo,
VariableGroupInfo,
Expand Down Expand Up @@ -232,10 +232,8 @@ def version(self) -> str:
return self.openapi_schema["info"]["version"]

@property
def state(self) -> ClusterState:
response = self.get("/")
handle_error_with_response(response)
return ClusterState.model_validate(response.json())
def configuration(self) -> ClusterConfiguration | None:
return self.openapi_schema["info"].get("x-config")

@property
def health(self) -> ClusterHealth:
Expand Down
10 changes: 0 additions & 10 deletions silverback/cluster/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,16 +289,6 @@ class ClusterInfo(BaseModel):
last_updated: datetime # Last time the resource was changed (upgrade, provisioning, etc.)


class ClusterState(BaseModel):
"""
Cluster Build Information and Configuration, direct from cluster control service
"""

version: str = Field(alias="cluster_version") # TODO: Rename in cluster
configuration: ClusterConfiguration | None = None # TODO: Add to cluster
# TODO: Add other useful summary fields for frontend use


class ServiceHealth(BaseModel):
healthy: bool

Expand Down

0 comments on commit 841eb75

Please sign in to comment.