Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark mode
python-gitlabv3.0.0
python-gitlabv3.0.0

Table of Contents

API reference (gitlab package)

Module contents

Wrapper for the GitLab API.

classgitlab.Gitlab(url:Optional[str]=None,private_token:Optional[str]=None,oauth_token:Optional[str]=None,job_token:Optional[str]=None,ssl_verify:Union[bool,str]=True,http_username:Optional[str]=None,http_password:Optional[str]=None,timeout:Optional[float]=None,api_version:str='4',session:Optional[requests.sessions.Session]=None,per_page:Optional[int]=None,pagination:Optional[str]=None,order_by:Optional[str]=None,user_agent:str='python-gitlab/3.0.0',retry_transient_errors:bool=False)

Bases:object

Represents a GitLab server connection.

Parameters
  • url (Optional[str]) – The URL of the GitLab server (defaults tohttps://gitlab.com).

  • private_token (Optional[str]) – The user private token

  • oauth_token (Optional[str]) – An oauth token

  • job_token (Optional[str]) – A CI job token

  • ssl_verify (Union[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 (Optional[float]) – Timeout to use for requests to the GitLab server.

  • http_username (Optional[str]) – Username for HTTP authentication

  • http_password (Optional[str]) – Password for HTTP authentication

  • api_version (str) – Gitlab API version to use (support for 4 only)

  • pagination (Optional[str]) – Can be set to ‘keyset’ to use keyset pagination

  • order_by (Optional[str]) – 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, or504 responses. Defaults to False.

  • session (Optional[requests.sessions.Session]) –

  • per_page (Optional[int]) –

Return type

None

propertyapi_url:str

The computed API base URL.

propertyapi_version:str

The API version used (4 only).

appearance

SeeApplicationAppearanceManager

applications

SeeApplicationManager

audit_events

SeeAuditEventManager

auth()None

Performs an authentication using private token.

Theuser attribute will hold agitlab.objects.CurrentUser object onsuccess.

Return type

None

broadcastmessages

SeeBroadcastMessageManager

deploykeys

SeeDeployKeyManager

deploytokens

SeeDeployTokenManager

dockerfiles

SeeDockerfileManager

enable_debug()None
Return type

None

events

SeeEventManager

features

SeeFeatureManager

classmethodfrom_config(gitlab_id:Optional[str]=None,config_files:Optional[List[str]]=None)gitlab.client.Gitlab

Create a Gitlab connection from configuration files.

Parameters
  • gitlab_id (Optional[str]) – ID of the configuration section.

  • list[str] (config_files) – List of paths to configuration files.

  • config_files (Optional[List[str]]) –

Returns

A Gitlab connection.

Raises

gitlab.config.GitlabDataError – If the configuration is not correct.

Return type

gitlab.client.Gitlab

geonodes

SeeGeoNodeManager

get_license(**kwargs:Any)Dict[str,Any]

Retrieve information about the current license.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

The current license information

Return type

Dict[str, Any]

gitignores

SeeGitignoreManager

gitlabciymls

SeeGitlabciymlManager

groups

SeeGroupManager

headers

Headers that will be used in request to GitLab

hooks

SeeHookManager

http_delete(path:str,**kwargs:Any)requests.models.Response

Make a DELETE request to the Gitlab server.

Parameters
  • path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

The requests object.

Raises

GitlabHttpError – When the return code is not 2xx

Return type

requests.models.Response

http_get(path:str,query_data:Optional[Dict[str,Any]]=None,streamed:bool=False,raw:bool=False,**kwargs:Any)Union[Dict[str,Any],requests.models.Response]

Make a GET request to the Gitlab server.

Parameters
  • path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)

  • query_data (Optional[Dict[str,Any]]) – Data to send as query parameters

  • streamed (bool) – Whether the data should be streamed

  • raw (bool) – If True do not try to parse the output as json

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

A requests result object is streamed is True or the content type isnot json.The parsed json data otherwise.

Raises
Return type

Union[Dict[str, Any], requests.models.Response]

http_list(path:str,query_data:Optional[Dict[str,Any]]=None,as_list:Optional[bool]=None,**kwargs:Any)Union[gitlab.client.GitlabList,List[Dict[str,Any]]]

Make a GET request to the Gitlab server for list-oriented queries.

Parameters
  • path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projects’)

  • query_data (Optional[Dict[str,Any]]) – Data to send as query parameters

  • **kwargs – Extra options to send to the server (e.g. sudo, page,per_page)

  • as_list (Optional[bool]) –

  • kwargs (Any) –

Returns

A list of the objects returned by the server. Ifas_list isFalse and no pagination-related arguments (page,per_page,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.

Raises
Return type

Union[gitlab.client.GitlabList, List[Dict[str, Any]]]

http_post(path:str,query_data:Optional[Dict[str,Any]]=None,post_data:Optional[Dict[str,Any]]=None,raw:bool=False,files:Optional[Dict[str,Any]]=None,**kwargs:Any)Union[Dict[str,Any],requests.models.Response]

Make a POST request to the Gitlab server.

Parameters
  • path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)

  • query_data (Optional[Dict[str,Any]]) – Data to send as query parameters

  • post_data (Optional[Dict[str,Any]]) – Data to send in the body (will be converted tojson by default)

  • raw (bool) – If True, do not convert post_data to json

  • files (Optional[Dict[str,Any]]) – The files to send to the server

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

The parsed json returned by the server if json is return, else theraw content

Raises
Return type

Union[Dict[str, Any], requests.models.Response]

http_put(path:str,query_data:Optional[Dict[str,Any]]=None,post_data:Optional[Union[Dict[str,Any],bytes]]=None,raw:bool=False,files:Optional[Dict[str,Any]]=None,**kwargs:Any)Union[Dict[str,Any],requests.models.Response]

Make a PUT request to the Gitlab server.

Parameters
  • path (str) – Path or full URL to query (‘/projects’ or‘http://whatever/v4/api/projecs’)

  • query_data (Optional[Dict[str,Any]]) – Data to send as query parameters

  • post_data (Optional[Union[Dict[str,Any],bytes]]) – Data to send in the body (will be converted tojson by default)

  • raw (bool) – If True, do not convert post_data to json

  • files (Optional[Dict[str,Any]]) – The files to send to the server

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

The parsed json returned by the server.

Raises
Return type

Union[Dict[str, Any], requests.models.Response]

http_request(verb:str,path:str,query_data:Optional[Dict[str,Any]]=None,post_data:Optional[Union[Dict[str,Any],bytes]]=None,raw:bool=False,streamed:bool=False,files:Optional[Dict[str,Any]]=None,timeout:Optional[float]=None,obey_rate_limit:bool=True,max_retries:int=10,**kwargs:Any)requests.models.Response

Make an HTTP request to the Gitlab server.

Parameters
  • 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 (Optional[Dict[str,Any]]) – Data to send as query parameters

  • post_data (Optional[Union[Dict[str,Any],bytes]]) – 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 (Optional[Dict[str,Any]]) – The files to send to the server

  • timeout (Optional[float]) – The timeout, in seconds, for the request

  • obey_rate_limit (bool) – Whether to obey 429 Too Many Requestresponses. Defaults to True.

  • max_retries (int) – Max retries after 429 or transient errors,set to -1 to retry forever. Defaults to 10.

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

A requests result object.

Raises

GitlabHttpError – When the return code is not 2xx

Return type

requests.models.Response

issues

SeeIssueManager

issues_statistics

SeeIssuesStatisticsManager

keys

SeeKeyManager

ldapgroups

SeeLDAPGroupManager

licenses

SeeLicenseManager

lint(content:str,**kwargs:Any)Tuple[bool,List[str]]

Validate a gitlab CI configuration.

Parameters
  • content (str) – The .gitlab-ci.yml content

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

(True, []) if the file is valid, (False, errors(list)) otherwise

Return type

Tuple[bool, List[str]]

markdown(text:str,gfm:bool=False,project:Optional[str]=None,**kwargs:Any)str

Render an arbitrary Markdown document.

Parameters
  • text (str) – The markdown text to render

  • gfm (bool) – Render text using GitLab Flavored Markdown. Default is False

  • project (Optional[str]) – Full path of a project used a context whengfm is True

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

The HTML rendering of the markdown text.

Return type

str

classmethodmerge_config(options:dict,gitlab_id:Optional[str]=None,config_files:Optional[List[str]]=None)gitlab.client.Gitlab

Create a Gitlab connection by merging configuration withthe following precedence:

  1. Explicitly provided CLI arguments,

  2. Environment variables,

  3. Configuration files:
    1. explicitly defined config files:
      1. via the–config-file CLI argument,

      2. via thePYTHON_GITLAB_CFG environment variable,

    2. user-specific config file,

    3. system-level config file,

  4. Environment variables always present in CI (CI_SERVER_URL, CI_JOB_TOKEN).

Parameters
  • options (dict) – A dictionary of explicitly provided key-value options.

  • gitlab_id (Optional[str]) – ID of the configuration section.

  • config_files (Optional[List[str]]) – List of paths to configuration files.

Returns

A Gitlab connection.

Return type

(gitlab.Gitlab)

Raises

gitlab.config.GitlabDataError – If the configuration is not correct.

mergerequests

SeeMergeRequestManager

namespaces

SeeNamespaceManager

notificationsettings

SeeNotificationSettingsManager

pagesdomains

SeePagesDomainManager

personal_access_tokens

SeePersonalAccessTokenManager

projects

SeeProjectManager

runners

SeeRunnerManager

search(scope:str,search:str,**kwargs:Any)Union[gitlab.client.GitlabList,List[Dict[str,Any]]]

Search GitLab resources matching the provided string.’

Parameters
  • scope (str) – Scope of the search

  • search (str) – Search string

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

A list of dicts describing the resources found.

Return type

Union[gitlab.client.GitlabList, List[Dict[str, Any]]]

session

Create a session object for requests

set_license(license:str,**kwargs:Any)Dict[str,Any]

Add a new license.

Parameters
  • license (str) – The license string

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

The new license information

Return type

Dict[str, Any]

settings

SeeApplicationSettingsManager

sidekiq

SeeSidekiqManager

snippets

SeeSnippetManager

ssl_verify

Whether SSL certificates should be validated

timeout

Timeout to use for requests to gitlab server

todos

SeeTodoManager

topics

SeeTopicManager

propertyurl:str

The user-provided server URL.

user_activities

SeeUserActivitiesManager

users

SeeUserManager

variables

SeeVariableManager

version()Tuple[str,str]

Returns the version and revision of the gitlab server.

Note that self.version and self.revision will be set on the gitlabobject.

Returns

The server version and server revision.

(‘unknown’, ‘unknown’) if the server doesn’t perform as expected.

Return type

Tuple[str, str]

classgitlab.GitlabList(gl:gitlab.client.Gitlab,url:str,query_data:Dict[str,Any],get_next:bool=True,**kwargs:Any)

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.

Parameters
  • gl (gitlab.client.Gitlab) –

  • url (str) –

  • query_data (Dict[str,Any]) –

  • get_next (bool) –

  • kwargs (Any) –

Return type

None

propertycurrent_page:int

The current page number.

next()Dict[str,Any]
Return type

Dict[str, Any]

propertynext_page:Optional[int]

The next page number.

If None, the current page is the last.

propertyper_page:int

The number of items per page.

propertyprev_page:Optional[int]

The previous page number.

If None, the current page is the first.

propertytotal:Optional[int]

The total number of items.

propertytotal_pages:Optional[int]

The total number of pages.

Subpackages

Submodules

gitlab.base module

classgitlab.base.RESTManager(gl:gitlab.client.Gitlab,parent:Optional[gitlab.base.RESTObject]=None)

Bases:object

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

Parameters
Return type

None

gitlab:gitlab.client.Gitlab
propertyparent_attrs:Optional[Dict[str,Any]]
propertypath:Optional[str]
classgitlab.base.RESTObject(manager:gitlab.base.RESTManager,attrs:Dict[str,Any],*,created_from_list:bool=False)

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 uniq ID.None means that the object can be updatedwithout ID in the url.

Parameters
Return type

None

propertyattributes:Dict[str,Any]
get_id()Any

Returns the id of the resource.

Return type

Any

manager:gitlab.base.RESTManager
classgitlab.base.RESTObjectList(manager:gitlab.base.RESTManager,obj_cls:Type[gitlab.base.RESTObject],_list:gitlab.client.GitlabList)

Bases:object

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()

Parameters
Return type

None

propertycurrent_page:int

The current page number.

next()gitlab.base.RESTObject
Return type

gitlab.base.RESTObject

propertynext_page:Optional[int]

The next page number.

If None, the current page is the last.

propertyper_page:int

The number of items per page.

propertyprev_page:Optional[int]

The previous page number.

If None, the current page is the first.

propertytotal:Optional[int]

The total number of items.

propertytotal_pages:Optional[int]

The total number of pages.

classgitlab.base.RequiredOptional(required,optional)

Bases:tuple

Parameters
  • required (Tuple[str,...]) –

  • optional (Tuple[str,...]) –

optional:Tuple[str,...]

Alias for field number 1

required:Tuple[str,...]

Alias for field number 0

gitlab.cli module

gitlab.cli.cls_to_what(cls:gitlab.base.RESTObject)str
Parameters

cls (gitlab.base.RESTObject) –

Return type

str

gitlab.cli.die(msg:str,e:Optional[Exception]=None)None
Parameters
  • msg (str) –

  • e (Optional[Exception]) –

Return type

None

gitlab.cli.docs()argparse.ArgumentParser

Provide a statically generated parser for sphinx only, so we don’t needto provide dummy gitlab config for readthedocs.

Return type

argparse.ArgumentParser

gitlab.cli.main()None
Return type

None

gitlab.cli.register_custom_action(cls_names:Union[str,Tuple[str,...]],mandatory:Tuple[str,...]=(),optional:Tuple[str,...]=(),custom_action:Optional[str]=None)Callable[[gitlab.cli.__F],gitlab.cli.__F]
Parameters
  • cls_names (Union[str,Tuple[str,...]]) –

  • mandatory (Tuple[str,...]) –

  • optional (Tuple[str,...]) –

  • custom_action (Optional[str]) –

Return type

Callable[[gitlab.cli.__F], gitlab.cli.__F]

gitlab.cli.what_to_cls(what:str,namespace:module)Type[gitlab.base.RESTObject]
Parameters
  • what (str) –

  • namespace (module) –

Return type

Type[gitlab.base.RESTObject]

gitlab.config module

exceptiongitlab.config.ConfigError

Bases:Exception

exceptiongitlab.config.GitlabConfigHelperError

Bases:gitlab.config.ConfigError

exceptiongitlab.config.GitlabConfigMissingError

Bases:gitlab.config.ConfigError

classgitlab.config.GitlabConfigParser(gitlab_id:Optional[str]=None,config_files:Optional[List[str]]=None)

Bases:object

Parameters
  • gitlab_id (Optional[str]) –

  • config_files (Optional[List[str]]) –

Return type

None

exceptiongitlab.config.GitlabDataError

Bases:gitlab.config.ConfigError

exceptiongitlab.config.GitlabIDError

Bases:gitlab.config.ConfigError

gitlab.const module

gitlab.exceptions module

exceptiongitlab.exceptions.GitlabActivateError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabAttachFileError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabAuthenticationError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabBlockError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabBuildCancelError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabCancelError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabBuildEraseError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabRetryError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabBuildPlayError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabRetryError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabBuildRetryError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabRetryError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabCancelError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabCherryPickError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabConnectionError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabCreateError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabDeactivateError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabDeleteError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:Exception

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabFollowError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabGetError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabHousekeepingError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabHttpError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabImportError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabJobCancelError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabCancelError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabJobEraseError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabRetryError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabJobPlayError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabRetryError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabJobRetryError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabRetryError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabLicenseError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabListError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabMRApprovalError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabMRClosedError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabMRForbiddenError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabMROnBuildSuccessError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabMRRebaseError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabMarkdownError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabOperationError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabOwnershipError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabParsingError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabPipelineCancelError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabCancelError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabPipelinePlayError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabRetryError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabPipelineRetryError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabRetryError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabProjectDeployKeyError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabPromoteError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabProtectError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabRenderError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabRepairError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabRetryError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabRevertError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabSearchError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabSetError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabStopError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabSubscribeError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabTimeTrackingError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabTodoError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabTransferProjectError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabUnblockError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabUnfollowError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabUnsubscribeError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabUpdateError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabUploadError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.GitlabVerifyError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabOperationError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

exceptiongitlab.exceptions.RedirectError(error_message:Union[str,bytes]='',response_code:Optional[int]=None,response_body:Optional[bytes]=None)

Bases:gitlab.exceptions.GitlabError

Parameters
  • error_message (Union[str,bytes]) –

  • response_code (Optional[int]) –

  • response_body (Optional[bytes]) –

Return type

None

gitlab.exceptions.on_http_error(error:Type[Exception])Callable[[gitlab.exceptions.__F],gitlab.exceptions.__F]

Manage GitlabHttpError exceptions.

This decorator function can be used to catch GitlabHttpError exceptionsraise specialized exceptions instead.

Parameters
  • GitlabError (The exception type to raise -- must inherit from) –

  • error (Type[Exception]) –

Return type

Callable[[gitlab.exceptions.__F], gitlab.exceptions.__F]

gitlab.mixins module

classgitlab.mixins.AccessRequestMixin

Bases:object

approve(access_level:int=30,**kwargs:Any)None

Approve an access request.

Parameters
  • access_level (int) – The access level for the user

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

None

manager:gitlab.base.RESTManager
classgitlab.mixins.BadgeRenderMixin

Bases:object

render(link_url:str,image_url:str,**kwargs:Any)Dict[str,Any]

Preview link_url and image_url after interpolation.

Parameters
  • link_url (str) – URL of the badge link

  • image_url (str) – URL of the badge image

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

The rendering properties

Return type

Dict[str, Any]

classgitlab.mixins.CRUDMixin

Bases:gitlab.mixins.GetMixin,gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin

gitlab:gitlab.client.Gitlab
classgitlab.mixins.CreateMixin

Bases:object

create(data:Optional[Dict[str,Any]]=None,**kwargs:Any)gitlab.base.RESTObject

Create a new object.

Parameters
  • data (Optional[Dict[str,Any]]) – parameters to send to the server to create theresource

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

A new instance of the managed object class built with

the data sent by the server

Raises
Return type

gitlab.base.RESTObject

gitlab:gitlab.client.Gitlab
classgitlab.mixins.DeleteMixin

Bases:object

delete(id:Union[str,int],**kwargs:Any)None

Delete an object on the server.

Parameters
  • id (Union[str,int]) – ID of the object to delete

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

None

gitlab:gitlab.client.Gitlab
classgitlab.mixins.DownloadMixin

Bases:object

download(streamed:bool=False,action:Optional[Callable]=None,chunk_size:int=1024,**kwargs:Any)Optional[bytes]

Download the archive of a resource export.

Parameters
  • streamed (bool) – If True the data will be processed by chunks ofchunk_size and each chunk is passed toaction fortreatment

  • action (Optional[Callable]) – Callable responsible of dealing with chunk ofdata

  • chunk_size (int) – Size of each chunk

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

The blob content if streamed is False, None otherwise

Return type

Optional[bytes]

manager:gitlab.base.RESTManager
classgitlab.mixins.GetMixin

Bases:object

get(id:Union[str,int],lazy:bool=False,**kwargs:Any)gitlab.base.RESTObject

Retrieve a single object.

Parameters
  • id (Union[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 – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
Return type

gitlab.base.RESTObject

gitlab:gitlab.client.Gitlab
classgitlab.mixins.GetWithoutIdMixin

Bases:object

get(id:Optional[Union[int,str]]=None,**kwargs:Any)Optional[gitlab.base.RESTObject]

Retrieve a single object.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • id (Optional[Union[int,str]]) –

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
Return type

Optional[gitlab.base.RESTObject]

gitlab:gitlab.client.Gitlab
classgitlab.mixins.ListMixin

Bases:object

gitlab:gitlab.client.Gitlab
list(**kwargs:Any)Union[gitlab.base.RESTObjectList,List[gitlab.base.RESTObject]]

Retrieve a list of objects.

Parameters
  • 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)

  • as_list – If set to False and no pagination option isdefined, return a generator instead of a list

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

The list of objects, or a generator ifas_list is False

Raises
Return type

Union[gitlab.base.RESTObjectList, List[gitlab.base.RESTObject]]

classgitlab.mixins.NoUpdateMixin

Bases:gitlab.mixins.GetMixin,gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin

gitlab:gitlab.client.Gitlab
classgitlab.mixins.ObjectDeleteMixin

Bases:object

Mixin for RESTObject’s that can be deleted.

delete(**kwargs:Any)None

Delete the object from the server.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

None

manager:gitlab.base.RESTManager
classgitlab.mixins.ParticipantsMixin

Bases:object

manager:gitlab.base.RESTManager
participants(**kwargs:Any)Dict[str,Any]

List the participants.

Parameters
  • 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)

  • as_list – If set to False and no pagination option isdefined, return a generator instead of a list

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

The list of participants

Return type

Dict[str, Any]

classgitlab.mixins.RefreshMixin

Bases:object

manager:gitlab.base.RESTManager
refresh(**kwargs:Any)None

Refresh a single object from server.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Return type

None

Returns None (updates the object)

Raises
Parameters

kwargs (Any) –

Return type

None

classgitlab.mixins.RetrieveMixin

Bases:gitlab.mixins.ListMixin,gitlab.mixins.GetMixin

gitlab:gitlab.client.Gitlab
classgitlab.mixins.SaveMixin

Bases:object

Mixin for RESTObject’s that can be updated.

manager:gitlab.base.RESTManager
save(**kwargs:Any)None

Save the changes made to the object to the server.

The object is updated to match what the server returns.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

None

classgitlab.mixins.SetMixin

Bases:object

gitlab:gitlab.client.Gitlab
set(key:str,value:str,**kwargs:Any)gitlab.base.RESTObject

Create or update the object.

Parameters
  • key (str) – The key of the object to create/update

  • value (str) – The value to set for the object

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Returns

The created/updated attribute

Return type

gitlab.base.RESTObject

classgitlab.mixins.SubscribableMixin

Bases:object

manager:gitlab.base.RESTManager
subscribe(**kwargs:Any)None

Subscribe to the object notifications.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

None

unsubscribe(**kwargs:Any)None

Unsubscribe from the object notifications.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

None

classgitlab.mixins.TimeTrackingMixin

Bases:object

add_spent_time(duration:str,**kwargs:Any)Dict[str,Any]

Add time spent working on the object.

Parameters
  • duration (str) – Duration in human format (e.g. 3h30)

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

Dict[str, Any]

manager:gitlab.base.RESTManager
reset_spent_time(**kwargs:Any)Dict[str,Any]

Resets the time spent working on the object.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

Dict[str, Any]

reset_time_estimate(**kwargs:Any)Dict[str,Any]

Resets estimated time for the object to 0 seconds.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

Dict[str, Any]

time_estimate(duration:str,**kwargs:Any)Dict[str,Any]

Set an estimated time of work for the object.

Parameters
  • duration (str) – Duration in human format (e.g. 3h30)

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

Dict[str, Any]

time_stats(**kwargs:Any)Dict[str,Any]

Get time stats for the object.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

Dict[str, Any]

classgitlab.mixins.TodoMixin

Bases:object

manager:gitlab.base.RESTManager
todo(**kwargs:Any)None

Create a todo associated to the object.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

None

classgitlab.mixins.UpdateMixin

Bases:object

gitlab:gitlab.client.Gitlab
update(id:Optional[Union[int,str]]=None,new_data:Optional[Dict[str,Any]]=None,**kwargs:Any)Dict[str,Any]

Update an object on the server.

Parameters
  • id (Optional[Union[int,str]]) – ID of the object to update (can be None if not required)

  • new_data (Optional[Dict[str,Any]]) – the update data for the object

  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Returns

The new object data (not a RESTObject)

Raises
Return type

Dict[str, Any]

classgitlab.mixins.UserAgentDetailMixin

Bases:object

manager:gitlab.base.RESTManager
user_agent_detail(**kwargs:Any)Dict[str,Any]

Get the user agent detail.

Parameters
  • **kwargs – Extra options to send to the server (e.g. sudo)

  • kwargs (Any) –

Raises
Return type

Dict[str, Any]

gitlab.utils module

gitlab.utils.clean_str_id(id:str)str
Parameters

id (str) –

Return type

str

gitlab.utils.copy_dict(dest:Dict[str,Any],src:Dict[str,Any])None
Parameters
  • dest (Dict[str,Any]) –

  • src (Dict[str,Any]) –

Return type

None

gitlab.utils.remove_none_from_dict(data:Dict[str,Any])Dict[str,Any]
Parameters

data (Dict[str,Any]) –

Return type

Dict[str, Any]

gitlab.utils.response_content(response:requests.models.Response,streamed:bool,action:Optional[Callable],chunk_size:int)Optional[bytes]
Parameters
  • response (requests.models.Response) –

  • streamed (bool) –

  • action (Optional[Callable]) –

  • chunk_size (int) –

Return type

Optional[bytes]

Contents

[8]ページ先頭

©2009-2025 Movatter.jp