X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fmodels.py;fp=osm_mon%2Fcore%2Fmodels.py;h=48fe8c4db6552145e8cd8212e151579736daf981;hb=f9973edafa925e60ad840684b700356005f1cf51;hp=8fe3b6b5741d5fb7d729a52f0881b7f747048fca;hpb=e5e83ccda4ae62947b3302f7704c433f94a322fd;p=osm%2FMON.git diff --git a/osm_mon/core/models.py b/osm_mon/core/models.py index 8fe3b6b..48fe8c4 100644 --- a/osm_mon/core/models.py +++ b/osm_mon/core/models.py @@ -32,7 +32,9 @@ class Alarm: operation: str = None, statistic: str = None, metric: str = None, + action: str = None, tags: dict = {}, + alarm_status: str = "ok", ): self.uuid = str(uuid.uuid4()) self.name = name @@ -41,7 +43,9 @@ class Alarm: self.operation = operation self.statistic = statistic self.metric = metric + self.action = action self.tags = tags + self.alarm_status = alarm_status def to_dict(self) -> dict: alarm = { @@ -53,6 +57,7 @@ class Alarm: "metric": self.metric, "tags": self.tags, "operation": self.operation, + "alarm_status": self.alarm_status, } return alarm @@ -67,4 +72,5 @@ class Alarm: alarm.metric = data.get("metric") alarm.tags = data.get("tags") alarm.operation = data.get("operation") + alarm.alarm_status = data.get("alarm_status") return alarm