X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fserver%2Fservice.py;h=298043e0b59057abffe1c043a62a925e64bd3240;hb=refs%2Fchanges%2F03%2F10803%2F1;hp=60cb3ecfe505cb919abf4b1511e6e0f1c47f1e4f;hpb=8c43ba0ce4a3910a350e3e74fe24770f04918f1e;p=osm%2FMON.git diff --git a/osm_mon/server/service.py b/osm_mon/server/service.py index 60cb3ec..298043e 100755 --- a/osm_mon/server/service.py +++ b/osm_mon/server/service.py @@ -30,22 +30,28 @@ log = logging.getLogger(__name__) class ServerService: - def __init__(self, config: Config): self.common_db = CommonDbClient(config) - def create_alarm(self, - name: str, - threshold: float, - operation: str, - severity: str, - statistic: str, - metric_name: str, - tags: dict) -> Alarm: - alarm = Alarm(name, severity, threshold, operation, statistic, metric_name, tags) + def create_alarm( + self, + name: str, + threshold: float, + operation: str, + severity: str, + statistic: str, + metric_name: str, + tags: dict, + ) -> Alarm: + log.debug("create_alarm") + alarm = Alarm( + name, severity, threshold, operation, statistic, metric_name, tags + ) self.common_db.create_alarm(alarm) + log.info("Alarm %s created", alarm.name) return alarm - def delete_alarm(self, - alarm_uuid: str) -> None: + def delete_alarm(self, alarm_uuid: str) -> None: + log.debug("delete_alarm") self.common_db.delete_alarm(alarm_uuid) + log.info("Alarm %s is deleted", alarm_uuid)