From c324de2d449aaac2c2bfcba4ffc4ca7d4d0d3bb8 Mon Sep 17 00:00:00 2001 From: lucasheld Date: Sat, 2 Jul 2022 20:40:14 +0200 Subject: [PATCH] implement status page and database --- uptimekumaapi/api.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/uptimekumaapi/api.py b/uptimekumaapi/api.py index 8f66fdf..38be0bb 100644 --- a/uptimekumaapi/api.py +++ b/uptimekumaapi/api.py @@ -365,9 +365,27 @@ class UptimeKumaApi(object): # status page - def get_statuspages(self): + def get_status_pages(self): return self.get_event_data("statusPageList") + def post_incident(self, slug, incident): + return self.sio.call('postIncident', (slug, incident)) + + def unpin_incident(self, slug): + return self.sio.call('unpinIncident', slug) + + def get_status_page(self, slug): + return self.sio.call('getStatusPage', slug) + + def save_status_page(self, slug, config, img_data_url, public_group_list): + return self.sio.call('saveStatusPage', (slug, config, img_data_url, public_group_list)) + + def add_status_page(self, title, slug): + return self.sio.call('addStatusPage', (title, slug)) + + def delete_status_page(self, slug): + return self.sio.call('deleteStatusPage', slug) + # heartbeat def get_heartbeats(self): @@ -481,3 +499,11 @@ class UptimeKumaApi(object): def setup(self, username, password): return self.sio.call("setup", (username, password)) + + # database + + def get_database_size(self): + return self.sio.call('getDatabaseSize') + + def shrink_database(self): + return self.sio.call('shrinkDatabase')