-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rapid7/fix_outage_handling
Fix outage handling
- Loading branch information
Showing
8 changed files
with
305 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 19.10b0 | ||
hooks: | ||
- id: black | ||
types: [python] | ||
language_version: python3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class AffectedComponent: | ||
def __init__(self, code: str, name: str, old_status: str, new_status: str): | ||
self.code = code | ||
self.name = name | ||
self.old_status = old_status | ||
self.new_status = new_status | ||
|
||
@classmethod | ||
def from_json(cls, json_: dict): | ||
return cls(**json_) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,45 @@ | ||
from typing import Optional | ||
|
||
from github_status_checker.models.incident_update import IncidentUpdate | ||
from github_status_checker.models.component import Component | ||
|
||
|
||
class Incident: | ||
|
||
def __init__(self, | ||
created_at: str, | ||
id: str, | ||
impact: str, | ||
incident_updates: [IncidentUpdate], | ||
monitoring_at: Optional[str], | ||
name: str, | ||
page_id: str, | ||
resolved_at: Optional[str], | ||
shortlink: str, | ||
status: str, | ||
updated_at: str): | ||
def __init__( | ||
self, | ||
created_at: str, | ||
id: str, | ||
impact: str, | ||
incident_updates: [IncidentUpdate], | ||
components: [Component], | ||
monitoring_at: Optional[str], | ||
name: str, | ||
page_id: str, | ||
resolved_at: Optional[str], | ||
shortlink: str, | ||
status: str, | ||
started_at: str, | ||
updated_at: str, | ||
): | ||
self.created_at = created_at | ||
self.id = id | ||
self.impact = impact | ||
self.incident_updates = incident_updates | ||
self.components = components | ||
self.monitoring_at = monitoring_at | ||
self.name = name | ||
self.page_id = page_id | ||
self.resolved_at = resolved_at | ||
self.shortlink = shortlink | ||
self.status = status | ||
self.started_at = started_at | ||
self.updated_at = updated_at | ||
|
||
@classmethod | ||
def from_json(cls, json_: dict): | ||
incident = cls(**json_) | ||
incident.incident_updates = \ | ||
[IncidentUpdate.from_json(json_=iu) for iu in json_.get("incident_updates")] | ||
incident.incident_updates = [ | ||
IncidentUpdate.from_json(json_=iu) for iu in json_.get("incident_updates") | ||
] | ||
|
||
return incident |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,23 +5,19 @@ | |
|
||
setup( | ||
name="github_status_checker", | ||
version="1.0.1", | ||
version="1.0.2", | ||
description="Python module/tool for checking the status of GitHub.", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author='Rapid7 Integration Alliance', | ||
author_email='[email protected]', | ||
url='https://github.com/rapid7/github-status-checker', | ||
license='MIT', | ||
author="Rapid7 Integration Alliance", | ||
author_email="[email protected]", | ||
url="https://github.com/rapid7/github-status-checker", | ||
license="MIT", | ||
packages=find_packages(), | ||
install_requires=[ | ||
"requests~=2.0" | ||
], | ||
install_requires=["requests~=2.0"], | ||
include_package_data=True, | ||
entry_points={ | ||
'console_scripts': [ | ||
'github-status=github_status_checker.__main__:main' | ||
] | ||
"console_scripts": ["github-status=github_status_checker.__main__:main"] | ||
}, | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
|
@@ -34,6 +30,6 @@ | |
"Topic :: Software Development :: Build Tools", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Software Development :: Version Control :: Git", | ||
"Topic :: System :: Networking :: Monitoring" | ||
], | ||
"Topic :: System :: Networking :: Monitoring", | ||
], | ||
) |
Oops, something went wrong.