From 8571778ed4ebd1ebacba2334d8b6b19fbcd5a2b9 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 12 Sep 2013 22:31:48 +0900 Subject: Make get, put, post and delete REST methods public The initial intention was for these to only be used internally, and add wrapper methods to be used by clients. Instead, we now make them public, allowing the API to be used as a basic REST client before any wrappers are added. Change-Id: Icfa92125466b9b798ac30fb865d2d15a2892f552 --- pygerrit/rest/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pygerrit/rest/__init__.py b/pygerrit/rest/__init__.py index 8a29147..9cee718 100644 --- a/pygerrit/rest/__init__.py +++ b/pygerrit/rest/__init__.py @@ -123,7 +123,7 @@ class GerritRestAPI(object): if self.url.endswith(GERRIT_AUTH_SUFFIX): self.url = self.url[: - len(GERRIT_AUTH_SUFFIX)] - def _get(self, endpoint, params=None): + def get(self, endpoint, params=None): """ Send HTTP GET to `endpoint`. Return JSON decoded result. @@ -135,7 +135,7 @@ class GerritRestAPI(object): response = self.session.get(self.url + endpoint, **kwargs) return _decode_response(response) - def _put(self, endpoint, params=None, data=None): + def put(self, endpoint, params=None, data=None): """ Send HTTP PUT to `endpoint`. Return JSON decoded result. @@ -149,7 +149,7 @@ class GerritRestAPI(object): response = self.session.put(self.url + endpoint, **kwargs) return _decode_response(response) - def _post(self, endpoint, params=None, data=None): + def post(self, endpoint, params=None, data=None): """ Send HTTP POST to `endpoint`. Return JSON decoded result. @@ -163,7 +163,7 @@ class GerritRestAPI(object): response = self.session.post(self.url + endpoint, **kwargs) return _decode_response(response) - def _delete(self, endpoint): + def delete(self, endpoint): """ Send HTTP DELETE to `endpoint`. Return JSON decoded result. -- cgit v1.2.1