mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-08 05:31:58 +00:00
* #10 - Creating auxiliary client class to generate configuration class based on cachet's component list. * Updating the python version in codacy to reduce false positives * Moving some of the cachet operations to the client class to clean up the configuration class and making better constants * Refactoring status to have proper classes and adding more tests. Refactoring the requests tests to use requests-mock. * Removing unused imports from test_scheduler * Adding more tests and the ability to run the client from command line * Updating README and client arg parsing * Fixing broken unit tests
33 lines
705 B
Python
33 lines
705 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):
|
|
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
|