diff --git a/simvue/api/objects/alert/base.py b/simvue/api/objects/alert/base.py index 1990a00c..5c3953cb 100644 --- a/simvue/api/objects/alert/base.py +++ b/simvue/api/objects/alert/base.py @@ -31,7 +31,12 @@ def __init__(self, identifier: str | None = None, **kwargs) -> None: """Retrieve an alert from the Simvue server by identifier""" self._label = "alert" super().__init__(identifier=identifier, **kwargs) - self._local_only_args = ["frequency", "pattern", "aggregation"] + self._local_only_args = [ + "frequency", + "pattern", + "aggregation", + "status", + ] def compare(self, other: "AlertBase") -> bool: """Compare this alert to another""" diff --git a/simvue/api/objects/base.py b/simvue/api/objects/base.py index 679b473f..4c0bdc86 100644 --- a/simvue/api/objects/base.py +++ b/simvue/api/objects/base.py @@ -201,7 +201,7 @@ def __init__( # For simvue object initialisation, unlike the server there is no nested # arguments, however this means that there are extra keys during post which # need removing, this attribute handles that and should be set in subclasses. - self._local_only_args: list[str] = [] + self._local_only_args: list[str] = ["created"] self._identifier: str | None = ( identifier if identifier is not None else f"offline_{uuid.uuid1()}" @@ -636,13 +636,13 @@ def _post_batch( def _post_single( self, *, is_json: bool = True, data: list | dict | None = None, **kwargs ) -> dict[str, typing.Any] | list[dict[str, typing.Any]]: - if not is_json: - kwargs = msgpack.packb(data or kwargs, use_bin_type=True) - # Remove any extra keys for key in self._local_only_args: _ = (data or kwargs).pop(key, None) + if not is_json: + kwargs = msgpack.packb(data or kwargs, use_bin_type=True) + _response = sv_post( url=f"{self._base_url}", headers=self._headers | {"Content-Type": "application/msgpack"}, diff --git a/simvue/api/objects/storage/s3.py b/simvue/api/objects/storage/s3.py index 87ff3c3c..c4c522cc 100644 --- a/simvue/api/objects/storage/s3.py +++ b/simvue/api/objects/storage/s3.py @@ -27,6 +27,13 @@ def __init__(self, identifier: str | None = None, **kwargs) -> None: """Initialise an S3Storage instance attaching a configuration""" self.config = Config(self) super().__init__(identifier, **kwargs) + self._local_only_args: list[str] = [ + "endpoint_url", + "region_name", + "access_key_id", + "secret_access_key", + "bucket", + ] @classmethod @pydantic.validate_call