Table of Contents
gitlab package)gitlab command)gitlab package)¶Wrapper for the GitLab API.
Bases:_BaseGraphQL
url (str |None)
token (str |None)
ssl_verify (bool |str)
client (httpx.AsyncClient |None)
timeout (float |None)
user_agent (str)
fetch_schema_from_transport (bool)
max_retries (int)
obey_rate_limit (bool)
retry_transient_errors (bool)
Bases:object
Represents a GitLab server connection.
url (str |None) – The URL of the GitLab server (defaults tohttps://gitlab.com).
private_token (str |None) – The user private token
oauth_token (str |None) – An oauth token
job_token (str |None) – A CI job token
ssl_verify (bool |str) – Whether SSL certificates should be validated. Ifthe value is a string, it is the path to a CA file used forcertificate validation.
timeout (float |None) – Timeout to use for requests to the GitLab server.
http_username (str |None) – Username for HTTP authentication
http_password (str |None) – Password for HTTP authentication
api_version (str) – Gitlab API version to use (support for 4 only)
pagination (str |None) – Can be set to ‘keyset’ to use keyset pagination
order_by (str |None) – Set order_by globally
user_agent (str) – A custom user agent to use for making HTTP requests.
retry_transient_errors (bool) – Whether to retry after 500, 502, 503, 504or 52x responses. Defaults to False.
keep_base_url (bool) – keep user-provided base URL for pagination if itdiffers from response headers
session (requests.Session) – HTTP Requests Session
backend (RequestsBackend) – Backend that will be used to make http requests
per_page (int |None)
kwargs (Any)
The computed API base URL.
The API version used (4 only).
Performs an authentication using private token. Warns the user if apotentially misconfigured URL is detected on the client or server side.
Theuser attribute will hold agitlab.objects.CurrentUser object onsuccess.
None
mask_credentials (bool)
None
SeeEventManager
Create a Gitlab connection from configuration files.
gitlab_id (str |None) – ID of the configuration section.
list[str] (config_files) – List of paths to configuration files.
config_files (list[str]|None)
kwargs (Any)
session requests.Session: Custom requests Session
A Gitlab connection.
gitlab.config.GitlabDataError – If the configuration is not correct.
gitlab_id (str |None)
config_files (list[str]|None)
kwargs (Any)
Retrieve information about the current license.
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
The current license information
dict[str, str | dict[str, str]]
SeeGroupManager
Headers that will be used in request to GitLab
SeeHookManager
Make a DELETE request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The requests object.
GitlabHttpError – When the return code is not 2xx
Response
Make a GET request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – 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 (Any) – Extra options to send to the server (e.g. sudo)
A requests result object is streamed is True or the content type isnot json.The parsed json data otherwise.
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
dict[str,Any] |Response
Make a HEAD request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – Data to send as query parameters
**kwargs (Any) – Extra options to send to the server (e.g. sudo, page,per_page)
A requests.header object
GitlabHttpError – When the return code is not 2xx
CaseInsensitiveDict[Any]
Make a GET request to the Gitlab server for list-oriented queries.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projects’)
query_data (dict[str,Any]|None) – Data to send as query parameters
iterator (bool |None) – Indicate if should return a generator (True)
**kwargs (Any) – Extra options to send to the server (e.g. sudo, page,per_page)
message_details (WarnMessageData |None)
**kwargs
A list of the objects returned by the server. Ifiterator isTrue and no pagination-related arguments (page,per_page,get_all) are defined then a GitlabList object (generator) is returnedinstead. This object will make API calls when needed to fetch thenext items from the server.
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
GitlabList | list[dict[str,Any]]
Make a PATCH request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – Data to send as query parameters
post_data (dict[str,Any]|bytes |None) – Data to send in the body (will be converted tojson by default)
raw (bool) – If True, do not convert post_data to json
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The parsed json returned by the server.
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
dict[str,Any] |Response
Make a POST request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – Data to send as query parameters
post_data (dict[str,Any]|None) – Data to send in the body (will be converted tojson by default)
raw (bool) – If True, do not convert post_data to json
files (dict[str,Any]|None) – The files to send to the server
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The parsed json returned by the server if json is return, else theraw content
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
dict[str,Any] |Response
Make a PUT request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – Data to send as query parameters
post_data (dict[str,Any]|bytes |BinaryIO |None) – Data to send in the body (will be converted tojson by default)
raw (bool) – If True, do not convert post_data to json
files (dict[str,Any]|None) – The files to send to the server
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The parsed json returned by the server.
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
dict[str,Any] |Response
Make an HTTP request to the Gitlab server.
verb (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[str,Any]|None) – Data to send as query parameters
post_data (dict[str,Any]|bytes |BinaryIO |None) – Data to send in the body (will be converted tojson by default)
raw (bool) – If True, do not convert post_data to json
streamed (bool) – Whether the data should be streamed
files (dict[str,Any]|None) – The files to send to the server
timeout (float |None) – The timeout, in seconds, for the request
obey_rate_limit (bool) – Whether to obey 429 Too Many Requestresponses. Defaults to True.
retry_transient_errors (bool |None) – Whether to retry after 500, 502, 503, 504or 52x responses. Defaults to False.
max_retries (int) – Max retries after 429 or transient errors,set to -1 to retry forever. Defaults to 10.
extra_headers (dict[str,Any]|None) – Add and override HTTP headers for the request.
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
A requests result object.
GitlabHttpError – When the return code is not 2xx
Response
SeeIssueManager
SeeKeyManager
Render an arbitrary Markdown document.
text (str) – The markdown text to render
gfm (bool) – Render text using GitLab Flavored Markdown. Default is False
project (str |None) – Full path of a project used a context whengfm is True
**kwargs (Any) – 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.
str
Create a Gitlab connection by merging configuration withthe following precedence:
Explicitly provided CLI arguments,
Environment variables,
via the–config-file CLI argument,
via thePYTHON_GITLAB_CFG environment variable,
user-specific config file,
system-level config file,
Environment variables always present in CI (CI_SERVER_URL, CI_JOB_TOKEN).
options (dict[str,Any]) – A dictionary of explicitly provided key-value options.
gitlab_id (str |None) – ID of the configuration section.
config_files (list[str]|None) – List of paths to configuration files.
A Gitlab connection.
gitlab.config.GitlabDataError – If the configuration is not correct.
Search GitLab resources matching the provided string.’
scope (str) – Scope of the search
search (str) – Search string
**kwargs (Any) – 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.
GitlabList | list[dict[str,Any]]
Whether SSL certificates should be validated
Timeout to use for requests to gitlab server
SeeTodoManager
SeeTopicManager
The user-provided server URL.
SeeUserManager
Returns the version and revision of the gitlab server.
Note that self.version and self.revision will be set on the gitlabobject.
(‘unknown’, ‘unknown’) if the server doesn’t perform as expected.
tuple[str, str]
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabCancelError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:Exception
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabCancelError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:object
Generator representing a list of remote objects.
The object handles the links returned by a query to the API, and will callthe API again when needed.
gl (Gitlab)
url (str)
query_data (dict[str,Any])
get_next (bool)
kwargs (Any)
The current page number.
The next page number.
If None, the current page is the last.
The number of items per page.
The previous page number.
If None, the current page is the first.
The total number of items.
The total number of pages.
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabCancelError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:_BaseGraphQL
url (str |None)
token (str |None)
ssl_verify (bool |str)
client (httpx.Client |None)
timeout (float |None)
user_agent (str)
fetch_schema_from_transport (bool)
max_retries (int)
obey_rate_limit (bool)
retry_transient_errors (bool)
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:object
Represents a GitLab server connection.
url (str |None) – The URL of the GitLab server (defaults tohttps://gitlab.com).
private_token (str |None) – The user private token
oauth_token (str |None) – An oauth token
job_token (str |None) – A CI job token
ssl_verify (bool |str) – Whether SSL certificates should be validated. Ifthe value is a string, it is the path to a CA file used forcertificate validation.
timeout (float |None) – Timeout to use for requests to the GitLab server.
http_username (str |None) – Username for HTTP authentication
http_password (str |None) – Password for HTTP authentication
api_version (str) – Gitlab API version to use (support for 4 only)
pagination (str |None) – Can be set to ‘keyset’ to use keyset pagination
order_by (str |None) – Set order_by globally
user_agent (str) – A custom user agent to use for making HTTP requests.
retry_transient_errors (bool) – Whether to retry after 500, 502, 503, 504or 52x responses. Defaults to False.
keep_base_url (bool) – keep user-provided base URL for pagination if itdiffers from response headers
session (requests.Session) – HTTP Requests Session
backend (RequestsBackend) – Backend that will be used to make http requests
per_page (int |None)
kwargs (Any)
The computed API base URL.
The API version used (4 only).
Performs an authentication using private token. Warns the user if apotentially misconfigured URL is detected on the client or server side.
Theuser attribute will hold agitlab.objects.CurrentUser object onsuccess.
None
mask_credentials (bool)
None
SeeEventManager
Create a Gitlab connection from configuration files.
gitlab_id (str |None) – ID of the configuration section.
list[str] (config_files) – List of paths to configuration files.
config_files (list[str]|None)
kwargs (Any)
session requests.Session: Custom requests Session
A Gitlab connection.
gitlab.config.GitlabDataError – If the configuration is not correct.
gitlab_id (str |None)
config_files (list[str]|None)
kwargs (Any)
Retrieve information about the current license.
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
The current license information
dict[str, str | dict[str, str]]
SeeGroupManager
Headers that will be used in request to GitLab
SeeHookManager
Make a DELETE request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The requests object.
GitlabHttpError – When the return code is not 2xx
Response
Make a GET request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – 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 (Any) – Extra options to send to the server (e.g. sudo)
A requests result object is streamed is True or the content type isnot json.The parsed json data otherwise.
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
dict[str,Any] |Response
Make a HEAD request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – Data to send as query parameters
**kwargs (Any) – Extra options to send to the server (e.g. sudo, page,per_page)
A requests.header object
GitlabHttpError – When the return code is not 2xx
CaseInsensitiveDict[Any]
Make a GET request to the Gitlab server for list-oriented queries.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projects’)
query_data (dict[str,Any]|None) – Data to send as query parameters
iterator (bool |None) – Indicate if should return a generator (True)
**kwargs (Any) – Extra options to send to the server (e.g. sudo, page,per_page)
message_details (WarnMessageData |None)
**kwargs
A list of the objects returned by the server. Ifiterator isTrue and no pagination-related arguments (page,per_page,get_all) are defined then a GitlabList object (generator) is returnedinstead. This object will make API calls when needed to fetch thenext items from the server.
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
GitlabList | list[dict[str,Any]]
Make a PATCH request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – Data to send as query parameters
post_data (dict[str,Any]|bytes |None) – Data to send in the body (will be converted tojson by default)
raw (bool) – If True, do not convert post_data to json
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The parsed json returned by the server.
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
dict[str,Any] |Response
Make a POST request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – Data to send as query parameters
post_data (dict[str,Any]|None) – Data to send in the body (will be converted tojson by default)
raw (bool) – If True, do not convert post_data to json
files (dict[str,Any]|None) – The files to send to the server
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The parsed json returned by the server if json is return, else theraw content
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
dict[str,Any] |Response
Make a PUT request to the Gitlab server.
path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)
query_data (dict[str,Any]|None) – Data to send as query parameters
post_data (dict[str,Any]|bytes |BinaryIO |None) – Data to send in the body (will be converted tojson by default)
raw (bool) – If True, do not convert post_data to json
files (dict[str,Any]|None) – The files to send to the server
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The parsed json returned by the server.
GitlabHttpError – When the return code is not 2xx
GitlabParsingError – If the json data could not be parsed
dict[str,Any] |Response
Make an HTTP request to the Gitlab server.
verb (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[str,Any]|None) – Data to send as query parameters
post_data (dict[str,Any]|bytes |BinaryIO |None) – Data to send in the body (will be converted tojson by default)
raw (bool) – If True, do not convert post_data to json
streamed (bool) – Whether the data should be streamed
files (dict[str,Any]|None) – The files to send to the server
timeout (float |None) – The timeout, in seconds, for the request
obey_rate_limit (bool) – Whether to obey 429 Too Many Requestresponses. Defaults to True.
retry_transient_errors (bool |None) – Whether to retry after 500, 502, 503, 504or 52x responses. Defaults to False.
max_retries (int) – Max retries after 429 or transient errors,set to -1 to retry forever. Defaults to 10.
extra_headers (dict[str,Any]|None) – Add and override HTTP headers for the request.
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
A requests result object.
GitlabHttpError – When the return code is not 2xx
Response
SeeIssueManager
SeeKeyManager
Render an arbitrary Markdown document.
text (str) – The markdown text to render
gfm (bool) – Render text using GitLab Flavored Markdown. Default is False
project (str |None) – Full path of a project used a context whengfm is True
**kwargs (Any) – 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.
str
Create a Gitlab connection by merging configuration withthe following precedence:
Explicitly provided CLI arguments,
Environment variables,
via the–config-file CLI argument,
via thePYTHON_GITLAB_CFG environment variable,
user-specific config file,
system-level config file,
Environment variables always present in CI (CI_SERVER_URL, CI_JOB_TOKEN).
options (dict[str,Any]) – A dictionary of explicitly provided key-value options.
gitlab_id (str |None) – ID of the configuration section.
config_files (list[str]|None) – List of paths to configuration files.
A Gitlab connection.
gitlab.config.GitlabDataError – If the configuration is not correct.
Search GitLab resources matching the provided string.’
scope (str) – Scope of the search
search (str) – Search string
**kwargs (Any) – 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.
GitlabList | list[dict[str,Any]]
Whether SSL certificates should be validated
Timeout to use for requests to gitlab server
SeeTodoManager
SeeTopicManager
The user-provided server URL.
SeeUserManager
Returns the version and revision of the gitlab server.
Note that self.version and self.revision will be set on the gitlabobject.
(‘unknown’, ‘unknown’) if the server doesn’t perform as expected.
tuple[str, str]
Bases:object
Generator representing a list of remote objects.
The object handles the links returned by a query to the API, and will callthe API again when needed.
gl (Gitlab)
url (str)
query_data (dict[str,Any])
get_next (bool)
kwargs (Any)
The current page number.
The next page number.
If None, the current page is the last.
The number of items per page.
The previous page number.
If None, the current page is the first.
The total number of items.
The total number of pages.
AnyApplicationApplicationAppearanceApplicationAppearanceManagerApplicationManagerApplicationSettingsApplicationSettingsManagerApplicationStatisticsApplicationStatisticsManagerAuditEventAuditEventManagerBroadcastMessageBroadcastMessageManagerBulkImportBulkImportAllEntityBulkImportAllEntityManagerBulkImportEntityBulkImportEntityManagerBulkImportManagerCiLintCiLintManagerCurrentUserCurrentUserEmailCurrentUserEmailManagerCurrentUserGPGKeyCurrentUserGPGKeyManagerCurrentUserKeyCurrentUserKeyManagerCurrentUserManagerCurrentUserRunnerCurrentUserRunnerManagerCurrentUserStatusCurrentUserStatusManagerDeployKeyDeployKeyManagerDeployTokenDeployTokenManagerDockerfileDockerfileManagerEventEventManagerFeatureFeatureManagerGenericPackageGenericPackageManagerGeoNodeGeoNodeManagerGitignoreGitignoreManagerGitlabciymlGitlabciymlManagerGroupGroup.access_tokensGroup.accessrequestsGroup.approval_rulesGroup.audit_eventsGroup.badgesGroup.billable_membersGroup.boardsGroup.clustersGroup.customattributesGroup.deploytokensGroup.descendant_groupsGroup.epicsGroup.exportsGroup.hooksGroup.importsGroup.invitationsGroup.issuesGroup.issues_statisticsGroup.iterationsGroup.labelsGroup.ldap_group_linksGroup.ldap_sync()Group.member_rolesGroup.membersGroup.members_allGroup.mergerequestsGroup.milestonesGroup.notificationsettingsGroup.packagesGroup.projectsGroup.protectedbranchesGroup.pushrulesGroup.registry_repositoriesGroup.restore()Group.runnersGroup.saml_group_linksGroup.search()Group.service_accountsGroup.share()Group.shared_projectsGroup.subgroupsGroup.transfer()Group.transfer_project()Group.unshare()Group.variablesGroup.wikisGroupAccessRequestGroupAccessRequestManagerGroupAccessTokenGroupAccessTokenManagerGroupApprovalRuleGroupApprovalRuleManagerGroupAuditEventGroupAuditEventManagerGroupBadgeGroupBadgeManagerGroupBillableMemberGroupBillableMemberManagerGroupBillableMemberMembershipGroupBillableMemberMembershipManagerGroupBoardGroupBoardListGroupBoardListManagerGroupBoardManagerGroupClusterGroupClusterManagerGroupCustomAttributeGroupCustomAttributeManagerGroupDeployTokenGroupDeployTokenManagerGroupDescendantGroupGroupDescendantGroupManagerGroupEpicGroupEpicAwardEmojiGroupEpicAwardEmojiManagerGroupEpicDiscussionNoteGroupEpicDiscussionNoteManagerGroupEpicIssueGroupEpicIssueManagerGroupEpicManagerGroupEpicNoteGroupEpicNoteAwardEmojiGroupEpicNoteAwardEmojiManagerGroupEpicNoteManagerGroupEpicResourceLabelEventGroupEpicResourceLabelEventManagerGroupExportGroupExportManagerGroupHookGroupHookManagerGroupImportGroupImportManagerGroupInvitationGroupInvitationManagerGroupIssueGroupIssueManagerGroupIssuesStatisticsGroupIssuesStatisticsManagerGroupIterationGroupIterationManagerGroupLDAPGroupLinkGroupLDAPGroupLinkManagerGroupLabelGroupLabelManagerGroupManagerGroupMemberGroupMemberAllGroupMemberAllManagerGroupMemberManagerGroupMemberRoleGroupMemberRoleManagerGroupMergeRequestGroupMergeRequestManagerGroupMilestoneGroupMilestoneManagerGroupNotificationSettingsGroupNotificationSettingsManagerGroupPackageGroupPackageManagerGroupProjectGroupProjectManagerGroupPushRulesGroupPushRulesManagerGroupRegistryRepositoryManagerGroupRunnerGroupRunnerManagerGroupSAMLGroupLinkGroupSAMLGroupLinkManagerGroupServiceAccountGroupServiceAccountManagerGroupSubgroupGroupSubgroupManagerGroupVariableGroupVariableManagerGroupWikiGroupWikiManagerHookHookManagerIssueIssueManagerIssuesStatisticsIssuesStatisticsManagerKeyKeyManagerLDAPGroupLDAPGroupManagerLicenseLicenseManagerMemberRoleMemberRoleManagerMergeRequestMergeRequestManagerNamespaceNamespaceManagerNotificationSettingsNotificationSettingsManagerPagesDomainPagesDomainManagerPersonalAccessTokenPersonalAccessTokenManagerProjectProject.access_tokensProject.accessrequestsProject.additionalstatisticsProject.approvalrulesProject.approvalsProject.archive()Project.artifactsProject.audit_eventsProject.badgesProject.boardsProject.branchesProject.ci_lintProject.cluster_agentsProject.clustersProject.commitsProject.create_fork_relation()Project.customattributesProject.delete_fork_relation()Project.deploymentsProject.deploytokensProject.dockerfile_templatesProject.environmentsProject.eventsProject.exportsProject.external_status_checksProject.filesProject.forksProject.generic_packagesProject.gitignore_templatesProject.gitlabciyml_templatesProject.groupsProject.hooksProject.housekeeping()Project.importsProject.integrationsProject.invitationsProject.issue_templatesProject.issuesProject.issues_statisticsProject.iterationsProject.job_token_scopeProject.jobsProject.keysProject.labelsProject.languages()Project.license_templatesProject.membersProject.members_allProject.merge_request_templatesProject.merge_trainsProject.mergerequestsProject.milestonesProject.mirror_pull()Project.mirror_pull_details()Project.notesProject.notificationsettingsProject.package_protection_rulesProject.packagesProject.pagesProject.pagesdomainsProject.pipelinesProject.pipelineschedulesProject.protected_environmentsProject.protectedbranchesProject.protectedtagsProject.pull_mirrorProject.pushrulesProject.registry_protection_repository_rulesProject.registry_protection_rulesProject.releasesProject.remote_mirrorsProject.repositoriesProject.resource_groupsProject.restore()Project.runnersProject.search()Project.secure_filesProject.servicesProject.share()Project.snapshot()Project.snippetsProject.star()Project.storageProject.tagsProject.transfer()Project.trigger_pipeline()Project.triggersProject.unarchive()Project.unshare()Project.unstar()Project.usersProject.variablesProject.wikisProjectAccessRequestProjectAccessRequestManagerProjectAccessTokenProjectAccessTokenManagerProjectAdditionalStatisticsProjectAdditionalStatisticsManagerProjectApprovalProjectApprovalManagerProjectApprovalRuleProjectApprovalRuleManagerProjectArtifactProjectArtifactManagerProjectAuditProjectAuditEventProjectAuditEventManagerProjectAuditManagerProjectBadgeProjectBadgeManagerProjectBoardProjectBoardListProjectBoardListManagerProjectBoardManagerProjectBranchProjectBranchManagerProjectCiLintProjectCiLintManagerProjectClusterProjectClusterAgentProjectClusterAgentManagerProjectClusterManagerProjectCommitProjectCommitCommentProjectCommitCommentManagerProjectCommitDiscussionProjectCommitDiscussionManagerProjectCommitDiscussionNoteProjectCommitDiscussionNoteManagerProjectCommitManagerProjectCommitStatusProjectCommitStatusManagerProjectCustomAttributeProjectCustomAttributeManagerProjectDeployTokenProjectDeployTokenManagerProjectDeploymentProjectDeploymentManagerProjectDeploymentMergeRequestProjectDeploymentMergeRequestManagerProjectDockerfileTemplateProjectDockerfileTemplateManagerProjectEnvironmentProjectEnvironmentManagerProjectEventProjectEventManagerProjectExportProjectExportManagerProjectExternalStatusCheckProjectExternalStatusCheckManagerProjectFileProjectFileManagerProjectForkProjectForkManagerProjectGitignoreTemplateProjectGitignoreTemplateManagerProjectGitlabciymlTemplateProjectGitlabciymlTemplateManagerProjectHookProjectHookManagerProjectImportProjectImportManagerProjectIntegrationProjectIntegrationManagerProjectInvitationProjectInvitationManagerProjectIssueProjectIssue.awardemojisProjectIssue.closed_by()ProjectIssue.discussionsProjectIssue.linksProjectIssue.move()ProjectIssue.notesProjectIssue.related_merge_requests()ProjectIssue.reorder()ProjectIssue.resource_iteration_eventsProjectIssue.resource_weight_eventsProjectIssue.resourcelabeleventsProjectIssue.resourcemilestoneeventsProjectIssue.resourcestateeventsProjectIssueAwardEmojiProjectIssueAwardEmojiManagerProjectIssueDiscussionProjectIssueDiscussionManagerProjectIssueDiscussionNoteProjectIssueDiscussionNoteManagerProjectIssueLinkProjectIssueLinkManagerProjectIssueManagerProjectIssueNoteProjectIssueNoteAwardEmojiProjectIssueNoteAwardEmojiManagerProjectIssueNoteManagerProjectIssueResourceIterationEventProjectIssueResourceIterationEventManagerProjectIssueResourceLabelEventProjectIssueResourceLabelEventManagerProjectIssueResourceMilestoneEventProjectIssueResourceMilestoneEventManagerProjectIssueResourceStateEventProjectIssueResourceStateEventManagerProjectIssueResourceWeightEventProjectIssueResourceWeightEventManagerProjectIssueTemplateProjectIssueTemplateManagerProjectIssuesStatisticsProjectIssuesStatisticsManagerProjectIterationManagerProjectJobProjectJobManagerProjectJobTokenScopeProjectJobTokenScopeManagerProjectKeyProjectKeyManagerProjectLabelProjectLabelManagerProjectLicenseTemplateProjectLicenseTemplateManagerProjectManagerProjectMemberProjectMemberAllProjectMemberAllManagerProjectMemberManagerProjectMergeRequestProjectMergeRequest.approval_rulesProjectMergeRequest.approval_stateProjectMergeRequest.approvalsProjectMergeRequest.approve()ProjectMergeRequest.awardemojisProjectMergeRequest.cancel_merge_when_pipeline_succeeds()ProjectMergeRequest.changes()ProjectMergeRequest.closes_issues()ProjectMergeRequest.commits()ProjectMergeRequest.diffsProjectMergeRequest.discussionsProjectMergeRequest.draft_notesProjectMergeRequest.merge()ProjectMergeRequest.merge_ref()ProjectMergeRequest.notesProjectMergeRequest.pipelinesProjectMergeRequest.rebase()ProjectMergeRequest.related_issues()ProjectMergeRequest.reset_approvals()ProjectMergeRequest.resourcelabeleventsProjectMergeRequest.resourcemilestoneeventsProjectMergeRequest.resourcestateeventsProjectMergeRequest.reviewer_detailsProjectMergeRequest.status_checksProjectMergeRequest.unapprove()ProjectMergeRequestApprovalProjectMergeRequestApprovalManagerProjectMergeRequestApprovalRuleProjectMergeRequestApprovalRuleManagerProjectMergeRequestApprovalStateProjectMergeRequestApprovalStateManagerProjectMergeRequestAwardEmojiProjectMergeRequestAwardEmojiManagerProjectMergeRequestDiffProjectMergeRequestDiffManagerProjectMergeRequestDiscussionProjectMergeRequestDiscussionManagerProjectMergeRequestDiscussionNoteProjectMergeRequestDiscussionNoteManagerProjectMergeRequestDraftNoteProjectMergeRequestDraftNoteManagerProjectMergeRequestManagerProjectMergeRequestNoteProjectMergeRequestNoteAwardEmojiProjectMergeRequestNoteAwardEmojiManagerProjectMergeRequestNoteManagerProjectMergeRequestPipelineProjectMergeRequestPipelineManagerProjectMergeRequestResourceLabelEventProjectMergeRequestResourceLabelEventManagerProjectMergeRequestResourceMilestoneEventProjectMergeRequestResourceMilestoneEventManagerProjectMergeRequestResourceStateEventProjectMergeRequestResourceStateEventManagerProjectMergeRequestReviewerDetailProjectMergeRequestReviewerDetailManagerProjectMergeRequestStatusCheckProjectMergeRequestStatusCheckManagerProjectMergeRequestTemplateProjectMergeRequestTemplateManagerProjectMergeTrainProjectMergeTrainManagerProjectMilestoneProjectMilestoneManagerProjectNoteProjectNoteManagerProjectNotificationSettingsProjectNotificationSettingsManagerProjectPackageProjectPackageFileProjectPackageFileManagerProjectPackageManagerProjectPackagePipelineProjectPackagePipelineManagerProjectPackageProtectionRuleProjectPackageProtectionRuleManagerProjectPagesProjectPagesDomainProjectPagesDomainManagerProjectPagesManagerProjectPipelineProjectPipelineBridgeProjectPipelineBridgeManagerProjectPipelineJobProjectPipelineJobManagerProjectPipelineManagerProjectPipelineScheduleProjectPipelineScheduleManagerProjectPipelineSchedulePipelineProjectPipelineSchedulePipelineManagerProjectPipelineScheduleVariableProjectPipelineScheduleVariableManagerProjectPipelineTestReportProjectPipelineTestReportManagerProjectPipelineTestReportSummaryProjectPipelineTestReportSummaryManagerProjectPipelineVariableProjectPipelineVariableManagerProjectProtectedBranchProjectProtectedBranchManagerProjectProtectedEnvironmentProjectProtectedEnvironmentManagerProjectProtectedTagProjectProtectedTagManagerProjectPullMirrorProjectPullMirrorManagerProjectPushRulesProjectPushRulesManagerProjectRegistryProtectionRuleProjectRegistryProtectionRuleManagerProjectRegistryRepositoryProjectRegistryRepositoryManagerProjectRegistryRepositoryProtectionRuleProjectRegistryRepositoryProtectionRuleManagerProjectRegistryTagProjectRegistryTagManagerProjectReleaseProjectReleaseLinkProjectReleaseLinkManagerProjectReleaseManagerProjectRemoteMirrorProjectRemoteMirrorManagerProjectResourceGroupProjectResourceGroupManagerProjectResourceGroupUpcomingJobProjectResourceGroupUpcomingJobManagerProjectRunnerProjectRunnerManagerProjectSecureFileProjectSecureFileManagerProjectServiceProjectServiceManagerProjectSnippetProjectSnippetAwardEmojiProjectSnippetAwardEmojiManagerProjectSnippetDiscussionProjectSnippetDiscussionManagerProjectSnippetDiscussionNoteProjectSnippetDiscussionNoteManagerProjectSnippetManagerProjectSnippetNoteProjectSnippetNoteAwardEmojiProjectSnippetNoteAwardEmojiManagerProjectSnippetNoteManagerProjectStorageProjectStorageManagerProjectTagProjectTagManagerProjectTriggerProjectTriggerManagerProjectUserProjectUserManagerProjectVariableProjectVariableManagerProjectWikiProjectWikiManagerRegistryRepositoryRegistryRepositoryManagerRepositoryMixinRepositoryMixin.delete_merged_branches()RepositoryMixin.repository_archive()RepositoryMixin.repository_blob()RepositoryMixin.repository_compare()RepositoryMixin.repository_contributors()RepositoryMixin.repository_merge_base()RepositoryMixin.repository_raw_blob()RepositoryMixin.repository_tree()RepositoryMixin.update_submodule()RunnerRunnerAllRunnerAllManagerRunnerJobRunnerJobManagerRunnerManagerSharedProjectSharedProjectManagerSidekiqManagerSnippetSnippetManagerStarredProjectStarredProjectManagerTodoTodoManagerTopicTopicManagerUserUser.activate()User.approve()User.ban()User.block()User.contributed_projectsUser.customattributesUser.deactivate()User.emailsUser.eventsUser.follow()User.followers_usersUser.following_usersUser.gpgkeysUser.identityprovidersUser.impersonationtokensUser.keysUser.membershipsUser.personal_access_tokensUser.projectsUser.reject()User.starred_projectsUser.statusUser.unban()User.unblock()User.unfollow()UserActivitiesUserActivitiesManagerUserContributedProjectUserContributedProjectManagerUserCustomAttributeUserCustomAttributeManagerUserEmailUserEmailManagerUserEventUserEventManagerUserGPGKeyUserGPGKeyManagerUserIdentityProviderManagerUserImpersonationTokenUserImpersonationTokenManagerUserKeyUserKeyManagerUserManagerUserMembershipUserMembershipManagerUserPersonalAccessTokenUserPersonalAccessTokenManagerUserProjectUserProjectManagerUserStatusUserStatusManagerVariableVariableManageroverload()Bases:Generic[TObjCls]
Base class for CRUD operations on objects.
Derived 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
gl (Gitlab)
parent (RESTObject |None)
Bases:object
Represents an object built from server data.
It holds the attributes know from the server, and the updated attributes inanother. This allows smart updates, if the object allows it.
You can redefine_id_attr in child classes to specify which attributemust be used as the unique ID.None means that the object can be updatedwithout ID in the url.
Likewise, you can define a_repr_attr in subclasses to specify whichattribute should be added as a human-readable identifier when called in theobject’s__repr__() method.
manager (RESTManager[Any])
attrs (dict[str,Any])
created_from_list (bool)
lazy (bool)
with_parent_attrs (bool)
dict[str,Any]
Ensure that the ID is url-encoded so that it can be safely used in a URLpath
Returns the id of the resource.
int | str | None
str
None
Bases:Generic[TObjCls]
Generator object representing a list of RESTObject’s.
This generator uses the Gitlab pagination system to fetch new data whenrequired.
Note: you should not instantiate such objects, they are returned by callsto RESTManager.list()
manager (RESTManager[TObjCls]) – Manager to attach to the created objects
obj_cls (type[TObjCls]) – Type of objects to create from the json data
_list (GitlabList) – A GitlabList object
The current page number.
TObjCls
The next page number.
If None, the current page is the last.
The number of items per page.
The previous page number.
If None, the current page is the first.
The total number of items.
The total number of pages.
Bases:object
required (tuple[str,...])
optional (tuple[str,...])
in_object (bool)
requires_id (bool)
help (str |None)
cls (type[RESTObject])
str
msg (str)
e (Exception |None)
NoReturn
Provide a statically generated parser for sphinx only, so we don’t needto provide dummy gitlab config for readthedocs.
ArgumentParser
gitlab_resource (str)
namespace (ModuleType)
type[RESTObject]
None
cls_names (str |tuple[str,...])
required (tuple[str,...])
optional (tuple[str,...])
custom_action (str |None)
requires_id (bool)
help (str |None)
Callable[[__F],__F]
Bases:Exception
Bases:ConfigError
Bases:ConfigError
Bases:object
gitlab_id (str |None)
config_files (list[str]|None)
Bases:ConfigError
Bases:ConfigError
Bases:IntEnum
Bases:GitlabEnum
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabCancelError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:Exception
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabCancelError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabCancelError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabRetryError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabOperationError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:GitlabError
error_message (str |bytes)
response_code (int |None)
response_body (bytes |None)
None
Bases:object
Approve an access request.
access_level (int) – The access level for the user
**kwargs (Any) – 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
None
Bases:RESTManager[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Preview link_url and image_url after interpolation.
link_url (str) – URL of the badge link
image_url (str) – URL of the badge image
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabRenderError – If the rendering failed
The rendering properties
dict[str,Any]
Bases:GetMixin[TObjCls],ListMixin[TObjCls],CreateMixin[TObjCls],UpdateMixin[TObjCls],DeleteMixin[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Bases:RESTManager[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Create a new object.
the data sent by the server
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
TObjCls
Bases:RESTManager[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Delete an object on the server.
id (str |int |None) – ID of the object to delete
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
None
Bases:object
Download the archive of a resource export.
streamed – If True the data will be processed by chunks ofchunk_size and each chunk is passed toaction fortreatment
iterator – If True directly return the underlying responseiterator
action – Callable responsible of dealing with chunk ofdata
chunk_size – Size of each chunk
**kwargs – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
The blob content if streamed is False, None otherwise
Bases:HeadMixin[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Retrieve a single object.
id (str |int) – ID of the object to retrieve
lazy (bool) – If True, don’t request the server, but create ashallow object giving access to the managers. This isuseful if you want to avoid useless calls to the API.
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The generated RESTObject.
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
TObjCls
Bases:HeadMixin[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Retrieve a single object.
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
The generated RESTObject
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
TObjCls
Bases:HeadMixin[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Retrieve a list of objects.
get_all – If True, return all the items, without pagination
per_page – Number of items to retrieve per request
page – ID of the page to return (starts with page 1)
iterator – If set to True and no pagination option isdefined, 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 ifiterator is True
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server cannot perform the request
Bases:GetMixin[TObjCls],ListMixin[TObjCls],CreateMixin[TObjCls],DeleteMixin[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Bases:object
Mixin for RESTObject’s that can be deleted.
Delete the object from the server.
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
None
Bases:object
List the participants.
get_all – If True, return all the items, without pagination
per_page – Number of items to retrieve per request
page – ID of the page to return (starts with page 1)
**kwargs (Any) – 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
GitlabList | list[dict[str,Any]]
Bases:object
Refresh a single object from server.
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
None
Returns None (updates the object)
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
kwargs (Any)
None
Bases:ListMixin[TObjCls],GetMixin[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Bases:object
Mixin for RESTObject’s that can be updated.
Bases:RESTManager[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Create or update the object.
key (str) – The key of the object to create/update
value (str) – The value to set for the object
**kwargs (Any) – Extra options to send to the server (e.g. sudo)
GitlabAuthenticationError – If authentication is not correct
GitlabSetError – If an error occurred
The created/updated attribute
TObjCls
Bases:object
Bases:object
Set an estimated time of work for the object.
Bases:object
Bases:RESTManager[TObjCls]
gl (Gitlab)
parent (RESTObject |None)
Update an object on the server.
The new object data (not a RESTObject)
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server cannot perform the request
dict[str,Any]
Bases:object
Bases:str
A customstr class that will return the URL-encoded value of the string.
Using it recursively will only url-encode the value once.
Can accept eitherstr orint as input value.
Can be used in an f-string and output the URL-encoded string.
Reference to documentation on why this is necessary.
See:
https://docs.gitlab.com/ee/api/index.html#namespaced-path-encodinghttps://docs.gitlab.com/ee/api/index.html#path-parameters
Bases:Formatter
A logging formatter that can mask credentials
fmt (str |None)
datefmt (str |None)
style (Literal['%','{','$'])
validate (bool)
masked (str |None)
Format the specified record as text.
The record’s attribute dictionary is used as the operand to astring formatting operation which yields the returned string.Before formatting the dictionary, a couple of preparatory stepsare carried out. The message attribute of the record is computedusing LogRecord.getMessage(). If the formatting string uses thetime (as determined by a call to usesTime(), formatTime() iscalled to format the event time. If there is exception information,it is formatted using formatException() and appended to the message.
record (LogRecord)
str
Bases:object
max_retries (int)
obey_rate_limit (bool |None)
retry_transient_errors (bool |None)
bool
status_code (int |None)
headers (MutableMapping[str,str]|None)
reason (str)
bool
Bases:object
message (str)
show_caller (bool)
Return the base URL with the trailing slash stripped.If the URL is a Falsy value, return the default URL.:returns: The base URL
url (str |None)
str
content_type (str |None)
str
Thiswarnings.warn wrapper function attempts to show the location causing thewarning in the user code that called the library.
It does this by walking up the stack trace to find the first frame located outsidethegitlab/ directory. This is helpful to users as it shows them their code thatis causing the warning.
message (str)
category (type[Warning]|None)
source (Any |None)
show_caller (bool)
None
gitlab package)GitlabGitlab.api_urlGitlab.api_versionGitlab.appearanceGitlab.applicationsGitlab.audit_eventsGitlab.auth()Gitlab.broadcastmessagesGitlab.bulk_import_entitiesGitlab.bulk_importsGitlab.ci_lintGitlab.deploykeysGitlab.deploytokensGitlab.dockerfilesGitlab.enable_debug()Gitlab.eventsGitlab.featuresGitlab.from_config()Gitlab.geonodesGitlab.get_license()Gitlab.gitignoresGitlab.gitlabciymlsGitlab.groupsGitlab.headersGitlab.hooksGitlab.http_delete()Gitlab.http_get()Gitlab.http_head()Gitlab.http_list()Gitlab.http_patch()Gitlab.http_post()Gitlab.http_put()Gitlab.http_request()Gitlab.issuesGitlab.issues_statisticsGitlab.keysGitlab.ldapgroupsGitlab.licensesGitlab.markdown()Gitlab.member_rolesGitlab.merge_config()Gitlab.mergerequestsGitlab.namespacesGitlab.notificationsettingsGitlab.pagesdomainsGitlab.personal_access_tokensGitlab.projectsGitlab.registry_repositoriesGitlab.runnersGitlab.runners_allGitlab.search()Gitlab.set_license()Gitlab.settingsGitlab.sidekiqGitlab.snippetsGitlab.ssl_verifyGitlab.statisticsGitlab.timeoutGitlab.todosGitlab.topicsGitlab.urlGitlab.userGitlab.user_activitiesGitlab.usersGitlab.variablesGitlab.version()GitlabListGitlabActivateErrorGitlabAttachFileErrorGitlabAuthenticationErrorGitlabBanErrorGitlabBlockErrorGitlabBuildCancelErrorGitlabBuildEraseErrorGitlabBuildPlayErrorGitlabBuildRetryErrorGitlabCancelErrorGitlabCherryPickErrorGitlabCiLintErrorGitlabConnectionErrorGitlabCreateErrorGitlabDeactivateErrorGitlabDeleteErrorGitlabDeploymentApprovalErrorGitlabErrorGitlabFollowErrorGitlabGetErrorGitlabGroupTransferErrorGitlabHeadErrorGitlabHookTestErrorGitlabHousekeepingErrorGitlabHttpErrorGitlabImportErrorGitlabInvitationErrorGitlabJobCancelErrorGitlabJobEraseErrorGitlabJobPlayErrorGitlabJobRetryErrorGitlabLicenseErrorGitlabListErrorGitlabMRApprovalErrorGitlabMRClosedErrorGitlabMRForbiddenErrorGitlabMROnBuildSuccessErrorGitlabMRRebaseErrorGitlabMRResetApprovalErrorGitlabMarkdownErrorGitlabOperationErrorGitlabOwnershipErrorGitlabParsingErrorGitlabPipelineCancelErrorGitlabPipelinePlayErrorGitlabPipelineRetryErrorGitlabProjectDeployKeyErrorGitlabPromoteErrorGitlabProtectErrorGitlabRenderErrorGitlabRepairErrorGitlabRestoreErrorGitlabRetryErrorGitlabRevertErrorGitlabRotateErrorGitlabSearchErrorGitlabSetErrorGitlabStopErrorGitlabSubscribeErrorGitlabTimeTrackingErrorGitlabTodoErrorGitlabTopicMergeErrorGitlabTransferProjectErrorGitlabUnbanErrorGitlabUnblockErrorGitlabUnfollowErrorGitlabUnsubscribeErrorGitlabUpdateErrorGitlabUploadErrorGitlabUserApproveErrorGitlabUserRejectErrorGitlabVerifyErrorRedirectError