StatusPage.io
Incident
Incident Class
This class represents the details about a Statuspage.io incident
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The incident name. |
description |
str
|
The incident description. |
Source code in pi_monitor/statuspage_io.py
9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
IncidentResult
IncidentResult Class
This class represents information about incidents created or resolved as part of a status change
Attributes:
Name | Type | Description |
---|---|---|
incident_created |
bool
|
True if an incident was created, false otherwise. |
incident_resolved |
bool
|
True if an incident was created, false otherwise. |
Source code in pi_monitor/statuspage_io.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
StatusPageOperator
StatusResult Class
This class represents information about actions taken during a check and update.
Attributes:
Name | Type | Description |
---|---|---|
config |
StatusPageSettings
|
An instance of StatusPageSettings which contains settings for Statuspage.io communication |
client |
StatusPageClient
|
An instance of StatusPageClient, built from the configuration values provided. |
Source code in pi_monitor/statuspage_io.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
|
__init__(status_page_config)
Constructor
Initialize the instance using the provided StatusPageSettings.
Source code in pi_monitor/statuspage_io.py
83 84 85 86 87 88 89 90 91 92 93 94 |
|
_process_incident_on_status_change(component_id, new_component_status, incident_details)
Create or Close incidents based on the incoming component status
For now, if it's operational, close open incidents, and if it's not operational , create a new ticket if one isn't already open for this component. Future state will involve more detail around outage and maintenance
Source code in pi_monitor/statuspage_io.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
is_configured()
Validate configuration data
Returns:
Type | Description |
---|---|
bool
|
True if the operator has a valid configuration, False otherwise. |
Source code in pi_monitor/statuspage_io.py
96 97 98 99 100 101 102 |
|
update_component_status(component_id, op_level, incident_details={})
Update Component Status
Using the provided OpLevel, determine the component's statuspage.io status.
If the incoming op_level
is Operational and the
statuspage.io status is not, the component's status will be changed to
operational
, and any open incidents for that component will be resolved.
If the incoming op_level
is any other value and the statuspage.io status is
operational, the component's status will be changed to major_outage
and an
incident will be created using the provided incident_details
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component_id
|
str
|
The component ID to check |
required |
op_level
|
OpLevel
|
The current OpLevel for the provided component |
required |
incident_details
|
Incident
|
An instance of Incident which has the details of the incident to be created, if necessary. |
{}
|
Returns:
Type | Description |
---|---|
StatusResult
|
An instance of StatusResult |
Source code in pi_monitor/statuspage_io.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
StatusResult
StatusResult Class
This class represents information about actions taken during a check and update.
Attributes:
Name | Type | Description |
---|---|---|
status_changed |
bool
|
True if the status has changed from the previous check, false otherwise. |
incident_result |
IncidentResult
|
An instance of IncidentResult. |
Source code in pi_monitor/statuspage_io.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|