gitlab package¶
Submodules¶
gitlab.base module¶
class gitlab.base.RESTManager(gl, parent=None)¶Bases: object
Base class for CRUD operations on objects.
Derivated class must define _path and _obj_cls.
_path: Base URL path on which requests will be sent (e.g. ‘/projects’) _obj_cls: The class of objects that will be created
property parent_attrs¶ property path¶ class gitlab.base.RESTObject(manager, attrs)¶Bases: object
Represents an object built from server data.
It holds the attributes know from the server, and the updated attributes in another. This allows smart updates, if the object allows it.
You can redefine _id_attr in child classes to specify which attribute must be used as uniq ID. None means that the object can be updated without ID in the url.
property attributes¶ get_id()¶Returns the id of the resource.
class gitlab.base.RESTObjectList(manager, obj_cls, _list)¶Bases: object
Generator object representing a list of RESTObject’s.
This generator uses the Gitlab pagination system to fetch new data when required.
Note: you should not instanciate such objects, they are returned by calls to RESTManager.list()
Parametersmanager – Manager to attach to the created objects
obj_cls – Type of objects to create from the json data
_list – A GitlabList object
The current page number.
next()¶ property next_page¶The next page number.
If None, the current page is the last.
property per_page¶The number of items per page.
property prev_page¶The next page number.
If None, the current page is the last.
property total¶The total number of items.
property total_pages¶The total number of pages.
gitlab.cli module¶
gitlab.cli.cls_to_what(cls)¶ gitlab.cli.die(msg, e=None)¶ gitlab.cli.main()¶ gitlab.cli.register_custom_action(cls_names, mandatory=(), optional=())¶ gitlab.cli.what_to_cls(what)¶gitlab.config module¶
exception gitlab.config.ConfigError¶Bases: Exception
exception gitlab.config.GitlabConfigMissingError¶Bases: gitlab.config.ConfigError
class gitlab.config.GitlabConfigParser(gitlab_id=None, config_files=None)¶Bases: object
exception gitlab.config.GitlabDataError¶Bases: gitlab.config.ConfigError
exception gitlab.config.GitlabIDError¶Bases: gitlab.config.ConfigError
gitlab.const module¶
gitlab.exceptions module¶
exception gitlab.exceptions.GitlabAttachFileError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabAuthenticationError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabError
exception gitlab.exceptions.GitlabBlockError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabBuildCancelError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabCancelError
exception gitlab.exceptions.GitlabBuildEraseError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabRetryError
exception gitlab.exceptions.GitlabBuildPlayError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabRetryError
exception gitlab.exceptions.GitlabBuildRetryError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabRetryError
exception gitlab.exceptions.GitlabCancelError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabCherryPickError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabConnectionError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabError
exception gitlab.exceptions.GitlabCreateError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabDeleteError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabError(error_message='', response_code=None, response_body=None)¶Bases: Exception
exception gitlab.exceptions.GitlabGetError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabHousekeepingError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabHttpError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabError
exception gitlab.exceptions.GitlabJobCancelError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabCancelError
exception gitlab.exceptions.GitlabJobEraseError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabRetryError
exception gitlab.exceptions.GitlabJobPlayError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabRetryError
exception gitlab.exceptions.GitlabJobRetryError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabRetryError
exception gitlab.exceptions.GitlabLicenseError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabListError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabMRApprovalError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabMRClosedError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabMRForbiddenError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabMROnBuildSuccessError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabMRRebaseError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabMarkdownError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabOperationError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabError
exception gitlab.exceptions.GitlabOwnershipError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabParsingError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabError
exception gitlab.exceptions.GitlabPipelineCancelError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabCancelError
exception gitlab.exceptions.GitlabPipelineRetryError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabRetryError
exception gitlab.exceptions.GitlabProjectDeployKeyError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabProtectError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabRenderError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabRepairError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabRetryError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabSearchError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabSetError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabStopError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabSubscribeError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabTimeTrackingError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabTodoError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabTransferProjectError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabUnblockError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabUnsubscribeError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabUpdateError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabUploadError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.GitlabVerifyError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabOperationError
exception gitlab.exceptions.RedirectError(error_message='', response_code=None, response_body=None)¶Bases: gitlab.exceptions.GitlabError
gitlab.exceptions.on_http_error(error)¶Manage GitlabHttpError exceptions.
This decorator function can be used to catch GitlabHttpError exceptions raise specialized exceptions instead.
Parameterserror (Exception) – The exception type to raise – must inherit from GitlabError
gitlab.mixins module¶
class gitlab.mixins.AccessRequestMixin¶Bases: object
approve(access_level=30, **kwargs)¶Approve an access request.
Parametersaccess_level (int) – The access level for the user
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server fails to perform the request
Bases: object
render(link_url, image_url, **kwargs)¶Preview link_url and image_url after interpolation.
Parameterslink_url (str) – URL of the badge link
image_url (str) – URL of the badge image
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabRenderError – If the rendering failed
The rendering properties
Return typedict
class gitlab.mixins.CRUDMixin¶Bases: gitlab.mixins.GetMixin, gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin
class gitlab.mixins.CreateMixin¶Bases: object
create(data, **kwargs)¶Create a new object.
Parametersdata (dict) – parameters to send to the server to create the resource
**kwargs – Extra options to send to the server (e.g. sudo)
a new instance of the managed object class built with
the data sent by the server
Return type RaisesGitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
Return the required and optional arguments.
Returns2 items: list of required arguments and list of optional
arguments for creation (in that order)
Return typetuple
class gitlab.mixins.DeleteMixin¶Bases: object
delete(id, **kwargs)¶Delete an object on the server.
Parametersid – ID of the object to delete
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
Bases: object
get(id, lazy=False, **kwargs)¶Retrieve a single object.
Parametersid (int or str) – ID of the object to retrieve
lazy (bool) – If True, don’t request the server, but create a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.
**kwargs – Extra options to send to the server (e.g. sudo)
The generated RESTObject.
Return typeobject
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
Bases: object
get(id=None, **kwargs)¶Retrieve a single object.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
ReturnsThe generated RESTObject
Return typeobject
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
Bases: object
list(**kwargs)¶Retrieve a list of objects.
Parametersall (bool) – If True, return all the items, without pagination
per_page (int) – Number of items to retrieve per request
page (int) – ID of the page to return (starts with page 1)
as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list
**kwargs – Extra options to send to the server (e.g. sudo)
The list of objects, or a generator if as_list is False
Return typelist
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server cannot perform the request
Bases: gitlab.mixins.GetMixin, gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin
class gitlab.mixins.ObjectDeleteMixin¶Bases: object
Mixin for RESTObject’s that can be deleted.
delete(**kwargs)¶Delete the object from the server.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
Bases: object
participants(**kwargs)¶List the participants.
Parametersall (bool) – If True, return all the items, without pagination
per_page (int) – Number of items to retrieve per request
page (int) – ID of the page to return (starts with page 1)
as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
The list of participants
Return type class gitlab.mixins.RefreshMixin¶Bases: object
refresh(**kwargs)¶Refresh a single object from server.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
Returns None (updates the object)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
Bases: gitlab.mixins.ListMixin, gitlab.mixins.GetMixin
class gitlab.mixins.SaveMixin¶Bases: object
Mixin for RESTObject’s that can be updated.
save(**kwargs)¶Save the changes made to the object to the server.
The object is updated to match what the server returns.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
Raise:GitlabAuthenticationError: If authentication is not correct GitlabUpdateError: If the server cannot perform the request
class gitlab.mixins.SetMixin¶Bases: object
set(key, value, **kwargs)¶Create or update the object.
Parameterskey (str) – The key of the object to create/update
value (str) – The value to set for the object
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabSetError – If an error occured
The created/updated attribute
Return typeobj
class gitlab.mixins.SubscribableMixin¶Bases: object
subscribe(**kwargs)¶Subscribe to the object notifications.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabSubscribeError – If the subscription cannot be done
Unsubscribe from the object notifications.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabUnsubscribeError – If the unsubscription cannot be done
Bases: object
add_spent_time(duration, **kwargs)¶Add time spent working on the object.
Parametersduration (str) – Duration in human format (e.g. 3h30)
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabTimeTrackingError – If the time tracking update cannot be done
Resets the time spent working on the object.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabTimeTrackingError – If the time tracking update cannot be done
Resets estimated time for the object to 0 seconds.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabTimeTrackingError – If the time tracking update cannot be done
Set an estimated time of work for the object.
Parametersduration (str) – Duration in human format (e.g. 3h30)
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabTimeTrackingError – If the time tracking update cannot be done
Get time stats for the object.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabTimeTrackingError – If the time tracking update cannot be done
Bases: object
todo(**kwargs)¶Create a todo associated to the object.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabTodoError – If the todo cannot be set
Bases: object
get_update_attrs()¶Return the required and optional arguments.
Returns2 items: list of required arguments and list of optional
arguments for update (in that order)
Return typetuple
update(id=None, new_data={}, **kwargs)¶Update an object on the server.
Parametersid – ID of the object to update (can be None if not required)
new_data – the update data for the object
**kwargs – Extra options to send to the server (e.g. sudo)
The new object data (not a RESTObject)
Return typedict
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server cannot perform the request
Bases: object
user_agent_detail(**kwargs)¶Get the user agent detail.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
gitlab.utils module¶
gitlab.utils.clean_str_id(id)¶ gitlab.utils.copy_dict(dest, src)¶ gitlab.utils.response_content(response, streamed, action, chunk_size)¶ gitlab.utils.sanitized_url(url)¶Module contents¶
Wrapper for the GitLab API.
class gitlab.Gitlab(url, private_token=None, oauth_token=None, email=None, password=None, ssl_verify=True, http_username=None, http_password=None, timeout=None, api_version='4', session=None, per_page=None)¶Bases: object
Represents a GitLab server connection.
Parametersurl (str) – The URL of the GitLab server.
private_token (str) – The user private token
oauth_token (str) – An oauth token
email (str) – The user email or login.
password (str) – The user password (associated with email).
ssl_verify (bool|str) – Whether SSL certificates should be validated. If the value is a string, it is the path to a CA file used for certificate validation.
timeout (float) – Timeout to use for requests to the GitLab server.
http_username (str) – Username for HTTP authentication
http_password (str) – Password for HTTP authentication
api_version (str) – Gitlab API version to use (support for 4 only)
The computed API base URL.
property api_version¶The API version used (4 only).
auth()¶Performs an authentication.
Uses either the private token, or the email/password pair.
The user attribute will hold a gitlab.objects.CurrentUser object on success.
email = None¶The user email
enable_debug()¶ classmethod from_config(gitlab_id=None, config_files=None)¶Create a Gitlab connection from configuration files.
Parametersgitlab_id (str) – ID of the configuration section.
list[str] (config_files) – List of paths to configuration files.
A Gitlab connection.
Return type Raisesgitlab.config.GitlabDataError – If the configuration is not correct.
get_license(**kwargs)¶Retrieve information about the current license.
Parameters**kwargs – Extra options to send to the server (e.g. sudo)
RaisesGitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
The current license information
Return typedict
headers = None¶Headers that will be used in request to GitLab
http_delete(path, **kwargs)¶Make a PUT request to the Gitlab server.
Parameterspath (str) – Path or full URL to query (‘/projects’ or ‘http://whatever/v4/api/projecs’)
**kwargs – Extra options to send to the server (e.g. sudo)
The requests object.
RaisesGitlabHttpError – When the return code is not 2xx
http_get(path, query_data={}, streamed=False, raw=False, **kwargs)¶Make a GET request to the Gitlab server.
Parameterspath (str) – Path or full URL to query (‘/projects’ or ‘http://whatever/v4/api/projecs’)
query_data (dict) – Data to send as query parameters
streamed (bool) – Whether the data should be streamed
raw (bool) – If True do not try to parse the output as json
**kwargs – Extra options to send to the server (e.g. sudo)
A requests result object is streamed is True or the content type is not json. The parsed json data otherwise.
RaisesGitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
Make a GET request to the Gitlab server for list-oriented queries.
Parameterspath (str) – Path or full URL to query (‘/projects’ or ‘http://whatever/v4/api/projecs’)
query_data (dict) – Data to send as query parameters
**kwargs – Extra options to send to the server (e.g. sudo, page, per_page)
A list of the objects returned by the server. If as_list is False and no pagination-related arguments (page, per_page, all) are defined then a GitlabList object (generator) is returned instead. This object will make API calls when needed to fetch the next items from the server.
Return typelist
RaisesGitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
Make a POST request to the Gitlab server.
Parameterspath (str) – Path or full URL to query (‘/projects’ or ‘http://whatever/v4/api/projecs’)
query_data (dict) – Data to send as query parameters
post_data (dict) – Data to send in the body (will be converted to json)
files (dict) – The files to send to the server
**kwargs – Extra options to send to the server (e.g. sudo)
The parsed json returned by the server if json is return, else the raw content
RaisesGitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
Make a PUT request to the Gitlab server.
Parameterspath (str) – Path or full URL to query (‘/projects’ or ‘http://whatever/v4/api/projecs’)
query_data (dict) – Data to send as query parameters
post_data (dict) – Data to send in the body (will be converted to json)
files (dict) – The files to send to the server
**kwargs – Extra options to send to the server (e.g. sudo)
The parsed json returned by the server.
RaisesGitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
Make an HTTP request to the Gitlab server.
Parametersverb (str) – The HTTP method to call (‘get’, ‘post’, ‘put’, ‘delete’)
path (str) – Path or full URL to query (‘/projects’ or ‘http://whatever/v4/api/projecs’)
query_data (dict) – Data to send as query parameters
post_data (dict) – Data to send in the body (will be converted to json)
streamed (bool) – Whether the data should be streamed
files (dict) – The files to send to the server
**kwargs – Extra options to send to the server (e.g. sudo)
A requests result object.
RaisesGitlabHttpError – When the return code is not 2xx
lint(content, **kwargs)¶Validate a gitlab CI configuration.
Parameterscontent (txt) – The .gitlab-ci.yml content
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabVerifyError – If the validation could not be done
(True, []) if the file is valid, (False, errors(list))
otherwise
Return typetuple
markdown(text, gfm=False, project=None, **kwargs)¶Render an arbitrary Markdown document.
Parameterstext (str) – The markdown text to render
gfm (bool) – Render text using GitLab Flavored Markdown. Default is False
project (str) – Full path of a project used a context when gfm is True
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabMarkdownError – If the server cannot perform the request
The HTML rendering of the markdown text.
Return typestr
password = None¶The user password (associated with email)
search(scope, search, **kwargs)¶Search GitLab resources matching the provided string.’
Parametersscope (str) – Scope of the search
search (str) – Search string
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabSearchError – If the server failed to perform the request
A list of dicts describing the resources found.
Return type session = None¶Create a session object for requests
set_license(license, **kwargs)¶Add a new license.
Parameterslicense (str) – The license string
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabPostError – If the server cannot perform the request
The new license information
Return typedict
ssl_verify = None¶Whether SSL certificates should be validated
timeout = None¶Timeout to use for requests to gitlab server
property url¶The user-provided server URL.
version()¶Returns the version and revision of the gitlab server.
Note that self.version and self.revision will be set on the gitlab object.
ReturnsThe server version and server revision.
(‘unknown’, ‘unknwown’) if the server doesn’t perform as expected.
Return typetuple (str, str)
class gitlab.GitlabList(gl, url, query_data, get_next=True, **kwargs)¶Bases: object
Generator representing a list of remote objects.
The object handles the links returned by a query to the API, and will call the API again when needed.
property current_page¶The current page number.
next()¶ property next_page¶The next page number.
If None, the current page is the last.
property per_page¶The number of items per page.
property prev_page¶The next page number.
If None, the current page is the last.
property total¶The total number of items.
property total_pages¶The total number of pages.