# Path: isserviceup/services/models/statusio.py
# class StatusIOPlugin(Service):
# 
#     status_url = 'https://api.status.io/'
# 
#     @property
#     def statuspage_id(self):
#         raise NotImplemented()
# 
#     def get_status(self):
#         r = requests.get('{}/1.0/status/{}'.format(
#             self.status_url.strip("/"), self.statuspage_id
#         ))
#         try:
#             j = r.json()
#         except ValueError:
#             print(r.content)
#             raise
#         expected_status = {
#             100: Status.ok,
#             200: Status.minor,
#             300: Status.major,
#             400: Status.critical,
#             500: Status.critical,
#             600: Status.maintenance,
#         }
#         try:
#             status_code = j['result']['status_overall']['status_code']
#             if status_code in expected_status:
#                 return expected_status[status_code]
#             raise Exception('unexpected status')
#         except KeyError:
#             print(j)
#             raise


from isserviceup.services.models.statusio import StatusIOPlugin


class StatusIO(StatusIOPlugin):
    name = 'Status.io'
    status_url = 'https://status.status.io/'
    statuspage_id = '51f6f2088643809b7200000d'

# Path: isserviceup/services/models/statusio.py
# class StatusIOPlugin(Service):
# 
#     status_url = 'https://api.status.io/'
# 
#     @property
#     def statuspage_id(self):
#         raise NotImplemented()
# 
#     def get_status(self):
#         r = requests.get('{}/1.0/status/{}'.format(
#             self.status_url.strip("/"), self.statuspage_id
#         ))
#         try:
#             j = r.json()
#         except ValueError:
#             print(r.content)
#             raise
#         expected_status = {
#             100: Status.ok,
#             200: Status.minor,
#             300: Status.major,
#             400: Status.critical,
#             500: Status.critical,
#             600: Status.maintenance,
#         }
#         try:
#             status_code = j['result']['status_overall']['status_code']
#             if status_code in expected_status:
#                 return expected_status[status_code]
#             raise Exception('unexpected status')
#         except KeyError:
#             print(j)
#             raise


# Path: isserviceup/services/statusio.py
from isserviceup.services.models.statusio import StatusIOPlugin



class StatusIO(StatusIOPlugin):
    name = 'Status.io'
    status_url = 'https://status.status.io/'
    statuspage_id = '51f6f2088643809b7200000d'

    icon_url = '/images/icons/statusio.png'