X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fdomain%2Falarm_repo.py;h=1ef92a443e28bea1a54c1bd5a136625f21b724fe;hb=95eeb8bc924e4d6bbf1d579593e39cc80182f063;hp=d712f1c6a03b9a6ce91492dfa54da4b940988f9a;hpb=f7ef52a5b4ead0472b1b5828471b28c88d2a0aea;p=pti%2Fo2.git diff --git a/o2ims/domain/alarm_repo.py b/o2ims/domain/alarm_repo.py index d712f1c..1ef92a4 100644 --- a/o2ims/domain/alarm_repo.py +++ b/o2ims/domain/alarm_repo.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 Wind River Systems, Inc. +# Copyright (C) 2022-2024 Wind River Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,12 +31,12 @@ class AlarmEventRecordRepository(abc.ABC): self.seen.add(alarm_event_record) return alarm_event_record - def list(self, **kwargs) -> List[obj.AlarmEventRecord]: - return self._list(**kwargs)[1] + def list(self, *args) -> List[obj.AlarmEventRecord]: + return self._list(*args)[1] - def list_with_count(self, **kwargs) -> \ + def list_with_count(self, *args, **kwargs) -> \ Tuple[int, List[obj.AlarmEventRecord]]: - return self._list(**kwargs) + return self._list(*args, **kwargs) def update(self, alarm_event_record: obj.AlarmEventRecord): self._update(alarm_event_record) @@ -96,6 +96,10 @@ class AlarmDefinitionRepository(abc.ABC): def _get(self, definition_id) -> obj.AlarmDefinition: raise NotImplementedError + @abc.abstractmethod + def _list(self, **kwargs) -> List[obj.AlarmDefinition]: + raise NotImplementedError + @abc.abstractmethod def _update(self, definition: obj.AlarmDefinition): raise NotImplementedError @@ -137,7 +141,7 @@ class AlarmDictionaryRepository(abc.ABC): raise NotImplementedError @abc.abstractmethod - def _update(self, dictionary: obj.AlarmDictionary): + def _list(self, **kwargs) -> List[obj.AlarmDictionary]: raise NotImplementedError @abc.abstractmethod @@ -159,12 +163,12 @@ class AlarmSubscriptionRepository(abc.ABC): self.seen.add(subscription) return subscription - def list(self, **kwargs) -> List[obj.AlarmSubscription]: - return self._list(**kwargs)[1] + def list(self, *args) -> List[obj.AlarmSubscription]: + return self._list(*args)[1] - def list_with_count(self, **kwargs) -> \ + def list_with_count(self, *args, **kwargs) -> \ Tuple[int, List[obj.AlarmSubscription]]: - return self._list(**kwargs) + return self._list(*args, **kwargs) def update(self, subscription: obj.AlarmSubscription): self._update(subscription) @@ -224,6 +228,10 @@ class AlarmProbableCauseRepository(abc.ABC): def _get(self, probable_cause_id) -> obj.ProbableCause: raise NotImplementedError + @abc.abstractmethod + def _list(self, **kwargs) -> List[obj.ProbableCause]: + raise NotImplementedError + @abc.abstractmethod def _update(self, probable_cause: obj.ProbableCause): raise NotImplementedError