Skip to content

Commit

Permalink
Add support to check if Gitlab is down
Browse files Browse the repository at this point in the history
Add method to check Gitlab's status.

Closes ksdme#5
  • Loading branch information
kx-chen committed Nov 5, 2018
1 parent 96eb2fc commit 9673995
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions org_status/org_hosts/gitlab.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import json

import requests
from IGitt.GitLab.GitLab import GitLabPrivateToken
from IGitt.GitLab.GitLabOrganization import GitLabOrganization

Expand All @@ -18,6 +21,13 @@ def __init__(self, token, group, **kargs):

self._status_provider = self.StatusProvider(self._group)

@classmethod
def get_host_status(cls):
status = requests.get(
'https://api.status.io/1.0/status/5b36dc6502d06804c08349f7')
status = json.loads(status.text)
return status['result']['status_overall']['status'] == 'Operational'

def process_repository(self, repo, branch='master'):
self.print_status(repo.web_url)

Expand Down

0 comments on commit 9673995

Please sign in to comment.