gerrit package

Subpackages

Module contents

class gerrit.GerritClient(base_url, username=None, password=None, use_netrc=False, ssl_verify=True, cert=None, timeout=60, max_retries=None, auth_suffix='/a')[source]

Bases: object

Python wrapper for the Gerrit V3.x REST API.

property accounts

Account related REST APIs

Returns:

property changes

Change related REST APIs

Returns:

property config

Config related REST APIs

Returns:

static decode_response(response)[source]

Strip off Gerrit’s magic prefix and decode a response. :returns:

Decoded JSON content as a dict, or raw text if content could not be decoded as JSON.

Raises:

requests.HTTPError if the response contains an HTTP error status code.

default_headers = {'Content-Type': 'application/json; charset=UTF-8'}
delete(endpoint)[source]

Send HTTP DELETE to the endpoint.

Parameters:

endpoint – The endpoint to send to.

Returns:

get(endpoint, **kwargs)[source]

Send HTTP GET to the endpoint.

Parameters:

endpoint – The endpoint to send to.

Returns:

get_endpoint_url(endpoint)[source]

Return the complete url including host and port for a given endpoint. :param endpoint: service endpoint as str :return: complete url (including host and port) as str

get_password_from_netrc_file()[source]

Providing the password form .netrc file for getting Host name. :return: The related password from .netrc file as a string.

property gitiles

gitiles plugin rest api

property groups

Group related REST APIs

Returns:

property plugins

Plugin related REST APIs

Returns:

post(endpoint, **kwargs)[source]

Send HTTP POST to the endpoint.

Parameters:

endpoint – The endpoint to send to.

Returns:

property projects

Project related REST APIs :return:

put(endpoint, **kwargs)[source]

Send HTTP PUT to the endpoint.

Parameters:

endpoint – The endpoint to send to.

Returns:

property server

get the information about the Gerrit server configuration.

Returns:

classmethod strip_trailing_slash(url)[source]

remove url’s trailing slash :param url: url :return:

property version

get the version of the Gerrit server.

Returns: