diff options
author | Lorenz Diener <[email protected]> | 2019-10-12 20:25:55 +0200 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2019-10-12 20:25:55 +0200 |
commit | e60a3f1892bb685fcbe6ebbc9ed10602c9549028 (patch) | |
tree | 8e450dd68c8da7ffd5c30c19392c8b8588b05c37 /mastodon | |
parent | ef8e3cec6af3e22fbbb7e6b2006f490e4167d1aa (diff) | |
download | mastodon.py-e60a3f1892bb685fcbe6ebbc9ed10602c9549028.tar.gz |
Add and document health API. Fixes #202
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 7 |
1 files changed, 7 insertions, 0 deletions
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: | |||
654 | """ | 654 | """ |
655 | return self.__api_request('GET', '/api/v1/instance/peers') | 655 | return self.__api_request('GET', '/api/v1/instance/peers') |
656 | 656 | ||
657 | @api_version("3.0.0", "3.0.0", "3.0.0") | ||
658 | def instance_health(self): | ||
659 | """ | ||
660 | Basic health check. Returns True if healthy, False if not. | ||
661 | """ | ||
662 | return self.__api_request('GET', '/health', parse=False).decode("utf-8") == "success" | ||
663 | |||
657 | ### | 664 | ### |
658 | # Reading data: Timelines | 665 | # Reading data: Timelines |
659 | ## | 666 | ## |