Files
cachet-url-monitor/cachet_url_monitor/status.py
mtakaki 5679bdaa52 83 (#84)
* #83 - Fixing the bug that was preventing the status update

* #83 - Refactoring unit tests for configuration to ensure we catch more cases
2020-02-10 23:51:02 -08:00

34 lines
721 B
Python

#!/usr/bin/env python
"""
This file defines all the different status different values.
These are all constants and are coupled to cachet's API configuration.
"""
from enum import Enum
class ComponentStatus(Enum):
UNKNOWN = 0
OPERATIONAL = 1
PERFORMANCE_ISSUES = 2
PARTIAL_OUTAGE = 3
MAJOR_OUTAGE = 4
INCIDENT_PARTIAL = 'PARTIAL'
INCIDENT_MAJOR = 'MAJOR'
INCIDENT_PERFORMANCE = 'PERFORMANCE'
INCIDENT_MAP = {
INCIDENT_PARTIAL: ComponentStatus.PARTIAL_OUTAGE,
INCIDENT_MAJOR: ComponentStatus.MAJOR_OUTAGE,
INCIDENT_PERFORMANCE: ComponentStatus.PERFORMANCE_ISSUES,
}
class IncidentStatus(Enum):
SCHEDULED = 0
INVESTIGATING = 1
IDENTIFIED = 2
WATCHING = 3
FIXED = 4