diff options
| author | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-09-12 22:31:48 +0900 |
|---|---|---|
| committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-09-12 22:31:48 +0900 |
| commit | 8571778ed4ebd1ebacba2334d8b6b19fbcd5a2b9 (patch) | |
| tree | fa41c7ebe83ad6b907b883f798d2c23f247be3c0 /pygerrit | |
| parent | c87e4bc55eb701b4ceb9fa77d29bc2ba61bb4063 (diff) | |
| download | pygerrit-8571778ed4ebd1ebacba2334d8b6b19fbcd5a2b9.tar.gz | |
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
Diffstat (limited to 'pygerrit')
| -rw-r--r-- | pygerrit/rest/__init__.py | 8 |
1 files 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. |
