gerrit.utils package
Submodules
gerrit.utils.common module
gerrit.utils.entity module
gerrit.utils.exceptions module
Module for custom exceptions.
Where possible we try to throw exceptions with non-generic, meaningful names.
- exception gerrit.utils.exceptions.AuthError[source]
Bases:
ClientError403 Forbidden is returned if the operation is not allowed because the calling user does not have sufficient permissions.
- exception gerrit.utils.exceptions.ClientError[source]
Bases:
GerritAPIException
- exception gerrit.utils.exceptions.ConflictError[source]
Bases:
ClientError409 Conflict is returned if the request cannot be completed because the current state of the resource doesn’t allow the operation.
- exception gerrit.utils.exceptions.GerritAPIException[source]
Bases:
ExceptionBase class for all errors
- exception gerrit.utils.exceptions.NotAllowedError[source]
Bases:
ClientError405 Method Not Allowed is returned if the resource exists but doesn’t support the operation.
- exception gerrit.utils.exceptions.NotFoundError[source]
Bases:
ClientErrorResource cannot be found
- exception gerrit.utils.exceptions.ServerError[source]
Bases:
GerritAPIException
- exception gerrit.utils.exceptions.UnauthorizedError[source]
Bases:
GerritAPIException401 Unauthorized
- exception gerrit.utils.exceptions.UnknownBranch[source]
Bases:
KeyError,NotFoundErrorGerrit does not recognize the branch requested.
- exception gerrit.utils.exceptions.UnknownFile[source]
Bases:
KeyError,NotFoundErrorGerrit does not recognize the revision file requested.
- exception gerrit.utils.exceptions.UnknownTag[source]
Bases:
KeyError,NotFoundErrorGerrit does not recognize the tag requested.
- exception gerrit.utils.exceptions.ValidationError[source]
Bases:
ClientError400 Bad Request is returned if the request is not understood by the server due to malformed syntax. E.g. 400 Bad Request is returned if JSON input is expected but the ‘Content-Type’ of the request
is not ‘application/json’ or the request body doesn’t contain valid JSON.
400 Bad Request is also returned if required input fields are not set or if options are set which cannot be used together.
gerrit.utils.models module
- class gerrit.utils.models.BaseModel(json=None, **kwargs)[source]
Bases:
object- classmethod parse_dict(data, **kwargs)[source]
Parse a dict of JSON objects into a result set of model instances.
gerrit.utils.requester module
- class gerrit.utils.requester.Requester(**kwargs)[source]
Bases:
objectA class which carries out HTTP requests. You can replace this class with one of your own implementation if you require some other way to access Gerrit. This default class can handle simple authentication only.
- AUTH_COOKIE = None
- VALID_STATUS_CODES = [200]
- delete(url, headers=None, allow_redirects=True, **kwargs)[source]
- Parameters:
url
headers
allow_redirects
kwargs
- Returns:
- get(url, params=None, headers=None, allow_redirects=True, stream=False, **kwargs)[source]
- Parameters:
url
params
headers
allow_redirects
stream
kwargs
- Returns:
- get_request_dict(params=None, data=None, json=None, headers=None, **kwargs)[source]
- Parameters:
params
data
json
headers
kwargs
- Returns: