summaryrefslogtreecommitdiff
path: root/pygerrit/rest
Commit message (Collapse)AuthorAgeFilesLines
* Raise exception if the json content is invalidGeorge Peristerakis2016-02-291-2/+3
| | | | | | | | | If the json loads function raises, the return content is invalid. The function should log the error and raise the exception. Closes #32 Change-Id: I053b0169c8da47f2a4812cc30783f8a4776f9c2b
* Updated add_comment() to support line rangesBenjamin Foster2015-08-191-5/+19
| | | | | | | | | | add_comment() now supports 'ranges' as described by the gerrit API, by using the keyword 'range' instead of 'line', and a dict with the four required keys. Closes #31 Change-Id: Iaa7004e4f94794df8546a153227375e7be4b06bb
* Don't use requests.session()0.2.10David Pursehouse2015-06-291-5/+4
| | | | | | | | | | | Workaround for requests issue 2409 [1] and Gerrit issue 3458 [2] where the Gerrit server returns HTTP 400 on subsequent requests via an existing session. [1] https://github.com/kennethreitz/requests/issues/2409 [2] http://code.google.com/p/gerrit/issues/detail?id=3458 Change-Id: I98428ec59fca7146c5587172b464e2e09b90782c
* Don't set Content-Type on PUT/POST if there is no bodyDavid Pursehouse2015-06-291-4/+6
| | | | | | Fixes #26 Change-Id: Ic4e0ba378fd61ed49a3ca9ea25ef2ccf21532af2
* Add debug log of response contentDavid Pursehouse2015-06-241-1/+2
| | | | Change-Id: If57c2f4443405a546d7aee796c8381c053e1b301
* Fix incorrect docstringDavid Pursehouse2014-12-081-4/+1
| | | | Change-Id: Ic753786a01deef0270e3039c15a0ceabedfe3901
* Restructure docstrings for better html output.David Pursehouse2014-10-302-54/+87
| | | | Change-Id: Ic935e8f85e2ad333677770746c15648ae5bac339
* Add inline review support0.2.8Peter Theckanath2014-09-011-0/+85
| | | | | | Added API to send inline review Change-Id: Ifdcfbaea6ae4d8723d9566eaaf3c5dba5ff35617
* Revert "Remove support for Gerrit over ssh"David Pursehouse2014-05-292-0/+212
| | | | | | | | | | | | | | | | | | | | | The ssh interface is still being used and patches are being contributed [1]. It's easier to revert the removal on master than attempt to keep the support in a separate branch. This reverts commit f0b77968389966cd7bad0cac1fe7f04526eafde1. [1] https://github.com/sonyxperiadev/pygerrit/pull/21 Conflicts: README.rst example.py requirements.txt setup.py unittests.py Change-Id: I9e02208c57cb2022ff39cff6650101ed40c0519d
* Remove support for Gerrit over sshDavid Pursehouse2014-04-282-205/+0
| | | | | | | | | From now only the REST API is supported. This makes installation of the package a bit lighter as we no longer depend on paramiko and pycrypto Change-Id: Ieda773d596fd43047c05895f3304690ddf709094
* Accept kwargs for request functionsChristopher Zee2014-03-171-18/+8
| | | | | | | kwargs now made passable to request functions so that lower-level python-requests interface can be fully utilized. Change-Id: I38eff49314a3966546e0b272af2e58ed276269d9
* Simplify REST API error handlingDavid Pursehouse2013-11-072-30/+16
| | | | | | | Remove GerritRestAPIError. Raise requests.HTTPError when a request results in an HTTP Error. Raise ValueError in other places. Change-Id: I25188f64161a6ca8159e7777e3f288f775463c25
* Allow client to disable SSL certificate verificationDavid Pursehouse2013-09-241-2/+6
| | | | Change-Id: I124054f2ba667f41ba5e916e3832e6a341b4ae96
* Refactor the authentication handlingDavid Pursehouse2013-09-182-35/+74
| | | | | | | | | | Instead of trying to abstract the authentication away from the client, allow the client to provide the authentication handler. Implement simple handlers for HTTP basic and digest authentication with credentials from netrc. Change-Id: Icd6c7d359ecbd441308bc6f67fd19c7f55ebcb8f
* Add method to build url from endpointDavid Pursehouse2013-09-131-4/+16
| | | | | | | Add a convenience method to construct the url to be passed to the server, from the base url and the given endpoint. Change-Id: I1725a371aa8a82c132039a9614bf20223af591f3
* Make get, put, post and delete REST methods publicDavid Pursehouse2013-09-121-4/+4
| | | | | | | | | | 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
* Fix authentication setupDavid Pursehouse2013-08-271-5/+5
| | | | Change-Id: I8a7557818cd3c207035ef627e6912ee945c083c6
* Add handling of HTTP error status codes in responsesDavid Pursehouse2013-08-271-0/+24
| | | | Change-Id: I9cdb6b7ff2bf6ea20925c5b2eac68ef454a6ea23
* Add support for HTTP digest authenticationDavid Pursehouse2013-08-261-1/+41
| | | | | | | If the username and password are given, pass them to the request with HTTP digest authentication. Change-Id: If15628262a4ef6b370c3d0794dbc9ecd3a0be624
* Initial implementation of Gerrit REST API interfaceDavid Pursehouse2013-08-261-0/+110
This initial version implements wrappers for GET, PUT, POST and DELETE requests. Authentication is not implemented. All requests are sent anonymously. Handling of error responses is not implemented. This change introduces a dependency on python-requests. Change-Id: I579f9f02be8afbb4e720daf97ca873d77cd54a77