From 52951c87c234bdb882ab4bf9a46544967c1ba27f Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 17 Oct 2013 15:59:48 +0900 Subject: Update the README to mention the REST API Change-Id: I0db09e7c7eb1fd9fd49bd70371b09a9c61326c35 --- README.rst | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'README.rst') diff --git a/README.rst b/README.rst index d825bc4..19cd2d5 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Pygerrit - Client library for interacting with Gerrit Code Review ================================================================= Pygerrit is a Python library to interact with the -`Gerrit Code Review`_ system over ssh. +`Gerrit Code Review`_ system over ssh or via the REST API. Installation ------------ @@ -80,6 +80,23 @@ installation with non-standard events. Refer to the `example`_ script for a more detailed example of how the SSH event stream interface works. +REST API +-------- + +Gerrit offers a feature-rich REST API. This library provides a simple +interface for clients to interact with Gerrit via the REST API. + +.. code-block:: pycon + + >>> from requests.auth import HTTPDigestAuth + >>> from pygerrit.rest import GerritRestAPI + >>> auth = HTTPDigestAuth('username', 'password') + >>> rest = GerritRestAPI(url='http://review.example.net', auth=auth) + >>> changes = rest.get("/changes/?q=owner:self%20status:open") + + +Refer to the `rest_example`_ script for a more detailed example of how the +REST API interface works. Copyright and License --------------------- @@ -93,4 +110,5 @@ license details. .. _`Gerrit Code Review`: https://code.google.com/p/gerrit/ .. _example: https://github.com/sonyxperiadev/pygerrit/blob/master/example.py +.. _rest_example: https://github.com/sonyxperiadev/pygerrit/blob/master/rest_example.py .. _LICENSE: https://github.com/sonyxperiadev/pygerrit/blob/master/LICENSE -- cgit v1.2.1