diff --git a/silverback/cluster/client.py b/silverback/cluster/client.py index f8e8d8e0..4c8f5c09 100644 --- a/silverback/cluster/client.py +++ b/silverback/cluster/client.py @@ -100,17 +100,16 @@ def __hash__(self) -> int: def update( self, name: str | None = None, variables: dict[str, str | None] | None = None ) -> "VariableGroup": + if name is not None: # Update metadata response = self.cluster.put(f"/vars/{self.id}", json=dict(name=name)) handle_error_with_response(response) - if variables is not None: # Create a new revision response = self.cluster.post(f"/vars/{self.id}", json=dict(variables=variables)) handle_error_with_response(response) return VariableGroup.model_validate(response.json()) - return self def get_revision(self, revision: int | Literal["latest"] = "latest") -> VariableGroupInfo: @@ -123,7 +122,7 @@ def get_revision(self, revision: int | Literal["latest"] = "latest") -> Variable return VariableGroupInfo.model_validate(response.json()) def remove(self): - response = self.cluster.delete(f"/vars/{self.id}") + response = self.cluster.delete(f"/vars/{self.name}") handle_error_with_response(response)