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.
Any
Application
ApplicationAppearance
ApplicationAppearanceManager
ApplicationManager
ApplicationSettings
ApplicationSettingsManager
ApplicationStatistics
ApplicationStatisticsManager
AuditEvent
AuditEventManager
BroadcastMessage
BroadcastMessageManager
BulkImport
BulkImportAllEntity
BulkImportAllEntityManager
BulkImportEntity
BulkImportEntityManager
BulkImportManager
CiLint
CiLintManager
CurrentUser
CurrentUserEmail
CurrentUserEmailManager
CurrentUserGPGKey
CurrentUserGPGKeyManager
CurrentUserKey
CurrentUserKeyManager
CurrentUserManager
CurrentUserRunner
CurrentUserRunnerManager
CurrentUserStatus
CurrentUserStatusManager
DeployKey
DeployKeyManager
DeployToken
DeployTokenManager
Dockerfile
DockerfileManager
Event
EventManager
Feature
FeatureManager
GenericPackage
GenericPackageManager
GeoNode
GeoNodeManager
Gitignore
GitignoreManager
Gitlabciyml
GitlabciymlManager
Group
Group.access_tokens
Group.accessrequests
Group.approval_rules
Group.audit_events
Group.badges
Group.billable_members
Group.boards
Group.clusters
Group.customattributes
Group.deploytokens
Group.descendant_groups
Group.epics
Group.exports
Group.hooks
Group.imports
Group.invitations
Group.issues
Group.issues_statistics
Group.iterations
Group.labels
Group.ldap_group_links
Group.ldap_sync()
Group.member_roles
Group.members
Group.members_all
Group.mergerequests
Group.milestones
Group.notificationsettings
Group.packages
Group.projects
Group.protectedbranches
Group.pushrules
Group.registry_repositories
Group.restore()
Group.runners
Group.saml_group_links
Group.search()
Group.service_accounts
Group.share()
Group.shared_projects
Group.subgroups
Group.transfer()
Group.transfer_project()
Group.unshare()
Group.variables
Group.wikis
GroupAccessRequest
GroupAccessRequestManager
GroupAccessToken
GroupAccessTokenManager
GroupApprovalRule
GroupApprovalRuleManager
GroupAuditEvent
GroupAuditEventManager
GroupBadge
GroupBadgeManager
GroupBillableMember
GroupBillableMemberManager
GroupBillableMemberMembership
GroupBillableMemberMembershipManager
GroupBoard
GroupBoardList
GroupBoardListManager
GroupBoardManager
GroupCluster
GroupClusterManager
GroupCustomAttribute
GroupCustomAttributeManager
GroupDeployToken
GroupDeployTokenManager
GroupDescendantGroup
GroupDescendantGroupManager
GroupEpic
GroupEpicAwardEmoji
GroupEpicAwardEmojiManager
GroupEpicDiscussionNote
GroupEpicDiscussionNoteManager
GroupEpicIssue
GroupEpicIssueManager
GroupEpicManager
GroupEpicNote
GroupEpicNoteAwardEmoji
GroupEpicNoteAwardEmojiManager
GroupEpicNoteManager
GroupEpicResourceLabelEvent
GroupEpicResourceLabelEventManager
GroupExport
GroupExportManager
GroupHook
GroupHookManager
GroupImport
GroupImportManager
GroupInvitation
GroupInvitationManager
GroupIssue
GroupIssueManager
GroupIssuesStatistics
GroupIssuesStatisticsManager
GroupIteration
GroupIterationManager
GroupLDAPGroupLink
GroupLDAPGroupLinkManager
GroupLabel
GroupLabelManager
GroupManager
GroupMember
GroupMemberAll
GroupMemberAllManager
GroupMemberManager
GroupMemberRole
GroupMemberRoleManager
GroupMergeRequest
GroupMergeRequestManager
GroupMilestone
GroupMilestoneManager
GroupNotificationSettings
GroupNotificationSettingsManager
GroupPackage
GroupPackageManager
GroupProject
GroupProjectManager
GroupPushRules
GroupPushRulesManager
GroupRegistryRepositoryManager
GroupRunner
GroupRunnerManager
GroupSAMLGroupLink
GroupSAMLGroupLinkManager
GroupServiceAccount
GroupServiceAccountManager
GroupSubgroup
GroupSubgroupManager
GroupVariable
GroupVariableManager
GroupWiki
GroupWikiManager
Hook
HookManager
Issue
IssueManager
IssuesStatistics
IssuesStatisticsManager
Key
KeyManager
LDAPGroup
LDAPGroupManager
License
LicenseManager
MemberRole
MemberRoleManager
MergeRequest
MergeRequestManager
Namespace
NamespaceManager
NotificationSettings
NotificationSettingsManager
PagesDomain
PagesDomainManager
PersonalAccessToken
PersonalAccessTokenManager
Project
Project.access_tokens
Project.accessrequests
Project.additionalstatistics
Project.approvalrules
Project.approvals
Project.archive()
Project.artifacts
Project.audit_events
Project.badges
Project.boards
Project.branches
Project.ci_lint
Project.cluster_agents
Project.clusters
Project.commits
Project.create_fork_relation()
Project.customattributes
Project.delete_fork_relation()
Project.deployments
Project.deploytokens
Project.dockerfile_templates
Project.environments
Project.events
Project.exports
Project.external_status_checks
Project.files
Project.forks
Project.generic_packages
Project.gitignore_templates
Project.gitlabciyml_templates
Project.groups
Project.hooks
Project.housekeeping()
Project.imports
Project.integrations
Project.invitations
Project.issue_templates
Project.issues
Project.issues_statistics
Project.iterations
Project.job_token_scope
Project.jobs
Project.keys
Project.labels
Project.languages()
Project.license_templates
Project.members
Project.members_all
Project.merge_request_templates
Project.merge_trains
Project.mergerequests
Project.milestones
Project.mirror_pull()
Project.mirror_pull_details()
Project.notes
Project.notificationsettings
Project.package_protection_rules
Project.packages
Project.pages
Project.pagesdomains
Project.pipelines
Project.pipelineschedules
Project.protected_environments
Project.protectedbranches
Project.protectedtags
Project.pull_mirror
Project.pushrules
Project.registry_protection_repository_rules
Project.registry_protection_rules
Project.releases
Project.remote_mirrors
Project.repositories
Project.resource_groups
Project.restore()
Project.runners
Project.search()
Project.secure_files
Project.services
Project.share()
Project.snapshot()
Project.snippets
Project.star()
Project.storage
Project.tags
Project.transfer()
Project.trigger_pipeline()
Project.triggers
Project.unarchive()
Project.unshare()
Project.unstar()
Project.users
Project.variables
Project.wikis
ProjectAccessRequest
ProjectAccessRequestManager
ProjectAccessToken
ProjectAccessTokenManager
ProjectAdditionalStatistics
ProjectAdditionalStatisticsManager
ProjectApproval
ProjectApprovalManager
ProjectApprovalRule
ProjectApprovalRuleManager
ProjectArtifact
ProjectArtifactManager
ProjectAudit
ProjectAuditEvent
ProjectAuditEventManager
ProjectAuditManager
ProjectBadge
ProjectBadgeManager
ProjectBoard
ProjectBoardList
ProjectBoardListManager
ProjectBoardManager
ProjectBranch
ProjectBranchManager
ProjectCiLint
ProjectCiLintManager
ProjectCluster
ProjectClusterAgent
ProjectClusterAgentManager
ProjectClusterManager
ProjectCommit
ProjectCommitComment
ProjectCommitCommentManager
ProjectCommitDiscussion
ProjectCommitDiscussionManager
ProjectCommitDiscussionNote
ProjectCommitDiscussionNoteManager
ProjectCommitManager
ProjectCommitStatus
ProjectCommitStatusManager
ProjectCustomAttribute
ProjectCustomAttributeManager
ProjectDeployToken
ProjectDeployTokenManager
ProjectDeployment
ProjectDeploymentManager
ProjectDeploymentMergeRequest
ProjectDeploymentMergeRequestManager
ProjectDockerfileTemplate
ProjectDockerfileTemplateManager
ProjectEnvironment
ProjectEnvironmentManager
ProjectEvent
ProjectEventManager
ProjectExport
ProjectExportManager
ProjectExternalStatusCheck
ProjectExternalStatusCheckManager
ProjectFile
ProjectFileManager
ProjectFork
ProjectForkManager
ProjectGitignoreTemplate
ProjectGitignoreTemplateManager
ProjectGitlabciymlTemplate
ProjectGitlabciymlTemplateManager
ProjectHook
ProjectHookManager
ProjectImport
ProjectImportManager
ProjectIntegration
ProjectIntegrationManager
ProjectInvitation
ProjectInvitationManager
ProjectIssue
ProjectIssue.awardemojis
ProjectIssue.closed_by()
ProjectIssue.discussions
ProjectIssue.links
ProjectIssue.move()
ProjectIssue.notes
ProjectIssue.related_merge_requests()
ProjectIssue.reorder()
ProjectIssue.resource_iteration_events
ProjectIssue.resource_weight_events
ProjectIssue.resourcelabelevents
ProjectIssue.resourcemilestoneevents
ProjectIssue.resourcestateevents
ProjectIssueAwardEmoji
ProjectIssueAwardEmojiManager
ProjectIssueDiscussion
ProjectIssueDiscussionManager
ProjectIssueDiscussionNote
ProjectIssueDiscussionNoteManager
ProjectIssueLink
ProjectIssueLinkManager
ProjectIssueManager
ProjectIssueNote
ProjectIssueNoteAwardEmoji
ProjectIssueNoteAwardEmojiManager
ProjectIssueNoteManager
ProjectIssueResourceIterationEvent
ProjectIssueResourceIterationEventManager
ProjectIssueResourceLabelEvent
ProjectIssueResourceLabelEventManager
ProjectIssueResourceMilestoneEvent
ProjectIssueResourceMilestoneEventManager
ProjectIssueResourceStateEvent
ProjectIssueResourceStateEventManager
ProjectIssueResourceWeightEvent
ProjectIssueResourceWeightEventManager
ProjectIssueTemplate
ProjectIssueTemplateManager
ProjectIssuesStatistics
ProjectIssuesStatisticsManager
ProjectIterationManager
ProjectJob
ProjectJobManager
ProjectJobTokenScope
ProjectJobTokenScopeManager
ProjectKey
ProjectKeyManager
ProjectLabel
ProjectLabelManager
ProjectLicenseTemplate
ProjectLicenseTemplateManager
ProjectManager
ProjectMember
ProjectMemberAll
ProjectMemberAllManager
ProjectMemberManager
ProjectMergeRequest
ProjectMergeRequest.approval_rules
ProjectMergeRequest.approval_state
ProjectMergeRequest.approvals
ProjectMergeRequest.approve()
ProjectMergeRequest.awardemojis
ProjectMergeRequest.cancel_merge_when_pipeline_succeeds()
ProjectMergeRequest.changes()
ProjectMergeRequest.closes_issues()
ProjectMergeRequest.commits()
ProjectMergeRequest.diffs
ProjectMergeRequest.discussions
ProjectMergeRequest.draft_notes
ProjectMergeRequest.merge()
ProjectMergeRequest.merge_ref()
ProjectMergeRequest.notes
ProjectMergeRequest.pipelines
ProjectMergeRequest.rebase()
ProjectMergeRequest.related_issues()
ProjectMergeRequest.reset_approvals()
ProjectMergeRequest.resourcelabelevents
ProjectMergeRequest.resourcemilestoneevents
ProjectMergeRequest.resourcestateevents
ProjectMergeRequest.reviewer_details
ProjectMergeRequest.status_checks
ProjectMergeRequest.unapprove()
ProjectMergeRequestApproval
ProjectMergeRequestApprovalManager
ProjectMergeRequestApprovalRule
ProjectMergeRequestApprovalRuleManager
ProjectMergeRequestApprovalState
ProjectMergeRequestApprovalStateManager
ProjectMergeRequestAwardEmoji
ProjectMergeRequestAwardEmojiManager
ProjectMergeRequestDiff
ProjectMergeRequestDiffManager
ProjectMergeRequestDiscussion
ProjectMergeRequestDiscussionManager
ProjectMergeRequestDiscussionNote
ProjectMergeRequestDiscussionNoteManager
ProjectMergeRequestDraftNote
ProjectMergeRequestDraftNoteManager
ProjectMergeRequestManager
ProjectMergeRequestNote
ProjectMergeRequestNoteAwardEmoji
ProjectMergeRequestNoteAwardEmojiManager
ProjectMergeRequestNoteManager
ProjectMergeRequestPipeline
ProjectMergeRequestPipelineManager
ProjectMergeRequestResourceLabelEvent
ProjectMergeRequestResourceLabelEventManager
ProjectMergeRequestResourceMilestoneEvent
ProjectMergeRequestResourceMilestoneEventManager
ProjectMergeRequestResourceStateEvent
ProjectMergeRequestResourceStateEventManager
ProjectMergeRequestReviewerDetail
ProjectMergeRequestReviewerDetailManager
ProjectMergeRequestStatusCheck
ProjectMergeRequestStatusCheckManager
ProjectMergeRequestTemplate
ProjectMergeRequestTemplateManager
ProjectMergeTrain
ProjectMergeTrainManager
ProjectMilestone
ProjectMilestoneManager
ProjectNote
ProjectNoteManager
ProjectNotificationSettings
ProjectNotificationSettingsManager
ProjectPackage
ProjectPackageFile
ProjectPackageFileManager
ProjectPackageManager
ProjectPackagePipeline
ProjectPackagePipelineManager
ProjectPackageProtectionRule
ProjectPackageProtectionRuleManager
ProjectPages
ProjectPagesDomain
ProjectPagesDomainManager
ProjectPagesManager
ProjectPipeline
ProjectPipelineBridge
ProjectPipelineBridgeManager
ProjectPipelineJob
ProjectPipelineJobManager
ProjectPipelineManager
ProjectPipelineSchedule
ProjectPipelineScheduleManager
ProjectPipelineSchedulePipeline
ProjectPipelineSchedulePipelineManager
ProjectPipelineScheduleVariable
ProjectPipelineScheduleVariableManager
ProjectPipelineTestReport
ProjectPipelineTestReportManager
ProjectPipelineTestReportSummary
ProjectPipelineTestReportSummaryManager
ProjectPipelineVariable
ProjectPipelineVariableManager
ProjectProtectedBranch
ProjectProtectedBranchManager
ProjectProtectedEnvironment
ProjectProtectedEnvironmentManager
ProjectProtectedTag
ProjectProtectedTagManager
ProjectPullMirror
ProjectPullMirrorManager
ProjectPushRules
ProjectPushRulesManager
ProjectRegistryProtectionRule
ProjectRegistryProtectionRuleManager
ProjectRegistryRepository
ProjectRegistryRepositoryManager
ProjectRegistryRepositoryProtectionRule
ProjectRegistryRepositoryProtectionRuleManager
ProjectRegistryTag
ProjectRegistryTagManager
ProjectRelease
ProjectReleaseLink
ProjectReleaseLinkManager
ProjectReleaseManager
ProjectRemoteMirror
ProjectRemoteMirrorManager
ProjectResourceGroup
ProjectResourceGroupManager
ProjectResourceGroupUpcomingJob
ProjectResourceGroupUpcomingJobManager
ProjectRunner
ProjectRunnerManager
ProjectSecureFile
ProjectSecureFileManager
ProjectService
ProjectServiceManager
ProjectSnippet
ProjectSnippetAwardEmoji
ProjectSnippetAwardEmojiManager
ProjectSnippetDiscussion
ProjectSnippetDiscussionManager
ProjectSnippetDiscussionNote
ProjectSnippetDiscussionNoteManager
ProjectSnippetManager
ProjectSnippetNote
ProjectSnippetNoteAwardEmoji
ProjectSnippetNoteAwardEmojiManager
ProjectSnippetNoteManager
ProjectStorage
ProjectStorageManager
ProjectTag
ProjectTagManager
ProjectTrigger
ProjectTriggerManager
ProjectUser
ProjectUserManager
ProjectVariable
ProjectVariableManager
ProjectWiki
ProjectWikiManager
RegistryRepository
RegistryRepositoryManager
RepositoryMixin
RepositoryMixin.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()
Runner
RunnerAll
RunnerAllManager
RunnerJob
RunnerJobManager
RunnerManager
SharedProject
SharedProjectManager
SidekiqManager
Snippet
SnippetManager
StarredProject
StarredProjectManager
Todo
TodoManager
Topic
TopicManager
User
User.activate()
User.approve()
User.ban()
User.block()
User.contributed_projects
User.customattributes
User.deactivate()
User.emails
User.events
User.follow()
User.followers_users
User.following_users
User.gpgkeys
User.identityproviders
User.impersonationtokens
User.keys
User.memberships
User.personal_access_tokens
User.projects
User.reject()
User.starred_projects
User.status
User.unban()
User.unblock()
User.unfollow()
UserActivities
UserActivitiesManager
UserContributedProject
UserContributedProjectManager
UserCustomAttribute
UserCustomAttributeManager
UserEmail
UserEmailManager
UserEvent
UserEventManager
UserGPGKey
UserGPGKeyManager
UserIdentityProviderManager
UserImpersonationToken
UserImpersonationTokenManager
UserKey
UserKeyManager
UserManager
UserMembership
UserMembershipManager
UserPersonalAccessToken
UserPersonalAccessTokenManager
UserProject
UserProjectManager
UserStatus
UserStatusManager
Variable
VariableManager
overload()
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)Gitlab
Gitlab.api_url
Gitlab.api_version
Gitlab.appearance
Gitlab.applications
Gitlab.audit_events
Gitlab.auth()
Gitlab.broadcastmessages
Gitlab.bulk_import_entities
Gitlab.bulk_imports
Gitlab.ci_lint
Gitlab.deploykeys
Gitlab.deploytokens
Gitlab.dockerfiles
Gitlab.enable_debug()
Gitlab.events
Gitlab.features
Gitlab.from_config()
Gitlab.geonodes
Gitlab.get_license()
Gitlab.gitignores
Gitlab.gitlabciymls
Gitlab.groups
Gitlab.headers
Gitlab.hooks
Gitlab.http_delete()
Gitlab.http_get()
Gitlab.http_head()
Gitlab.http_list()
Gitlab.http_patch()
Gitlab.http_post()
Gitlab.http_put()
Gitlab.http_request()
Gitlab.issues
Gitlab.issues_statistics
Gitlab.keys
Gitlab.ldapgroups
Gitlab.licenses
Gitlab.markdown()
Gitlab.member_roles
Gitlab.merge_config()
Gitlab.mergerequests
Gitlab.namespaces
Gitlab.notificationsettings
Gitlab.pagesdomains
Gitlab.personal_access_tokens
Gitlab.projects
Gitlab.registry_repositories
Gitlab.runners
Gitlab.runners_all
Gitlab.search()
Gitlab.set_license()
Gitlab.settings
Gitlab.sidekiq
Gitlab.snippets
Gitlab.ssl_verify
Gitlab.statistics
Gitlab.timeout
Gitlab.todos
Gitlab.topics
Gitlab.url
Gitlab.user
Gitlab.user_activities
Gitlab.users
Gitlab.variables
Gitlab.version()
GitlabList
GitlabActivateError
GitlabAttachFileError
GitlabAuthenticationError
GitlabBanError
GitlabBlockError
GitlabBuildCancelError
GitlabBuildEraseError
GitlabBuildPlayError
GitlabBuildRetryError
GitlabCancelError
GitlabCherryPickError
GitlabCiLintError
GitlabConnectionError
GitlabCreateError
GitlabDeactivateError
GitlabDeleteError
GitlabDeploymentApprovalError
GitlabError
GitlabFollowError
GitlabGetError
GitlabGroupTransferError
GitlabHeadError
GitlabHookTestError
GitlabHousekeepingError
GitlabHttpError
GitlabImportError
GitlabInvitationError
GitlabJobCancelError
GitlabJobEraseError
GitlabJobPlayError
GitlabJobRetryError
GitlabLicenseError
GitlabListError
GitlabMRApprovalError
GitlabMRClosedError
GitlabMRForbiddenError
GitlabMROnBuildSuccessError
GitlabMRRebaseError
GitlabMRResetApprovalError
GitlabMarkdownError
GitlabOperationError
GitlabOwnershipError
GitlabParsingError
GitlabPipelineCancelError
GitlabPipelinePlayError
GitlabPipelineRetryError
GitlabProjectDeployKeyError
GitlabPromoteError
GitlabProtectError
GitlabRenderError
GitlabRepairError
GitlabRestoreError
GitlabRetryError
GitlabRevertError
GitlabRotateError
GitlabSearchError
GitlabSetError
GitlabStopError
GitlabSubscribeError
GitlabTimeTrackingError
GitlabTodoError
GitlabTopicMergeError
GitlabTransferProjectError
GitlabUnbanError
GitlabUnblockError
GitlabUnfollowError
GitlabUnsubscribeError
GitlabUpdateError
GitlabUploadError
GitlabUserApproveError
GitlabUserRejectError
GitlabVerifyError
RedirectError