Skip to content
Snippets Groups Projects
Commit 212263cf authored by Morten Brekkevold's avatar Morten Brekkevold
Browse files

Set default incident severity level

parent 4d24dbe8
Branches
Tags
No related merge requests found
......@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Set a default incident severity level of 4 on all created incidents.
- Look up customer name from `org_id` using Mist API, and use this value for
the `kunde` tag in Argus incidents.
......@@ -18,6 +18,8 @@ TYPE_PAIRS = [("AP_DISCONNECTED", "AP_CONNECTED")]
ALLOWED_TYPES = [type_ for pair in TYPE_PAIRS for type_ in pair]
RESOLVE_MAP = {resolving: opening for opening, resolving in TYPE_PAIRS}
DEFAULT_ARGUS_LEVEL = 4 # As chosen by the CNaaS team
def translate_to_argus(payload: dict):
client = Client(
......@@ -42,6 +44,7 @@ def filter_actionable_events(payload: dict):
def open_incident(event: dict, client: Client):
incident = Incident(
description=describe_event(event),
level=DEFAULT_ARGUS_LEVEL,
tags=get_tags_from(event),
start_time=datetime.fromtimestamp(event.get("timestamp", time.time())),
end_time=INFINITY,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment