From e60a3f1892bb685fcbe6ebbc9ed10602c9549028 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Sat, 12 Oct 2019 20:25:55 +0200 Subject: Add and document health API. Fixes #202 --- mastodon/Mastodon.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mastodon') diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 308c428..f0063e5 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -654,6 +654,13 @@ class Mastodon: """ return self.__api_request('GET', '/api/v1/instance/peers') + @api_version("3.0.0", "3.0.0", "3.0.0") + def instance_health(self): + """ + Basic health check. Returns True if healthy, False if not. + """ + return self.__api_request('GET', '/health', parse=False).decode("utf-8") == "success" + ### # Reading data: Timelines ## -- cgit v1.2.3