aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhalcy <halcy@ARARAGI-KUN>2022-11-19 00:53:25 +0200
committerhalcy <halcy@ARARAGI-KUN>2022-11-19 00:53:25 +0200
commit6a630202db718c5ed2924ad3a3863d7eee391b88 (patch)
treebac9613a000d93a6346abc89da91ef475c80cc23 /mastodon
parentbfdde7781b3a1bbf320f153edad5ffecab7ca27b (diff)
downloadmastodon.py-6a630202db718c5ed2924ad3a3863d7eee391b88.tar.gz
add server rules API
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 4462253..14cf174 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -774,8 +774,7 @@ class Mastodon:
774 """ 774 """
775 Basic health check. Returns True if healthy, False if not. 775 Basic health check. Returns True if healthy, False if not.
776 """ 776 """
777 status = self.__api_request( 777 status = self.__api_request('GET', '/health', parse=False).decode("utf-8")
778 'GET', '/health', parse=False).decode("utf-8")
779 return status in ["OK", "success"] 778 return status in ["OK", "success"]
780 779
781 @api_version("3.0.0", "3.0.0", "3.0.0") 780 @api_version("3.0.0", "3.0.0", "3.0.0")
@@ -807,6 +806,15 @@ class Mastodon:
807 parse = urlparse(schema_url) 806 parse = urlparse(schema_url)
808 return self.__api_request('GET', parse.path + parse.params + parse.query + parse.fragment) 807 return self.__api_request('GET', parse.path + parse.params + parse.query + parse.fragment)
809 808
809 @api_version("3.4.0", "3.4.0", __DICT_VERSION_INSTANCE)
810 def instance_rules(self):
811 """
812 Retrieve instance rules.
813
814 Returns a list of `id` + `text` dicts, same as the `rules` field in the `instance dicts`_.
815 """
816 return self.__api_request('GET', '/api/v1/instance/rules')
817
810 ### 818 ###
811 # Reading data: Timelines 819 # Reading data: Timelines
812 ## 820 ##
Powered by cgit v1.2.3 (git 2.41.0)