Handle SNS cloudwatch alarm states with colors

This commit is contained in:
Abel Luck 2022-11-30 16:05:39 +00:00
parent 5ecb68f2e7
commit 08f5b49b16
3 changed files with 21 additions and 11 deletions

View file

@ -1,7 +1,14 @@
import json
from typing import Any, Tuple
from ops_bot.common import urgency_color
from ops_bot.common import COLOR_ALARM, COLOR_UNKNOWN
def urgency_color(urgency: str) -> str:
if urgency == "high":
return COLOR_ALARM
else:
return COLOR_UNKNOWN
def parse_pagerduty_event(payload: Any) -> Tuple[str, str]: