gitlab.v4 package

Submodules

gitlab.v4.objects module

class gitlab.v4.objects.Application(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ApplicationAppearance(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ApplicationAppearanceManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object Creation

Object update

Optional attributes for object update:

  • title

  • description

  • logo

  • header_logo

  • favicon

  • new_project_guidelines

  • header_message

  • footer_message

  • message_background_color

  • message_font_color

  • email_header_and_footer_enabled

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.appearance.ApplicationAppearance

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.appearance.ApplicationAppearance

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
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the server cannot perform the request

Return type

Dict[str, Any]

class gitlab.v4.objects.ApplicationManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • redirect_uri

  • scopes

Optional attributes for object create:

  • confidential

Object update

Parameters
Return type

None

class gitlab.v4.objects.ApplicationSettings(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ApplicationSettingsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object Creation

Object update

Optional attributes for object update:

  • id

  • default_projects_limit

  • signup_enabled

  • password_authentication_enabled_for_web

  • gravatar_enabled

  • sign_in_text

  • created_at

  • updated_at

  • home_page_url

  • default_branch_protection

  • restricted_visibility_levels

  • max_attachment_size

  • session_expire_delay

  • default_project_visibility

  • default_snippet_visibility

  • default_group_visibility

  • outbound_local_requests_whitelist

  • disabled_oauth_sign_in_sources

  • domain_whitelist

  • domain_blacklist_enabled

  • domain_blacklist

  • domain_allowlist

  • domain_denylist_enabled

  • domain_denylist

  • external_authorization_service_enabled

  • external_authorization_service_url

  • external_authorization_service_default_label

  • external_authorization_service_timeout

  • import_sources

  • user_oauth_applications

  • after_sign_out_path

  • container_registry_token_expire_delay

  • repository_storages

  • plantuml_enabled

  • plantuml_url

  • terminal_max_session_time

  • polling_interval_multiplier

  • rsa_key_restriction

  • dsa_key_restriction

  • ecdsa_key_restriction

  • ed25519_key_restriction

  • first_day_of_week

  • enforce_terms

  • terms

  • performance_bar_allowed_group_id

  • instance_statistics_visibility_private

  • user_show_add_ssh_key_message

  • file_template_project_id

  • local_markdown_version

  • asset_proxy_enabled

  • asset_proxy_url

  • asset_proxy_whitelist

  • asset_proxy_allowlist

  • geo_node_allowed_ips

  • allow_local_requests_from_hooks_and_services

  • allow_local_requests_from_web_hooks_and_services

  • allow_local_requests_from_system_hooks

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.settings.ApplicationSettings

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.settings.ApplicationSettings

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
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the server cannot perform the request

Return type

Dict[str, Any]

class gitlab.v4.objects.ApplicationStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ApplicationStatisticsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.statistics.ApplicationStatistics

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.statistics.ApplicationStatistics

class gitlab.v4.objects.AuditEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.AuditEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object listing filters

  • created_after

  • created_before

  • entity_type

  • entity_id

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.audit_events.AuditEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.audit_events.AuditEvent

class gitlab.v4.objects.BroadcastMessage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.BroadcastMessageManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • message

Optional attributes for object create:

  • starts_at

  • ends_at

  • color

  • font

  • target_access_levels

Object update

Optional attributes for object update:

  • message

  • starts_at

  • ends_at

  • color

  • font

  • target_access_levels

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.broadcast_messages.BroadcastMessage

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.broadcast_messages.BroadcastMessage

class gitlab.v4.objects.CiLint(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.CiLintManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • content

Optional attributes for object create:

  • include_merged_yaml

  • include_jobs

Object update

Parameters
Return type

None

validate(*args: Any, **kwargs: Any) None

Raise an error if the CI Lint results are not valid.

This is a custom python-gitlab method to wrap lint endpoints.

Parameters
  • args (Any) –

  • kwargs (Any) –

Return type

None

class gitlab.v4.objects.CurrentUser(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

emails: gitlab.v4.objects.users.CurrentUserEmailManager
gpgkeys: gitlab.v4.objects.users.CurrentUserGPGKeyManager
keys: gitlab.v4.objects.users.CurrentUserKeyManager
status: gitlab.v4.objects.users.CurrentUserStatusManager
class gitlab.v4.objects.CurrentUserEmail(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.CurrentUserEmailManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • email

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.CurrentUserEmail

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.CurrentUserEmail

class gitlab.v4.objects.CurrentUserGPGKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.CurrentUserGPGKeyManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • key

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.CurrentUserGPGKey

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.CurrentUserGPGKey

class gitlab.v4.objects.CurrentUserKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.CurrentUserKeyManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • title

  • key

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.CurrentUserKey

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.CurrentUserKey

class gitlab.v4.objects.CurrentUserManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.users.CurrentUser

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.CurrentUser

class gitlab.v4.objects.CurrentUserStatus(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.CurrentUserStatusManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object Creation

Object update

Optional attributes for object update:

  • emoji

  • message

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.users.CurrentUserStatus

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.CurrentUserStatus

class gitlab.v4.objects.DeployKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.DeployKeyManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.DeployToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.DeployTokenManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.Dockerfile(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.DockerfileManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.templates.Dockerfile

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.templates.Dockerfile

class gitlab.v4.objects.Event(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.EventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • action

  • target_type

  • before

  • after

  • sort

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.Feature(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.FeatureManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

set(name: str, value: Union[bool, int], feature_group: Optional[str] = None, user: Optional[str] = None, group: Optional[str] = None, project: Optional[str] = None, **kwargs: Any) gitlab.v4.objects.features.Feature

Create or update the object.

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

  • value (Union[bool, int]) – The value to set for the object

  • feature_group (Optional[str]) – A feature group name

  • user (Optional[str]) – A GitLab username

  • group (Optional[str]) – A GitLab group

  • project (Optional[str]) – A GitLab project in form group/project

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabSetError – If an error occurred

Returns

The created/updated attribute

Return type

gitlab.v4.objects.features.Feature

class gitlab.v4.objects.GenericPackage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GenericPackageManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

download(package_name: str, package_version: str, file_name: str, streamed: bool = False, action: Optional[Callable[[bytes], None]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Download a generic package.

Parameters
  • package_name (str) – The package name.

  • package_version (str) – The package version.

  • file_name (str) – The name of the file in the registry

  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[bytes], None]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The package content if streamed is False, None otherwise

Return type

Optional[Union[bytes, Iterator[Any]]]

upload(package_name: str, package_version: str, file_name: str, path: Union[str, pathlib.Path], **kwargs: Any) gitlab.v4.objects.packages.GenericPackage

Upload a file as a generic package.

Parameters
  • package_name (str) – The package name. Must follow generic package name regex rules

  • package_version (str) – The package version. Must follow semantic version regex rules

  • file_name (str) – The name of the file as uploaded in the registry

  • path (Union[str, pathlib.Path]) – The path to a local file to upload

  • kwargs (Any) –

Raises
  • GitlabConnectionError – If the server cannot be reached

  • GitlabUploadError – If the file upload fails

  • GitlabUploadError – If filepath cannot be read

Returns

An object storing the metadata of the uploaded package.

Return type

gitlab.v4.objects.packages.GenericPackage

https://docs.gitlab.com/ee/user/packages/generic_packages/

class gitlab.v4.objects.GeoNode(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

repair(**kwargs: Any) None

Repair the OAuth authentication of the geo node.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabRepairError – If the server failed to perform the request

Return type

None

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

Get the status of the geo node.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The status of the geo node

Return type

Dict[str, Any]

class gitlab.v4.objects.GeoNodeManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Object update

Optional attributes for object update:

  • enabled

  • url

  • files_max_capacity

  • repos_max_capacity

Parameters
Return type

None

current_failures(**kwargs: Any) List[Dict[str, Any]]

Get the list of failures on the current geo node.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The list of failures

Return type

List[Dict[str, Any]]

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.geo_nodes.GeoNode

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.geo_nodes.GeoNode

status(**kwargs: Any) List[Dict[str, Any]]

Get the status of all the geo nodes.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The status of all the geo nodes

Return type

List[Dict[str, Any]]

class gitlab.v4.objects.Gitignore(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GitignoreManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.templates.Gitignore

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.templates.Gitignore

class gitlab.v4.objects.Gitlabciyml(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GitlabciymlManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.templates.Gitlabciyml

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.templates.Gitlabciyml

class gitlab.v4.objects.Group(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

access_tokens: gitlab.v4.objects.group_access_tokens.GroupAccessTokenManager
accessrequests: gitlab.v4.objects.access_requests.GroupAccessRequestManager

Add an LDAP group link.

Parameters
  • cn (str) – CN of the LDAP group

  • group_access (int) – Minimum access level for members of the LDAP group

  • provider (str) – LDAP provider for the LDAP group

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Return type

None

audit_events: gitlab.v4.objects.audit_events.GroupAuditEventManager
badges: gitlab.v4.objects.badges.GroupBadgeManager
billable_members: gitlab.v4.objects.members.GroupBillableMemberManager
boards: gitlab.v4.objects.boards.GroupBoardManager
clusters: gitlab.v4.objects.clusters.GroupClusterManager
customattributes: gitlab.v4.objects.custom_attributes.GroupCustomAttributeManager

Delete an LDAP group link.

Parameters
  • cn (str) – CN of the LDAP group

  • provider (Optional[str]) – LDAP provider for the LDAP group

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server cannot perform the request

Return type

None

deploytokens: gitlab.v4.objects.deploy_tokens.GroupDeployTokenManager
descendant_groups: GroupDescendantGroupManager
epics: gitlab.v4.objects.epics.GroupEpicManager
exports: gitlab.v4.objects.export_import.GroupExportManager
hooks: gitlab.v4.objects.hooks.GroupHookManager
imports: gitlab.v4.objects.export_import.GroupImportManager
invitations: gitlab.v4.objects.invitations.GroupInvitationManager
issues: gitlab.v4.objects.issues.GroupIssueManager
issues_statistics: gitlab.v4.objects.statistics.GroupIssuesStatisticsManager
iterations: gitlab.v4.objects.iterations.GroupIterationManager
labels: gitlab.v4.objects.labels.GroupLabelManager
ldap_sync(**kwargs: Any) None

Sync LDAP groups.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Return type

None

members: gitlab.v4.objects.members.GroupMemberManager
members_all: gitlab.v4.objects.members.GroupMemberAllManager
mergerequests: gitlab.v4.objects.merge_requests.GroupMergeRequestManager
milestones: gitlab.v4.objects.milestones.GroupMilestoneManager
notificationsettings: gitlab.v4.objects.notification_settings.GroupNotificationSettingsManager
packages: gitlab.v4.objects.packages.GroupPackageManager
projects: gitlab.v4.objects.projects.GroupProjectManager
pushrules: gitlab.v4.objects.push_rules.GroupPushRulesManager
registry_repositories: gitlab.v4.objects.container_registry.GroupRegistryRepositoryManager
runners: gitlab.v4.objects.runners.GroupRunnerManager
search(scope: str, search: str, **kwargs: Any) Union[gitlab.client.GitlabList, List[Dict[str, Any]]]

Search the group 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
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabSearchError – If the server failed to perform the request

Returns

A list of dicts describing the resources found.

Return type

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

share(group_id: int, group_access: int, expires_at: Optional[str] = None, **kwargs: Any) None

Share the group with a group.

Parameters
  • group_id (int) – ID of the group.

  • group_access (int) – Access level for the group.

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

  • expires_at (Optional[str]) –

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Returns

Group

Return type

None

shared_projects: gitlab.v4.objects.projects.SharedProjectManager
subgroups: GroupSubgroupManager
transfer(group_id: Optional[int] = None, **kwargs: Any) None

Transfer the group to a new parent group or make it a top-level group.

Requires GitLab ≥14.6.

Parameters
  • group_id (Optional[int]) – ID of the new parent group. When not specified, the group to transfer is instead turned into a top-level group.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGroupTransferError – If the group could not be transferred

Return type

None

transfer_project(project_id: int, **kwargs: Any) None

Transfer a project to this group.

Parameters
  • to_project_id – ID of the project to transfer

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

  • project_id (int) –

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabTransferProjectError – If the project could not be transferred

Return type

None

unshare(group_id: int, **kwargs: Any) None

Delete a shared group link within a group.

Parameters
  • group_id (int) – ID of the group.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type

None

variables: gitlab.v4.objects.variables.GroupVariableManager
wikis: gitlab.v4.objects.wikis.GroupWikiManager
class gitlab.v4.objects.GroupAccessRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.AccessRequestMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupAccessRequestManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupAccessToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupAccessTokenManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • scopes

Optional attributes for object create:

  • access_level

  • expires_at

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupAuditEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupAuditEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.audit_events.GroupAuditEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.audit_events.GroupAuditEvent

class gitlab.v4.objects.GroupBadge(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupBadgeManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.BadgeRenderMixin, gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • link_url

  • image_url

Object update

Optional attributes for object update:

  • link_url

  • image_url

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.badges.GroupBadge

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.badges.GroupBadge

class gitlab.v4.objects.GroupBillableMember(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

memberships: GroupBillableMemberMembershipManager
class gitlab.v4.objects.GroupBillableMemberManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object listing filters

  • search

  • sort

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupBillableMemberMembership(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupBillableMemberMembershipManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupBoard(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

lists: gitlab.v4.objects.boards.GroupBoardListManager
class gitlab.v4.objects.GroupBoardList(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupBoardListManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Mutually exclusive attributes for object create:

  • label_id

  • assignee_id

  • milestone_id

Object update

Required attributes for object update:

  • position

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.boards.GroupBoardList

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.boards.GroupBoardList

class gitlab.v4.objects.GroupBoardManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.boards.GroupBoard

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.boards.GroupBoard

class gitlab.v4.objects.GroupCluster(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupClusterManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • platform_kubernetes_attributes

Optional attributes for object create:

  • domain

  • enabled

  • managed

  • environment_scope

Object update

Optional attributes for object update:

  • name

  • domain

  • management_project_id

  • platform_kubernetes_attributes

  • environment_scope

Parameters
Return type

None

create(data: Optional[Dict[str, Any]] = None, **kwargs: Any) gitlab.v4.objects.clusters.GroupCluster

Create a new object.

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

  • **kwargs – Extra options to send to the server (e.g. sudo or ‘ref_name’, ‘stage’, ‘name’, ‘all’)

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Returns

A new instance of the manage object class build with

the data sent by the server

Return type

gitlab.v4.objects.clusters.GroupCluster

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.clusters.GroupCluster

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.clusters.GroupCluster

class gitlab.v4.objects.GroupCustomAttribute(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupCustomAttributeManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.SetMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.custom_attributes.GroupCustomAttribute

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.custom_attributes.GroupCustomAttribute

class gitlab.v4.objects.GroupDeployToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupDeployTokenManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object listing filters

  • scopes

Object Creation

Required attributes for object create:

  • name

  • scopes

Optional attributes for object create:

  • expires_at

  • username

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.deploy_tokens.GroupDeployToken

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.deploy_tokens.GroupDeployToken

class gitlab.v4.objects.GroupDescendantGroup(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupDescendantGroupManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.groups.GroupSubgroupManager

This manager inherits from GroupSubgroupManager as descendant groups share all attributes with subgroups, except the path and object class.

Object listing filters

  • skip_groups

  • all_available

  • search

  • order_by

  • sort

  • statistics

  • owned

  • with_custom_attributes

  • min_access_level

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupEpic(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

issues: GroupEpicIssueManager
notes: gitlab.v4.objects.notes.GroupEpicNoteManager
resourcelabelevents: gitlab.v4.objects.events.GroupEpicResourceLabelEventManager
class gitlab.v4.objects.GroupEpicAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupEpicAwardEmojiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.award_emojis.GroupEpicAwardEmoji

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.award_emojis.GroupEpicAwardEmoji

class gitlab.v4.objects.GroupEpicDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupEpicDiscussionNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.GroupEpicDiscussionNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.GroupEpicDiscussionNote

class gitlab.v4.objects.GroupEpicIssue(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

manager: GroupEpicIssueManager
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
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the server cannot perform the request

Return type

None

class gitlab.v4.objects.GroupEpicIssueManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • issue_id

Object update

Optional attributes for object update:

  • move_before_id

  • move_after_id

Parameters
Return type

None

create(data: Optional[Dict[str, Any]] = None, **kwargs: Any) gitlab.v4.objects.epics.GroupEpicIssue

Create a new object.

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

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Returns

A new instance of the manage object class build with

the data sent by the server

Return type

gitlab.v4.objects.epics.GroupEpicIssue

class gitlab.v4.objects.GroupEpicManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • author_id

  • labels

  • order_by

  • sort

  • search

Object Creation

Required attributes for object create:

  • title

Optional attributes for object create:

  • labels

  • description

  • start_date

  • end_date

Object update

Optional attributes for object update:

  • title

  • labels

  • description

  • start_date

  • end_date

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.epics.GroupEpic

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.epics.GroupEpic

class gitlab.v4.objects.GroupEpicNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

awardemojis: gitlab.v4.objects.award_emojis.GroupEpicNoteAwardEmojiManager
class gitlab.v4.objects.GroupEpicNoteAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupEpicNoteAwardEmojiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.award_emojis.GroupEpicNoteAwardEmoji

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.award_emojis.GroupEpicNoteAwardEmoji

class gitlab.v4.objects.GroupEpicNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.GroupEpicNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.GroupEpicNote

class gitlab.v4.objects.GroupEpicResourceLabelEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupEpicResourceLabelEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.events.GroupEpicResourceLabelEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.events.GroupEpicResourceLabelEvent

class gitlab.v4.objects.GroupExport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.DownloadMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupExportManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.export_import.GroupExport

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.export_import.GroupExport

class gitlab.v4.objects.GroupHook(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupHookManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • url

Optional attributes for object create:

  • push_events

  • issues_events

  • confidential_issues_events

  • merge_requests_events

  • tag_push_events

  • note_events

  • confidential_note_events

  • job_events

  • pipeline_events

  • wiki_page_events

  • deployment_events

  • releases_events

  • subgroup_events

  • enable_ssl_verification

  • token

Object update

Required attributes for object update:

  • url

Optional attributes for object update:

  • push_events

  • issues_events

  • confidential_issues_events

  • merge_requests_events

  • tag_push_events

  • note_events

  • confidential_note_events

  • job_events

  • pipeline_events

  • wiki_page_events

  • deployment_events

  • releases_events

  • subgroup_events

  • enable_ssl_verification

  • token

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.hooks.GroupHook

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.hooks.GroupHook

class gitlab.v4.objects.GroupImport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupImportManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.export_import.GroupImport

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.export_import.GroupImport

class gitlab.v4.objects.GroupInvitation(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupInvitationManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.invitations.InvitationMixin, gitlab.base.RESTManager

Object listing filters

  • query

Object Creation

Required attributes for object create:

  • access_level

Optional attributes for object create:

  • expires_at

  • invite_source

  • tasks_to_be_done

  • tasks_project_id

Mutually exclusive attributes for object create:

  • email

  • user_id

Object update

Optional attributes for object update:

  • access_level

  • expires_at

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.invitations.GroupInvitation

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.invitations.GroupInvitation

class gitlab.v4.objects.GroupIssue(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupIssueManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • state

  • labels

  • milestone

  • order_by

  • sort

  • iids

  • author_id

  • assignee_id

  • my_reaction_emoji

  • search

  • created_after

  • created_before

  • updated_after

  • updated_before

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupIssuesStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupIssuesStatisticsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object listing filters

  • iids

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.statistics.GroupIssuesStatistics

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.statistics.GroupIssuesStatistics

class gitlab.v4.objects.GroupIteration(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupIterationManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • state

  • search

  • include_ancestors

Object Creation

Object update

Parameters
Return type

None

Bases: gitlab.base.RESTObject

Parameters
Return type

None

delete(**kwargs: Any) None

Delete the LDAP group link from the server.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server cannot perform the request

Return type

None

class gitlab.v4.objects.GroupLDAPGroupLinkManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • provider

  • group_access

Mutually exclusive attributes for object create:

  • cn

  • filter

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupLabel(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SubscribableMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

manager: GroupLabelManager
save(**kwargs: Any) None

Saves 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
  • GitlabAuthenticationError – If authentication is not correct.

  • GitlabUpdateError – If the server cannot perform the request.

Return type

None

class gitlab.v4.objects.GroupLabelManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • color

Optional attributes for object create:

  • description

  • priority

Object update

Required attributes for object update:

  • name

Optional attributes for object update:

  • new_name

  • color

  • description

  • priority

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.labels.GroupLabel

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.labels.GroupLabel

update(name: Optional[str], new_data: Optional[Dict[str, Any]] = None, **kwargs: Any) Dict[str, Any]

Update a Label on the server.

Parameters
  • name (Optional[str]) – The name of the label

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

  • new_data (Optional[Dict[str, Any]]) –

  • kwargs (Any) –

Return type

Dict[str, Any]

class gitlab.v4.objects.GroupManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • skip_groups

  • all_available

  • search

  • order_by

  • sort

  • statistics

  • owned

  • with_custom_attributes

  • min_access_level

  • top_level_only

Object Creation

Required attributes for object create:

  • name

  • path

Optional attributes for object create:

  • description

  • membership_lock

  • visibility

  • share_with_group_lock

  • require_two_factor_authentication

  • two_factor_grace_period

  • project_creation_level

  • auto_devops_enabled

  • subgroup_creation_level

  • emails_disabled

  • avatar

  • mentions_disabled

  • lfs_enabled

  • request_access_enabled

  • parent_id

  • default_branch_protection

  • shared_runners_minutes_limit

  • extra_shared_runners_minutes_limit

Object update

Optional attributes for object update:

  • name

  • path

  • description

  • membership_lock

  • share_with_group_lock

  • visibility

  • require_two_factor_authentication

  • two_factor_grace_period

  • project_creation_level

  • auto_devops_enabled

  • subgroup_creation_level

  • emails_disabled

  • avatar

  • mentions_disabled

  • lfs_enabled

  • request_access_enabled

  • default_branch_protection

  • file_template_project_id

  • shared_runners_minutes_limit

  • extra_shared_runners_minutes_limit

  • prevent_forking_outside_group

  • shared_runners_setting

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.groups.Group

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.groups.Group

import_group(file: BinaryIO, path: str, name: str, parent_id: Optional[str] = None, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Import a group from an archive file.

Parameters
  • file (BinaryIO) – Data or file object containing the group

  • path (str) – The path for the new group to be imported.

  • name (str) – The name for the new group.

  • parent_id (Optional[str]) – ID of a parent group that the group will be imported into.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabImportError – If the server failed to perform the request

Returns

A representation of the import status.

Return type

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

class gitlab.v4.objects.GroupMember(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupMemberAll(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupMemberAllManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.members.GroupMemberAll

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.members.GroupMemberAll

class gitlab.v4.objects.GroupMemberManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • access_level

  • user_id

Optional attributes for object create:

  • expires_at

  • tasks_to_be_done

Object update

Required attributes for object update:

  • access_level

Optional attributes for object update:

  • expires_at

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.members.GroupMember

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.members.GroupMember

class gitlab.v4.objects.GroupMergeRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupMergeRequestManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • state

  • order_by

  • sort

  • milestone

  • view

  • labels

  • created_after

  • created_before

  • updated_after

  • updated_before

  • scope

  • author_id

  • assignee_id

  • approver_ids

  • approved_by_ids

  • my_reaction_emoji

  • source_branch

  • target_branch

  • search

  • wip

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupMilestone(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

issues(**kwargs: Any) gitlab.base.RESTObjectList

List issues related to this milestone.

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)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns

The list of issues

Return type

gitlab.base.RESTObjectList

merge_requests(**kwargs: Any) gitlab.base.RESTObjectList

List the merge requests related to this milestone.

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)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns

The list of merge requests

Return type

gitlab.base.RESTObjectList

class gitlab.v4.objects.GroupMilestoneManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • iids

  • state

  • search

Object Creation

Required attributes for object create:

  • title

Optional attributes for object create:

  • description

  • due_date

  • start_date

Object update

Optional attributes for object update:

  • title

  • description

  • due_date

  • start_date

  • state_event

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.milestones.GroupMilestone

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.milestones.GroupMilestone

class gitlab.v4.objects.GroupNotificationSettings(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.v4.objects.notification_settings.NotificationSettings

Parameters
Return type

None

class gitlab.v4.objects.GroupNotificationSettingsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.notification_settings.NotificationSettingsManager

Object Creation

Object update

Optional attributes for object update:

  • level

  • notification_email

  • new_note

  • new_issue

  • reopen_issue

  • close_issue

  • reassign_issue

  • new_merge_request

  • reopen_merge_request

  • close_merge_request

  • reassign_merge_request

  • merge_merge_request

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.notification_settings.GroupNotificationSettings

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notification_settings.GroupNotificationSettings

class gitlab.v4.objects.GroupPackage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupPackageManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • exclude_subgroups

  • order_by

  • sort

  • package_type

  • package_name

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupProject(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupProjectManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • archived

  • visibility

  • order_by

  • sort

  • search

  • simple

  • owned

  • starred

  • with_custom_attributes

  • include_subgroups

  • with_issues_enabled

  • with_merge_requests_enabled

  • with_shared

  • min_access_level

  • with_security_reports

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupPushRules(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupPushRulesManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Optional attributes for object create:

  • deny_delete_tag

  • member_check

  • prevent_secrets

  • commit_message_regex

  • commit_message_negative_regex

  • branch_name_regex

  • author_email_regex

  • file_name_regex

  • max_file_size

  • commit_committer_check

  • reject_unsigned_commits

Object update

Optional attributes for object update:

  • deny_delete_tag

  • member_check

  • prevent_secrets

  • commit_message_regex

  • commit_message_negative_regex

  • branch_name_regex

  • author_email_regex

  • file_name_regex

  • max_file_size

  • commit_committer_check

  • reject_unsigned_commits

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.push_rules.GroupPushRules

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.push_rules.GroupPushRules

class gitlab.v4.objects.GroupRegistryRepositoryManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupRunner(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupRunnerManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • scope

  • tag_list

Object Creation

Required attributes for object create:

  • runner_id

Object update

Parameters
Return type

None

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupSAMLGroupLinkManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • saml_group_name

  • access_level

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.groups.GroupSAMLGroupLink

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.groups.GroupSAMLGroupLink

class gitlab.v4.objects.GroupSubgroup(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupSubgroupManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • skip_groups

  • all_available

  • search

  • order_by

  • sort

  • statistics

  • owned

  • with_custom_attributes

  • min_access_level

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.GroupVariable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupVariableManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • key

  • value

Optional attributes for object create:

  • protected

  • variable_type

  • masked

Object update

Required attributes for object update:

  • key

  • value

Optional attributes for object update:

  • protected

  • variable_type

  • masked

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.variables.GroupVariable

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.variables.GroupVariable

class gitlab.v4.objects.GroupWiki(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.GroupWikiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • with_content

Object Creation

Required attributes for object create:

  • title

  • content

Optional attributes for object create:

  • format

Object update

Optional attributes for object update:

  • title

  • content

  • format

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.wikis.GroupWiki

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.wikis.GroupWiki

class gitlab.v4.objects.Hook(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.HookManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • url

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.hooks.Hook

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.hooks.Hook

class gitlab.v4.objects.Issue(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.IssueManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object listing filters

  • state

  • labels

  • milestone

  • scope

  • author_id

  • assignee_id

  • my_reaction_emoji

  • iids

  • order_by

  • sort

  • search

  • created_after

  • created_before

  • updated_after

  • updated_before

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.issues.Issue

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.issues.Issue

class gitlab.v4.objects.IssuesStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.IssuesStatisticsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object listing filters

  • iids

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.statistics.IssuesStatistics

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.statistics.IssuesStatistics

class gitlab.v4.objects.Key(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.KeyManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Optional[Union[int, str]] = None, lazy: bool = False, **kwargs: Any) gitlab.v4.objects.keys.Key

Retrieve a single object.

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

  • lazy (bool) – If True, don’t request the server, but create a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.keys.Key

class gitlab.v4.objects.LDAPGroup(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.LDAPGroupManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.base.RESTManager

Object listing filters

  • search

  • provider

Object Creation

Object update

Parameters
Return type

None

list(**kwargs: Any) Union[List[gitlab.v4.objects.ldap.LDAPGroup], gitlab.base.RESTObjectList]

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)

  • iterator – If set to True and no pagination option is defined, 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 if iterator is True

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the server cannot perform the request

Return type

Union[List[gitlab.v4.objects.ldap.LDAPGroup], gitlab.base.RESTObjectList]

class gitlab.v4.objects.License(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.LicenseManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object listing filters

  • popular

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.templates.License

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.templates.License

class gitlab.v4.objects.MergeRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.MergeRequestManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • state

  • order_by

  • sort

  • milestone

  • view

  • labels

  • with_labels_details

  • with_merge_status_recheck

  • created_after

  • created_before

  • updated_after

  • updated_before

  • scope

  • author_id

  • author_username

  • assignee_id

  • approver_ids

  • approved_by_ids

  • reviewer_id

  • reviewer_username

  • my_reaction_emoji

  • source_branch

  • target_branch

  • search

  • in

  • wip

  • not

  • environment

  • deployed_before

  • deployed_after

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.Namespace(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.NamespaceManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object listing filters

  • search

Object Creation

Object update

Parameters
Return type

None

exists(namespace: str, **kwargs: Any) gitlab.v4.objects.namespaces.Namespace

Get existence of a namespace by path.

Parameters
  • namespace (str) – The path to the namespace.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

Data on namespace existence returned from the server.

Return type

gitlab.v4.objects.namespaces.Namespace

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.namespaces.Namespace

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.namespaces.Namespace

class gitlab.v4.objects.NotificationSettings(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.NotificationSettingsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object Creation

Object update

Optional attributes for object update:

  • level

  • notification_email

  • new_note

  • new_issue

  • reopen_issue

  • close_issue

  • reassign_issue

  • new_merge_request

  • reopen_merge_request

  • close_merge_request

  • reassign_merge_request

  • merge_merge_request

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.notification_settings.NotificationSettings

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notification_settings.NotificationSettings

class gitlab.v4.objects.PagesDomain(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.PagesDomainManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.PersonalAccessToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.PersonalAccessTokenManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.DeleteMixin, gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • user_id

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.Project(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.v4.objects.repositories.RepositoryMixin, gitlab.base.RESTObject

Parameters
Return type

None

access_tokens: gitlab.v4.objects.project_access_tokens.ProjectAccessTokenManager
accessrequests: gitlab.v4.objects.access_requests.ProjectAccessRequestManager
additionalstatistics: gitlab.v4.objects.statistics.ProjectAdditionalStatisticsManager
approvalrules: gitlab.v4.objects.merge_request_approvals.ProjectApprovalRuleManager
approvals: gitlab.v4.objects.merge_request_approvals.ProjectApprovalManager
archive(**kwargs: Any) None

Archive a project.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Return type

None

artifact(*args: Any, **kwargs: Any) Optional[bytes]
Parameters
  • args (Any) –

  • kwargs (Any) –

Return type

Optional[bytes]

artifacts: gitlab.v4.objects.artifacts.ProjectArtifactManager
audit_events: gitlab.v4.objects.audit_events.ProjectAuditEventManager
badges: gitlab.v4.objects.badges.ProjectBadgeManager
boards: gitlab.v4.objects.boards.ProjectBoardManager
branches: gitlab.v4.objects.branches.ProjectBranchManager
ci_lint: gitlab.v4.objects.ci_lint.ProjectCiLintManager
clusters: gitlab.v4.objects.clusters.ProjectClusterManager
commits: gitlab.v4.objects.commits.ProjectCommitManager
create_fork_relation(forked_from_id: int, **kwargs: Any) None

Create a forked from/to relation between existing projects.

Parameters
  • forked_from_id (int) – The ID of the project that was forked from

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the relation could not be created

Return type

None

customattributes: gitlab.v4.objects.custom_attributes.ProjectCustomAttributeManager
delete_fork_relation(**kwargs: Any) None

Delete a forked relation between existing projects.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type

None

deployments: gitlab.v4.objects.deployments.ProjectDeploymentManager
deploytokens: gitlab.v4.objects.deploy_tokens.ProjectDeployTokenManager
environments: gitlab.v4.objects.environments.ProjectEnvironmentManager
events: gitlab.v4.objects.events.ProjectEventManager
exports: gitlab.v4.objects.export_import.ProjectExportManager
files: gitlab.v4.objects.files.ProjectFileManager
forks: ProjectForkManager
generic_packages: gitlab.v4.objects.packages.GenericPackageManager
groups: gitlab.v4.objects.projects.ProjectGroupManager
hooks: gitlab.v4.objects.hooks.ProjectHookManager
housekeeping(**kwargs: Any) None

Start the housekeeping task.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabHousekeepingError – If the server failed to perform the request

Return type

None

imports: gitlab.v4.objects.export_import.ProjectImportManager
integrations: gitlab.v4.objects.integrations.ProjectIntegrationManager
invitations: gitlab.v4.objects.invitations.ProjectInvitationManager
issues: gitlab.v4.objects.issues.ProjectIssueManager
issues_statistics: gitlab.v4.objects.statistics.ProjectIssuesStatisticsManager
iterations: gitlab.v4.objects.iterations.GroupIterationManager
jobs: gitlab.v4.objects.jobs.ProjectJobManager
keys: gitlab.v4.objects.deploy_keys.ProjectKeyManager
labels: gitlab.v4.objects.labels.ProjectLabelManager
languages(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Get languages used in the project with percentage value.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Return type

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

members: gitlab.v4.objects.members.ProjectMemberManager
members_all: gitlab.v4.objects.members.ProjectMemberAllManager
merge_trains: gitlab.v4.objects.merge_trains.ProjectMergeTrainManager
mergerequests: gitlab.v4.objects.merge_requests.ProjectMergeRequestManager
milestones: gitlab.v4.objects.milestones.ProjectMilestoneManager
mirror_pull(**kwargs: Any) None

Start the pull mirroring process for the project.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Return type

None

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

Get a project’s pull mirror details.

Introduced in GitLab 15.5.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

dict of the parsed json returned by the server

Return type

Dict[str, Any]

notes: gitlab.v4.objects.notes.ProjectNoteManager
notificationsettings: gitlab.v4.objects.notification_settings.ProjectNotificationSettingsManager
packages: gitlab.v4.objects.packages.ProjectPackageManager
pagesdomains: gitlab.v4.objects.pages.ProjectPagesDomainManager
pipelines: gitlab.v4.objects.pipelines.ProjectPipelineManager
pipelineschedules: gitlab.v4.objects.pipelines.ProjectPipelineScheduleManager
protected_environments: gitlab.v4.objects.environments.ProjectProtectedEnvironmentManager
protectedbranches: gitlab.v4.objects.branches.ProjectProtectedBranchManager
protectedtags: gitlab.v4.objects.tags.ProjectProtectedTagManager
pushrules: gitlab.v4.objects.push_rules.ProjectPushRulesManager
releases: gitlab.v4.objects.releases.ProjectReleaseManager
remote_mirrors: ProjectRemoteMirrorManager
repositories: gitlab.v4.objects.container_registry.ProjectRegistryRepositoryManager
restore(**kwargs: Any) None

Restore a project marked for deletion.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabRestoreError – If the server failed to perform the request

Return type

None

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

Search the project 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
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabSearchError – If the server failed to perform the request

Returns

A list of dicts describing the resources found.

Return type

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

secure_files: gitlab.v4.objects.secure_files.ProjectSecureFileManager
services: gitlab.v4.objects.integrations.ProjectServiceManager
share(group_id: int, group_access: int, expires_at: Optional[str] = None, **kwargs: Any) None

Share the project with a group.

Parameters
  • group_id (int) – ID of the group.

  • group_access (int) – Access level for the group.

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

  • expires_at (Optional[str]) –

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Return type

None

snapshot(wiki: bool = False, streamed: bool = False, action: Optional[Callable[[bytes], None]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Return a snapshot of the repository.

Parameters
  • wiki (bool) – If True return the wiki repository

  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment.

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[bytes], None]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the content could not be retrieved

Returns

The uncompressed tar archive of the repository

Return type

Optional[Union[bytes, Iterator[Any]]]

snippets: gitlab.v4.objects.snippets.ProjectSnippetManager
star(**kwargs: Any) None

Star a project.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Return type

None

storage: ProjectStorageManager
tags: gitlab.v4.objects.tags.ProjectTagManager
transfer(to_namespace: Union[int, str], **kwargs: Any) None

Transfer a project to the given namespace ID

Parameters
  • to_namespace (Union[int, str]) – ID or path of the namespace to transfer the

  • to (project) –

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabTransferProjectError – If the project could not be transferred

Return type

None

transfer_project(*args: Any, **kwargs: Any) None
Parameters
  • args (Any) –

  • kwargs (Any) –

Return type

None

trigger_pipeline(ref: str, token: str, variables: Optional[Dict[str, Any]] = None, **kwargs: Any) gitlab.v4.objects.pipelines.ProjectPipeline

Trigger a CI build.

See https://gitlab.com/help/ci/triggers/README.md#trigger-a-build

Parameters
  • ref (str) – Commit to build; can be a branch name or a tag

  • token (str) – The trigger token

  • variables (Optional[Dict[str, Any]]) – Variables passed to the build script

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Return type

gitlab.v4.objects.pipelines.ProjectPipeline

triggers: gitlab.v4.objects.triggers.ProjectTriggerManager
unarchive(**kwargs: Any) None

Unarchive a project.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type

None

unshare(group_id: int, **kwargs: Any) None

Delete a shared project link within a group.

Parameters
  • group_id (int) – ID of the group.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type

None

unstar(**kwargs: Any) None

Unstar a project.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type

None

upload(filename: str, filedata: Optional[bytes] = None, filepath: Optional[str] = None, **kwargs: Any) Dict[str, Any]

Upload the specified file into the project.

Note

Either filedata or filepath MUST be specified.

Parameters
  • filename (str) – The name of the file being uploaded

  • filedata (Optional[bytes]) – The raw data of the file being uploaded

  • filepath (Optional[str]) – The path to a local file to upload (optional)

  • kwargs (Any) –

Raises
  • GitlabConnectionError – If the server cannot be reached

  • GitlabUploadError – If the file upload fails

  • GitlabUploadError – If filedata and filepath are not specified

  • GitlabUploadError – If both filedata and filepath are specified

Returns

  • alt - The alternate text for the upload

  • url - The direct url to the uploaded file

  • markdown - Markdown for the uploaded file

Return type

A dict with the keys

users: gitlab.v4.objects.users.ProjectUserManager
variables: gitlab.v4.objects.variables.ProjectVariableManager
wikis: gitlab.v4.objects.wikis.ProjectWikiManager
class gitlab.v4.objects.ProjectAccessRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.AccessRequestMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectAccessRequestManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectAccessToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectAccessTokenManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • scopes

Optional attributes for object create:

  • access_level

  • expires_at

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectAdditionalStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectAdditionalStatisticsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.statistics.ProjectAdditionalStatistics

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.statistics.ProjectAdditionalStatistics

class gitlab.v4.objects.ProjectApproval(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectApprovalManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object Creation

Object update

Optional attributes for object update:

  • approvals_before_merge

  • reset_approvals_on_push

  • disable_overriding_approvers_per_merge_request

  • merge_requests_author_approval

  • merge_requests_disable_committers_approval

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.merge_request_approvals.ProjectApproval

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.merge_request_approvals.ProjectApproval

class gitlab.v4.objects.ProjectApprovalRule(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectApprovalRuleManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • approvals_required

Optional attributes for object create:

  • user_ids

  • group_ids

  • protected_branch_ids

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectArtifact(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Dummy object to manage custom actions on artifacts

Parameters
Return type

None

class gitlab.v4.objects.ProjectArtifactManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

delete(**kwargs: Any) None

Delete the project’s artifacts on the server.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server cannot perform the request

Return type

None

download(ref_name: str, job: str, streamed: bool = False, action: Optional[Callable[[bytes], None]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Get the job artifacts archive from a specific tag or branch.

Parameters
  • ref_name (str) – Branch or tag name in repository. HEAD or SHA references

  • supported. (are not) –

  • job (str) – The name of the job.

  • job_token – Job token for multi-project pipeline triggers.

  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[bytes], None]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the artifacts could not be retrieved

Returns

The artifacts if streamed is False, None otherwise.

Return type

Optional[Union[bytes, Iterator[Any]]]

raw(ref_name: str, artifact_path: str, job: str, streamed: bool = False, action: Optional[Callable[[bytes], None]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Download a single artifact file from a specific tag or branch from within the job’s artifacts archive.

Parameters
  • ref_name (str) – Branch or tag name in repository. HEAD or SHA references are not supported.

  • artifact_path (str) – Path to a file inside the artifacts archive.

  • job (str) – The name of the job.

  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[bytes], None]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the artifacts could not be retrieved

Returns

The artifact if streamed is False, None otherwise.

Return type

Optional[Union[bytes, Iterator[Any]]]

class gitlab.v4.objects.ProjectAudit(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.v4.objects.audit_events.ProjectAuditEvent

Parameters
Return type

None

class gitlab.v4.objects.ProjectAuditEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectAuditEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.audit_events.ProjectAuditEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.audit_events.ProjectAuditEvent

class gitlab.v4.objects.ProjectAuditManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.audit_events.ProjectAuditEventManager

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectBadge(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectBadgeManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.BadgeRenderMixin, gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • link_url

  • image_url

Object update

Optional attributes for object update:

  • link_url

  • image_url

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.badges.ProjectBadge

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.badges.ProjectBadge

class gitlab.v4.objects.ProjectBoard(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

lists: gitlab.v4.objects.boards.ProjectBoardListManager
class gitlab.v4.objects.ProjectBoardList(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectBoardListManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Mutually exclusive attributes for object create:

  • label_id

  • assignee_id

  • milestone_id

Object update

Required attributes for object update:

  • position

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.boards.ProjectBoardList

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.boards.ProjectBoardList

class gitlab.v4.objects.ProjectBoardManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.boards.ProjectBoard

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.boards.ProjectBoard

class gitlab.v4.objects.ProjectBranch(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectBranchManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • branch

  • ref

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.branches.ProjectBranch

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.branches.ProjectBranch

class gitlab.v4.objects.ProjectCiLint(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectCiLintManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • content

Optional attributes for object create:

  • dry_run

  • include_jobs

  • ref

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.ci_lint.ProjectCiLint

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.ci_lint.ProjectCiLint

validate(*args: Any, **kwargs: Any) None

Raise an error if the Project CI Lint results are not valid.

This is a custom python-gitlab method to wrap lint endpoints.

Parameters
  • args (Any) –

  • kwargs (Any) –

Return type

None

class gitlab.v4.objects.ProjectCluster(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectClusterManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • platform_kubernetes_attributes

Optional attributes for object create:

  • domain

  • enabled

  • managed

  • environment_scope

Object update

Optional attributes for object update:

  • name

  • domain

  • management_project_id

  • platform_kubernetes_attributes

  • environment_scope

Parameters
Return type

None

create(data: Optional[Dict[str, Any]] = None, **kwargs: Any) gitlab.v4.objects.clusters.ProjectCluster

Create a new object.

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

  • **kwargs – Extra options to send to the server (e.g. sudo or ‘ref_name’, ‘stage’, ‘name’, ‘all’)

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Returns

A new instance of the manage object class build with

the data sent by the server

Return type

gitlab.v4.objects.clusters.ProjectCluster

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.clusters.ProjectCluster

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.clusters.ProjectCluster

class gitlab.v4.objects.ProjectCommit(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

cherry_pick(branch: str, **kwargs: Any) None

Cherry-pick a commit into a branch.

Parameters
  • branch (str) – Name of target branch

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCherryPickError – If the cherry-pick could not be performed

Return type

None

comments: ProjectCommitCommentManager
diff(**kwargs: Any) Union[gitlab.client.GitlabList, List[Dict[str, Any]]]

Generate the commit diff.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the diff could not be retrieved

Returns

The changes done in this commit

Return type

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

discussions: gitlab.v4.objects.discussions.ProjectCommitDiscussionManager
merge_requests(**kwargs: Any) Union[gitlab.client.GitlabList, List[Dict[str, Any]]]

List the merge requests related to the commit.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the references could not be retrieved

Returns

The merge requests related to the commit.

Return type

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

refs(type: str = 'all', **kwargs: Any) Union[gitlab.client.GitlabList, List[Dict[str, Any]]]

List the references the commit is pushed to.

Parameters
  • type (str) – The scope of references (‘branch’, ‘tag’ or ‘all’)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the references could not be retrieved

Returns

The references the commit is pushed to.

Return type

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

revert(branch: str, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Revert a commit on a given branch.

Parameters
  • branch (str) – Name of target branch

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabRevertError – If the revert could not be performed

Returns

The new commit data (not a RESTObject)

Return type

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

signature(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Get the signature of the commit.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the signature could not be retrieved

Returns

The commit’s signature data

Return type

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

statuses: ProjectCommitStatusManager
class gitlab.v4.objects.ProjectCommitComment(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectCommitCommentManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • note

Optional attributes for object create:

  • path

  • line

  • line_type

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectCommitDiscussion(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

notes: gitlab.v4.objects.notes.ProjectCommitDiscussionNoteManager
class gitlab.v4.objects.ProjectCommitDiscussionManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.discussions.ProjectCommitDiscussion

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.discussions.ProjectCommitDiscussion

class gitlab.v4.objects.ProjectCommitDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectCommitDiscussionNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

  • position

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.ProjectCommitDiscussionNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.ProjectCommitDiscussionNote

class gitlab.v4.objects.ProjectCommitManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object listing filters

  • ref_name

  • since

  • until

  • path

  • with_stats

  • first_parent

  • order

  • trailers

Object Creation

Required attributes for object create:

  • branch

  • commit_message

  • actions

Optional attributes for object create:

  • author_email

  • author_name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.commits.ProjectCommit

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.commits.ProjectCommit

class gitlab.v4.objects.ProjectCommitStatus(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectCommitStatusManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • state

Optional attributes for object create:

  • description

  • name

  • context

  • ref

  • target_url

  • coverage

Object update

Parameters
Return type

None

create(data: Optional[Dict[str, Any]] = None, **kwargs: Any) gitlab.v4.objects.commits.ProjectCommitStatus

Create a new object.

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

  • **kwargs – Extra options to send to the server (e.g. sudo or ‘ref_name’, ‘stage’, ‘name’, ‘all’)

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Returns

A new instance of the manage object class build with

the data sent by the server

Return type

gitlab.v4.objects.commits.ProjectCommitStatus

class gitlab.v4.objects.ProjectCustomAttribute(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectCustomAttributeManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.SetMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.custom_attributes.ProjectCustomAttribute

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.custom_attributes.ProjectCustomAttribute

class gitlab.v4.objects.ProjectDeployToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectDeployTokenManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object listing filters

  • scopes

Object Creation

Required attributes for object create:

  • name

  • scopes

Optional attributes for object create:

  • expires_at

  • username

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.deploy_tokens.ProjectDeployToken

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.deploy_tokens.ProjectDeployToken

class gitlab.v4.objects.ProjectDeployment(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

approval(status: str, comment: Optional[str] = None, represented_as: Optional[str] = None, **kwargs: Any) Dict[str, Any]

Approve or reject a blocked deployment.

Parameters
  • status (str) – Either “approved” or “rejected”

  • comment (Optional[str]) – A comment to go with the approval

  • represented_as (Optional[str]) – The name of the User/Group/Role to use for the approval, when the user belongs to multiple approval rules.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabMRApprovalError – If the approval failed

Returns

A dict containing the result.

Return type

Dict[str, Any]

https://docs.gitlab.com/ee/api/deployments.html#approve-or-reject-a-blocked-deployment

mergerequests: gitlab.v4.objects.merge_requests.ProjectDeploymentMergeRequestManager
class gitlab.v4.objects.ProjectDeploymentManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object listing filters

  • order_by

  • sort

  • updated_after

  • updated_before

  • environment

  • status

Object Creation

Required attributes for object create:

  • sha

  • ref

  • tag

  • status

  • environment

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.deployments.ProjectDeployment

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.deployments.ProjectDeployment

class gitlab.v4.objects.ProjectDeploymentMergeRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.v4.objects.merge_requests.MergeRequest

Parameters
Return type

None

class gitlab.v4.objects.ProjectDeploymentMergeRequestManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.merge_requests.MergeRequestManager

Object listing filters

  • state

  • order_by

  • sort

  • milestone

  • view

  • labels

  • with_labels_details

  • with_merge_status_recheck

  • created_after

  • created_before

  • updated_after

  • updated_before

  • scope

  • author_id

  • author_username

  • assignee_id

  • approver_ids

  • approved_by_ids

  • reviewer_id

  • reviewer_username

  • my_reaction_emoji

  • source_branch

  • target_branch

  • search

  • in

  • wip

  • not

  • environment

  • deployed_before

  • deployed_after

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectEnvironment(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

stop(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Stop the environment.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabStopError – If the operation failed

Returns

A dict of the result.

Return type

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

class gitlab.v4.objects.ProjectEnvironmentManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object listing filters

  • name

  • search

  • states

Object Creation

Required attributes for object create:

  • name

Optional attributes for object create:

  • external_url

Object update

Optional attributes for object update:

  • name

  • external_url

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.environments.ProjectEnvironment

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.environments.ProjectEnvironment

class gitlab.v4.objects.ProjectEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.v4.objects.events.Event

Parameters
Return type

None

class gitlab.v4.objects.ProjectEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.events.EventManager

Object listing filters

  • action

  • target_type

  • before

  • after

  • sort

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectExport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.DownloadMixin, gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectExportManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Optional attributes for object create:

  • description

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.export_import.ProjectExport

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.export_import.ProjectExport

class gitlab.v4.objects.ProjectFile(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

branch: str
commit_message: str
decode() bytes

Returns the decoded content of the file.

Returns

The decoded content.

Return type

bytes

delete(branch: str, commit_message: str, **kwargs: Any) None

Delete the file from the server.

Parameters
  • branch (str) – Branch from which the file will be removed

  • commit_message (str) – Commit message for the deletion

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server cannot perform the request

Return type

None

file_path: str
manager: ProjectFileManager
save(branch: str, commit_message: str, **kwargs: Any) None

Save the changes made to the file to the server.

The object is updated to match what the server returns.

Parameters
  • branch (str) – Branch in which the file will be updated

  • commit_message (str) – Message to send with the commit

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the server cannot perform the request

Return type

None

class gitlab.v4.objects.ProjectFileManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • file_path

  • branch

  • content

  • commit_message

Optional attributes for object create:

  • encoding

  • author_email

  • author_name

Object update

Required attributes for object update:

  • file_path

  • branch

  • content

  • commit_message

Optional attributes for object update:

  • encoding

  • author_email

  • author_name

Parameters
Return type

None

blame(file_path: str, ref: str, **kwargs: Any) List[Dict[str, Any]]

Return the content of a file for a commit.

Parameters
  • file_path (str) – Path of the file to retrieve

  • ref (str) – Name of the branch, tag or commit

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the server failed to perform the request

Returns

A list of commits/lines matching the file

Return type

List[Dict[str, Any]]

create(data: Optional[Dict[str, Any]] = None, **kwargs: Any) gitlab.v4.objects.files.ProjectFile

Create a new object.

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

  • **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
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Return type

gitlab.v4.objects.files.ProjectFile

delete(file_path: str, branch: str, commit_message: str, **kwargs: Any) None

Delete a file on the server.

Parameters
  • file_path (str) – Path of the file to remove

  • branch (str) – Branch from which the file will be removed

  • commit_message (str) – Commit message for the deletion

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server cannot perform the request

Return type

None

get(file_path: str, ref: str, **kwargs: Any) gitlab.v4.objects.files.ProjectFile

Retrieve a single file.

Parameters
  • file_path (str) – Path of the file to retrieve

  • ref (str) – Name of the branch, tag or commit

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the file could not be retrieved

Returns

The generated RESTObject

Return type

gitlab.v4.objects.files.ProjectFile

raw(file_path: str, ref: str, streamed: bool = False, action: Optional[Callable[[...], Any]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Return the content of a file for a commit.

Parameters
  • ref (str) – ID of the commit

  • filepath – Path of the file to return

  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[...], Any]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • file_path (str) –

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the file could not be retrieved

Returns

The file content

Return type

Optional[Union[bytes, Iterator[Any]]]

update(file_path: str, new_data: Optional[Dict[str, Any]] = None, **kwargs: Any) Dict[str, Any]

Update an object on the server.

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

  • file_path (str) –

  • kwargs (Any) –

Returns

The new object data (not a RESTObject)

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the server cannot perform the request

Return type

Dict[str, Any]

class gitlab.v4.objects.ProjectFork(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectForkManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CreateMixin, gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • archived

  • visibility

  • order_by

  • sort

  • search

  • simple

  • owned

  • membership

  • starred

  • statistics

  • with_custom_attributes

  • with_issues_enabled

  • with_merge_requests_enabled

Object Creation

Optional attributes for object create:

  • namespace

Object update

Parameters
Return type

None

create(data: Optional[Dict[str, Any]] = None, **kwargs: Any) gitlab.v4.objects.projects.ProjectFork

Creates a new object.

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

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Returns

A new instance of the managed object class build with

the data sent by the server

Return type

gitlab.v4.objects.projects.ProjectFork

class gitlab.v4.objects.ProjectHook(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectHookManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • url

Optional attributes for object create:

  • push_events

  • issues_events

  • confidential_issues_events

  • merge_requests_events

  • tag_push_events

  • note_events

  • job_events

  • pipeline_events

  • wiki_page_events

  • enable_ssl_verification

  • token

Object update

Required attributes for object update:

  • url

Optional attributes for object update:

  • push_events

  • issues_events

  • confidential_issues_events

  • merge_requests_events

  • tag_push_events

  • note_events

  • job_events

  • pipeline_events

  • wiki_events

  • enable_ssl_verification

  • token

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.hooks.ProjectHook

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.hooks.ProjectHook

class gitlab.v4.objects.ProjectImport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectImportManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.export_import.ProjectImport

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.export_import.ProjectImport

class gitlab.v4.objects.ProjectIntegration(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIntegrationManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

available() List[str]

List the services known by python-gitlab.

Returns

The list of service code names.

Return type

List[str]

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.integrations.ProjectIntegration

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.integrations.ProjectIntegration

class gitlab.v4.objects.ProjectInvitation(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectInvitationManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.invitations.InvitationMixin, gitlab.base.RESTManager

Object listing filters

  • query

Object Creation

Required attributes for object create:

  • access_level

Optional attributes for object create:

  • expires_at

  • invite_source

  • tasks_to_be_done

  • tasks_project_id

Mutually exclusive attributes for object create:

  • email

  • user_id

Object update

Optional attributes for object update:

  • access_level

  • expires_at

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.invitations.ProjectInvitation

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.invitations.ProjectInvitation

class gitlab.v4.objects.ProjectIssue(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.UserAgentDetailMixin, gitlab.mixins.SubscribableMixin, gitlab.mixins.TodoMixin, gitlab.mixins.TimeTrackingMixin, gitlab.mixins.ParticipantsMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

awardemojis: gitlab.v4.objects.award_emojis.ProjectIssueAwardEmojiManager
closed_by(**kwargs: Any) Dict[str, Any]

List merge requests that will close the issue when merged.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetErrot – If the merge requests could not be retrieved

Returns

The list of merge requests.

Return type

Dict[str, Any]

discussions: gitlab.v4.objects.discussions.ProjectIssueDiscussionManager
move(to_project_id: int, **kwargs: Any) None

Move the issue to another project.

Parameters
  • to_project_id (int) – ID of the target project

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the issue could not be moved

Return type

None

notes: gitlab.v4.objects.notes.ProjectIssueNoteManager
related_merge_requests(**kwargs: Any) Dict[str, Any]

List merge requests related to the issue.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetErrot – If the merge requests could not be retrieved

Returns

The list of merge requests.

Return type

Dict[str, Any]

reorder(move_after_id: Optional[int] = None, move_before_id: Optional[int] = None, **kwargs: Any) None

Reorder an issue on a board.

Parameters
  • move_after_id (Optional[int]) – ID of an issue that should be placed after this issue

  • move_before_id (Optional[int]) – ID of an issue that should be placed before this issue

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the issue could not be reordered

Return type

None

resourcelabelevents: gitlab.v4.objects.events.ProjectIssueResourceLabelEventManager
resourcemilestoneevents: gitlab.v4.objects.events.ProjectIssueResourceMilestoneEventManager
resourcestateevents: gitlab.v4.objects.events.ProjectIssueResourceStateEventManager
class gitlab.v4.objects.ProjectIssueAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIssueAwardEmojiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.award_emojis.ProjectIssueAwardEmoji

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.award_emojis.ProjectIssueAwardEmoji

class gitlab.v4.objects.ProjectIssueDiscussion(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

notes: gitlab.v4.objects.notes.ProjectIssueDiscussionNoteManager
class gitlab.v4.objects.ProjectIssueDiscussionManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.discussions.ProjectIssueDiscussion

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.discussions.ProjectIssueDiscussion

class gitlab.v4.objects.ProjectIssueDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIssueDiscussionNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.ProjectIssueDiscussionNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.ProjectIssueDiscussionNote

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIssueLinkManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • target_project_id

  • target_issue_iid

Object update

Parameters
Return type

None

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

Create a new object.

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

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

  • kwargs (Any) –

Returns

The source and target issues

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Return type

Tuple[gitlab.base.RESTObject, gitlab.base.RESTObject]

class gitlab.v4.objects.ProjectIssueManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • iids

  • state

  • labels

  • milestone

  • scope

  • author_id

  • assignee_id

  • my_reaction_emoji

  • order_by

  • sort

  • search

  • created_after

  • created_before

  • updated_after

  • updated_before

Object Creation

Required attributes for object create:

  • title

Optional attributes for object create:

  • description

  • confidential

  • assignee_ids

  • assignee_id

  • milestone_id

  • labels

  • created_at

  • due_date

  • merge_request_to_resolve_discussions_of

  • discussion_to_resolve

Object update

Optional attributes for object update:

  • title

  • description

  • confidential

  • assignee_ids

  • assignee_id

  • milestone_id

  • labels

  • state_event

  • updated_at

  • due_date

  • discussion_locked

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.issues.ProjectIssue

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.issues.ProjectIssue

class gitlab.v4.objects.ProjectIssueNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

awardemojis: gitlab.v4.objects.award_emojis.ProjectIssueNoteAwardEmojiManager
class gitlab.v4.objects.ProjectIssueNoteAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIssueNoteAwardEmojiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.award_emojis.ProjectIssueNoteAwardEmoji

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.award_emojis.ProjectIssueNoteAwardEmoji

class gitlab.v4.objects.ProjectIssueNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.ProjectIssueNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.ProjectIssueNote

class gitlab.v4.objects.ProjectIssueResourceLabelEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIssueResourceLabelEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.events.ProjectIssueResourceLabelEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.events.ProjectIssueResourceLabelEvent

class gitlab.v4.objects.ProjectIssueResourceMilestoneEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIssueResourceMilestoneEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.events.ProjectIssueResourceMilestoneEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.events.ProjectIssueResourceMilestoneEvent

class gitlab.v4.objects.ProjectIssueResourceStateEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIssueResourceStateEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.events.ProjectIssueResourceStateEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.events.ProjectIssueResourceStateEvent

class gitlab.v4.objects.ProjectIssuesStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectIssuesStatisticsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object listing filters

  • iids

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.statistics.ProjectIssuesStatistics

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.statistics.ProjectIssuesStatistics

class gitlab.v4.objects.ProjectIterationManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • state

  • search

  • include_ancestors

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectJob(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

artifact(path: str, streamed: bool = False, action: Optional[Callable[[...], Any]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Get a single artifact file from within the job’s artifacts archive.

Parameters
  • path (str) – Path of the artifact

  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[...], Any]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the artifacts could not be retrieved

Returns

The artifacts if streamed is False, None otherwise.

Return type

Optional[Union[bytes, Iterator[Any]]]

artifacts(streamed: bool = False, action: Optional[Callable[[...], Any]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Get the job artifacts.

Parameters
  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[...], Any]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the artifacts could not be retrieved

Returns

The artifacts if streamed is False, None otherwise.

Return type

Optional[Union[bytes, Iterator[Any]]]

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

Cancel the job.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabJobCancelError – If the job could not be canceled

Return type

Dict[str, Any]

delete_artifacts(**kwargs: Any) None

Delete artifacts of a job.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the request could not be performed

Return type

None

erase(**kwargs: Any) None

Erase the job (remove job artifacts and trace).

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabJobEraseError – If the job could not be erased

Return type

None

keep_artifacts(**kwargs: Any) None

Prevent artifacts from being deleted when expiration is set.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the request could not be performed

Return type

None

play(**kwargs: Any) None

Trigger a job explicitly.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabJobPlayError – If the job could not be triggered

Return type

None

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

Retry the job.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabJobRetryError – If the job could not be retried

Return type

Dict[str, Any]

trace(streamed: bool = False, action: Optional[Callable[[...], Any]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Dict[str, Any]

Get the job trace.

Parameters
  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[...], Any]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the artifacts could not be retrieved

Returns

The trace

Return type

Dict[str, Any]

class gitlab.v4.objects.ProjectJobManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object listing filters

  • scope

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.jobs.ProjectJob

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.jobs.ProjectJob

class gitlab.v4.objects.ProjectKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectKeyManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • title

  • key

Optional attributes for object create:

  • can_push

Object update

Optional attributes for object update:

  • title

  • can_push

Parameters
Return type

None

enable(key_id: int, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Enable a deploy key for a project.

Parameters
  • key_id (int) – The ID of the key to enable

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabProjectDeployKeyError – If the key could not be enabled

Returns

A dict of the result.

Return type

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

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.deploy_keys.ProjectKey

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.deploy_keys.ProjectKey

class gitlab.v4.objects.ProjectLabel(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.PromoteMixin, gitlab.mixins.SubscribableMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

manager: ProjectLabelManager
save(**kwargs: Any) None

Saves 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
  • GitlabAuthenticationError – If authentication is not correct.

  • GitlabUpdateError – If the server cannot perform the request.

Return type

None

class gitlab.v4.objects.ProjectLabelManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • color

Optional attributes for object create:

  • description

  • priority

Object update

Required attributes for object update:

  • name

Optional attributes for object update:

  • new_name

  • color

  • description

  • priority

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.labels.ProjectLabel

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.labels.ProjectLabel

update(name: Optional[str], new_data: Optional[Dict[str, Any]] = None, **kwargs: Any) Dict[str, Any]

Update a Label on the server.

Parameters
  • name (Optional[str]) – The name of the label

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

  • new_data (Optional[Dict[str, Any]]) –

  • kwargs (Any) –

Return type

Dict[str, Any]

class gitlab.v4.objects.ProjectManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • archived

  • id_after

  • id_before

  • last_activity_after

  • last_activity_before

  • membership

  • min_access_level

  • order_by

  • owned

  • repository_checksum_failed

  • repository_storage

  • search_namespaces

  • search

  • simple

  • sort

  • starred

  • statistics

  • topic

  • visibility

  • wiki_checksum_failed

  • with_custom_attributes

  • with_issues_enabled

  • with_merge_requests_enabled

  • with_programming_language

Object Creation

Optional attributes for object create:

  • name

  • path

  • allow_merge_on_skipped_pipeline

  • analytics_access_level

  • approvals_before_merge

  • auto_cancel_pending_pipelines

  • auto_devops_deploy_strategy

  • auto_devops_enabled

  • autoclose_referenced_issues

  • avatar

  • build_coverage_regex

  • build_git_strategy

  • build_timeout

  • builds_access_level

  • ci_config_path

  • container_expiration_policy_attributes

  • container_registry_enabled

  • default_branch

  • description

  • emails_disabled

  • external_authorization_classification_label

  • forking_access_level

  • group_with_project_templates_id

  • import_url

  • initialize_with_readme

  • issues_access_level

  • issues_enabled

  • jobs_enabled

  • lfs_enabled

  • merge_method

  • merge_pipelines_enabled

  • merge_requests_access_level

  • merge_requests_enabled

  • mirror_trigger_builds

  • mirror

  • namespace_id

  • operations_access_level

  • only_allow_merge_if_all_discussions_are_resolved

  • only_allow_merge_if_pipeline_succeeds

  • packages_enabled

  • pages_access_level

  • requirements_access_level

  • printing_merge_request_link_enabled

  • public_builds

  • remove_source_branch_after_merge

  • repository_access_level

  • repository_storage

  • request_access_enabled

  • resolve_outdated_diff_discussions

  • shared_runners_enabled

  • show_default_award_emojis

  • snippets_access_level

  • snippets_enabled

  • squash_option

  • tag_list

  • topics

  • template_name

  • template_project_id

  • use_custom_template

  • visibility

  • wiki_access_level

  • wiki_enabled

Object update

Optional attributes for object update:

  • allow_merge_on_skipped_pipeline

  • analytics_access_level

  • approvals_before_merge

  • auto_cancel_pending_pipelines

  • auto_devops_deploy_strategy

  • auto_devops_enabled

  • autoclose_referenced_issues

  • avatar

  • build_coverage_regex

  • build_git_strategy

  • build_timeout

  • builds_access_level

  • ci_config_path

  • ci_default_git_depth

  • ci_forward_deployment_enabled

  • container_expiration_policy_attributes

  • container_registry_enabled

  • default_branch

  • description

  • emails_disabled

  • external_authorization_classification_label

  • forking_access_level

  • import_url

  • issues_access_level

  • issues_enabled

  • jobs_enabled

  • lfs_enabled

  • merge_method

  • merge_pipelines_enabled

  • merge_requests_access_level

  • merge_requests_enabled

  • mirror_overwrites_diverged_branches

  • mirror_trigger_builds

  • mirror_user_id

  • mirror

  • mr_default_target_self

  • name

  • operations_access_level

  • only_allow_merge_if_all_discussions_are_resolved

  • only_allow_merge_if_pipeline_succeeds

  • only_mirror_protected_branches

  • packages_enabled

  • pages_access_level

  • requirements_access_level

  • restrict_user_defined_variables

  • path

  • public_builds

  • remove_source_branch_after_merge

  • repository_access_level

  • repository_storage

  • request_access_enabled

  • resolve_outdated_diff_discussions

  • service_desk_enabled

  • shared_runners_enabled

  • show_default_award_emojis

  • snippets_access_level

  • snippets_enabled

  • squash_option

  • suggestion_commit_message

  • tag_list

  • topics

  • visibility

  • wiki_access_level

  • wiki_enabled

  • issues_template

  • merge_requests_template

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.projects.Project

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.projects.Project

import_bitbucket_server(bitbucket_server_url: str, bitbucket_server_username: str, personal_access_token: str, bitbucket_server_project: str, bitbucket_server_repo: str, new_name: Optional[str] = None, target_namespace: Optional[str] = None, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Import a project from BitBucket Server to Gitlab (schedule the import)

This method will return when an import operation has been safely queued, or an error has occurred. After triggering an import, check the import_status of the newly created project to detect when the import operation has completed.

Note

This request may take longer than most other API requests. So this method will specify a 60 second default timeout if none is specified. A timeout can be specified via kwargs to override this functionality.

Parameters
  • bitbucket_server_url (str) – Bitbucket Server URL

  • bitbucket_server_username (str) – Bitbucket Server Username

  • personal_access_token (str) – Bitbucket Server personal access token/password

  • bitbucket_server_project (str) – Bitbucket Project Key

  • bitbucket_server_repo (str) – Bitbucket Repository Name

  • new_name (Optional[str]) – New repository name (Optional)

  • target_namespace (Optional[str]) – Namespace to import repository into. Supports subgroups like /namespace/subgroup (Optional)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the server failed to perform the request

Returns

A representation of the import status.

Return type

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

Example:

gl = gitlab.Gitlab_from_config()
print("Triggering import")
result = gl.projects.import_bitbucket_server(
    bitbucket_server_url="https://some.server.url",
    bitbucket_server_username="some_bitbucket_user",
    personal_access_token="my_password_or_access_token",
    bitbucket_server_project="my_project",
    bitbucket_server_repo="my_repo",
    new_name="gl_project_name",
    target_namespace="gl_project_path"
)
project = gl.projects.get(ret['id'])
print("Waiting for import to complete")
while project.import_status == u'started':
    time.sleep(1.0)
    project = gl.projects.get(project.id)
print("BitBucket import complete")
import_github(personal_access_token: str, repo_id: int, target_namespace: str, new_name: Optional[str] = None, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Import a project from Github to Gitlab (schedule the import)

This method will return when an import operation has been safely queued, or an error has occurred. After triggering an import, check the import_status of the newly created project to detect when the import operation has completed.

Note

This request may take longer than most other API requests. So this method will specify a 60 second default timeout if none is specified. A timeout can be specified via kwargs to override this functionality.

Parameters
  • personal_access_token (str) – GitHub personal access token

  • repo_id (int) – Github repository ID

  • target_namespace (str) – Namespace to import repo into

  • new_name (Optional[str]) – New repo name (Optional)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the server failed to perform the request

Returns

A representation of the import status.

Return type

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

Example:

gl = gitlab.Gitlab_from_config()
print("Triggering import")
result = gl.projects.import_github(ACCESS_TOKEN,
                                   123456,
                                   "my-group/my-subgroup")
project = gl.projects.get(ret['id'])
print("Waiting for import to complete")
while project.import_status == u'started':
    time.sleep(1.0)
    project = gl.projects.get(project.id)
print("Github import complete")
import_project(file: str, path: str, name: Optional[str] = None, namespace: Optional[str] = None, overwrite: bool = False, override_params: Optional[Dict[str, Any]] = None, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Import a project from an archive file.

Parameters
  • file (str) – Data or file object containing the project

  • path (str) – Name and path for the new project

  • name (Optional[str]) – The name of the project to import. If not provided, defaults to the path of the project.

  • namespace (Optional[str]) – The ID or path of the namespace that the project will be imported to

  • overwrite (bool) – If True overwrite an existing project with the same path

  • override_params (Optional[Dict[str, Any]]) – Set the specific settings for the project

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabImportError – If the server failed to perform the request

Returns

A representation of the import status.

Return type

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

remote_import(url: str, path: str, name: Optional[str] = None, namespace: Optional[str] = None, overwrite: bool = False, override_params: Optional[Dict[str, Any]] = None, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Import a project from an archive file stored on a remote URL.

Parameters
  • url (str) – URL for the file containing the project data to import

  • path (str) – Name and path for the new project

  • name (Optional[str]) – The name of the project to import. If not provided, defaults to the path of the project.

  • namespace (Optional[str]) – The ID or path of the namespace that the project will be imported to

  • overwrite (bool) – If True overwrite an existing project with the same path

  • override_params (Optional[Dict[str, Any]]) – Set the specific settings for the project

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabImportError – If the server failed to perform the request

Returns

A representation of the import status.

Return type

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

remote_import_s3(path: str, region: str, bucket_name: str, file_key: str, access_key_id: str, secret_access_key: str, name: Optional[str] = None, namespace: Optional[str] = None, overwrite: bool = False, override_params: Optional[Dict[str, Any]] = None, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Import a project from an archive file stored on AWS S3.

Parameters
  • region (str) – AWS S3 region name where the file is stored

  • bucket_name (str) – AWS S3 bucket name where the file is stored

  • file_key (str) – AWS S3 file key to identify the file.

  • access_key_id (str) – AWS S3 access key ID.

  • secret_access_key (str) – AWS S3 secret access key.

  • path (str) – Name and path for the new project

  • name (Optional[str]) – The name of the project to import. If not provided, defaults to the path of the project.

  • namespace (Optional[str]) – The ID or path of the namespace that the project will be imported to

  • overwrite (bool) – If True overwrite an existing project with the same path

  • override_params (Optional[Dict[str, Any]]) – Set the specific settings for the project

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabImportError – If the server failed to perform the request

Returns

A representation of the import status.

Return type

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

class gitlab.v4.objects.ProjectMember(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMemberAll(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMemberAllManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.members.ProjectMemberAll

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.members.ProjectMemberAll

class gitlab.v4.objects.ProjectMemberManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • access_level

  • user_id

Optional attributes for object create:

  • expires_at

  • tasks_to_be_done

Object update

Required attributes for object update:

  • access_level

Optional attributes for object update:

  • expires_at

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.members.ProjectMember

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.members.ProjectMember

class gitlab.v4.objects.ProjectMergeRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SubscribableMixin, gitlab.mixins.TodoMixin, gitlab.mixins.TimeTrackingMixin, gitlab.mixins.ParticipantsMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

approval_rules: gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApprovalRuleManager
approval_state: gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApprovalStateManager
approvals: gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApprovalManager
approve(sha: Optional[str] = None, **kwargs: Any) Dict[str, Any]

Approve the merge request.

Parameters
  • sha (Optional[str]) – Head SHA of MR

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabMRApprovalError – If the approval failed

Returns

A dict containing the result.

Return type

Dict[str, Any]

https://docs.gitlab.com/ee/api/merge_request_approvals.html#approve-merge-request

awardemojis: gitlab.v4.objects.award_emojis.ProjectMergeRequestAwardEmojiManager
cancel_merge_when_pipeline_succeeds(**kwargs: Any) Dict[str, str]

Cancel merge when the pipeline succeeds.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabMROnBuildSuccessError – If the server could not handle the request

Returns

dict of the parsed json returned by the server

Return type

Dict[str, str]

changes(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

List the merge request changes.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns

List of changes

Return type

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

closes_issues(**kwargs: Any) gitlab.base.RESTObjectList

List issues that will close on merge.”

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)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns

List of issues

Return type

gitlab.base.RESTObjectList

commits(**kwargs: Any) gitlab.base.RESTObjectList

List the merge request commits.

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)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns

The list of commits

Return type

gitlab.base.RESTObjectList

diffs: ProjectMergeRequestDiffManager
discussions: gitlab.v4.objects.discussions.ProjectMergeRequestDiscussionManager
merge(merge_commit_message: Optional[str] = None, should_remove_source_branch: Optional[bool] = None, merge_when_pipeline_succeeds: Optional[bool] = None, **kwargs: Any) Dict[str, Any]

Accept the merge request.

Parameters
  • merge_commit_message (Optional[str]) – Commit message

  • should_remove_source_branch (Optional[bool]) – If True, removes the source branch

  • merge_when_pipeline_succeeds (Optional[bool]) – Wait for the build to succeed, then merge

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabMRClosedError – If the merge failed

Return type

Dict[str, Any]

merge_ref(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]
Attempt to merge changes between source and target branches into

refs/merge-requests/:iid/merge.

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

  • kwargs (Any) –

Raises

GitlabGetError – If cannot be merged

Return type

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

notes: gitlab.v4.objects.notes.ProjectMergeRequestNoteManager
pipelines: gitlab.v4.objects.pipelines.ProjectMergeRequestPipelineManager
rebase(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Attempt to rebase the source branch onto the target branch

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabMRRebaseError – If rebasing failed

Return type

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

reset_approvals(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Clear all approvals of the merge request.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabMRResetApprovalError – If reset approval failed

Return type

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

resourcelabelevents: gitlab.v4.objects.events.ProjectMergeRequestResourceLabelEventManager
resourcemilestoneevents: gitlab.v4.objects.events.ProjectMergeRequestResourceMilestoneEventManager
resourcestateevents: gitlab.v4.objects.events.ProjectMergeRequestResourceStateEventManager
unapprove(**kwargs: Any) None

Unapprove the merge request.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabMRApprovalError – If the unapproval failed

Return type

None

https://docs.gitlab.com/ee/api/merge_request_approvals.html#unapprove-merge-request

class gitlab.v4.objects.ProjectMergeRequestApproval(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestApprovalManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object Creation

Object update

Required attributes for object update:

  • approvals_required

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApproval

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApproval

set_approvers(approvals_required: int, approver_ids: Optional[List[int]] = None, approver_group_ids: Optional[List[int]] = None, approval_rule_name: str = 'name', **kwargs: Any) gitlab.base.RESTObject

Change MR-level allowed approvers and approver groups.

Parameters
  • approvals_required (int) – The number of required approvals for this rule

  • approver_ids (Optional[List[int]]) – User IDs that can approve MRs

  • approver_group_ids (Optional[List[int]]) – Group IDs whose members can approve MRs

  • approval_rule_name (str) –

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the server failed to perform the request

Return type

gitlab.base.RESTObject

class gitlab.v4.objects.ProjectMergeRequestApprovalRule(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

approval_rule_id: int
id: int
merge_request_iid: int
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
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUpdateError – If the server cannot perform the request

Return type

None

class gitlab.v4.objects.ProjectMergeRequestApprovalRuleManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • id

  • merge_request_iid

  • name

  • approvals_required

Optional attributes for object create:

  • approval_project_rule_id

  • user_ids

  • group_ids

Object update

Required attributes for object update:

  • id

  • merge_request_iid

  • approval_rule_id

  • name

  • approvals_required

Optional attributes for object update:

  • user_ids

  • group_ids

Parameters
Return type

None

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 the resource

  • **kwargs – Extra options to send to the server (e.g. sudo or ‘ref_name’, ‘stage’, ‘name’, ‘all’)

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Returns

A new instance of the manage object class build with

the data sent by the server

Return type

gitlab.base.RESTObject

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApprovalRule

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApprovalRule

class gitlab.v4.objects.ProjectMergeRequestApprovalState(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestApprovalStateManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApprovalState

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.merge_request_approvals.ProjectMergeRequestApprovalState

class gitlab.v4.objects.ProjectMergeRequestAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestAwardEmojiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.award_emojis.ProjectMergeRequestAwardEmoji

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.award_emojis.ProjectMergeRequestAwardEmoji

class gitlab.v4.objects.ProjectMergeRequestDiff(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestDiffManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.merge_requests.ProjectMergeRequestDiff

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.merge_requests.ProjectMergeRequestDiff

class gitlab.v4.objects.ProjectMergeRequestDiscussion(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

notes: gitlab.v4.objects.notes.ProjectMergeRequestDiscussionNoteManager
class gitlab.v4.objects.ProjectMergeRequestDiscussionManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

  • position

Object update

Required attributes for object update:

  • resolved

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.discussions.ProjectMergeRequestDiscussion

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.discussions.ProjectMergeRequestDiscussion

class gitlab.v4.objects.ProjectMergeRequestDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestDiscussionNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.ProjectMergeRequestDiscussionNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.ProjectMergeRequestDiscussionNote

class gitlab.v4.objects.ProjectMergeRequestManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • state

  • order_by

  • sort

  • milestone

  • view

  • labels

  • created_after

  • created_before

  • updated_after

  • updated_before

  • scope

  • iids

  • author_id

  • assignee_id

  • approver_ids

  • approved_by_ids

  • my_reaction_emoji

  • source_branch

  • target_branch

  • search

  • wip

Object Creation

Required attributes for object create:

  • source_branch

  • target_branch

  • title

Optional attributes for object create:

  • allow_collaboration

  • allow_maintainer_to_push

  • approvals_before_merge

  • assignee_id

  • assignee_ids

  • description

  • labels

  • milestone_id

  • remove_source_branch

  • reviewer_ids

  • squash

  • target_project_id

Object update

Optional attributes for object update:

  • target_branch

  • assignee_id

  • title

  • description

  • state_event

  • labels

  • milestone_id

  • remove_source_branch

  • discussion_locked

  • allow_maintainer_to_push

  • squash

  • reviewer_ids

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.merge_requests.ProjectMergeRequest

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.merge_requests.ProjectMergeRequest

class gitlab.v4.objects.ProjectMergeRequestNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

awardemojis: gitlab.v4.objects.award_emojis.ProjectMergeRequestNoteAwardEmojiManager
class gitlab.v4.objects.ProjectMergeRequestNoteAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestNoteAwardEmojiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.award_emojis.ProjectMergeRequestNoteAwardEmoji

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.award_emojis.ProjectMergeRequestNoteAwardEmoji

class gitlab.v4.objects.ProjectMergeRequestNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.ProjectMergeRequestNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.ProjectMergeRequestNote

class gitlab.v4.objects.ProjectMergeRequestPipeline(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestPipelineManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CreateMixin, gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestResourceLabelEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestResourceLabelEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.events.ProjectMergeRequestResourceLabelEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.events.ProjectMergeRequestResourceLabelEvent

class gitlab.v4.objects.ProjectMergeRequestResourceMilestoneEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestResourceMilestoneEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.events.ProjectMergeRequestResourceMilestoneEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.events.ProjectMergeRequestResourceMilestoneEvent

class gitlab.v4.objects.ProjectMergeRequestResourceStateEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeRequestResourceStateEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.events.ProjectMergeRequestResourceStateEvent

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.events.ProjectMergeRequestResourceStateEvent

class gitlab.v4.objects.ProjectMergeTrain(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectMergeTrainManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • scope

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectMilestone(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.PromoteMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

issues(**kwargs: Any) gitlab.base.RESTObjectList

List issues related to this milestone.

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)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns

The list of issues

Return type

gitlab.base.RESTObjectList

merge_requests(**kwargs: Any) gitlab.base.RESTObjectList

List the merge requests related to this milestone.

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)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns

The list of merge requests

Return type

gitlab.base.RESTObjectList

class gitlab.v4.objects.ProjectMilestoneManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • iids

  • state

  • search

Object Creation

Required attributes for object create:

  • title

Optional attributes for object create:

  • description

  • due_date

  • start_date

  • state_event

Object update

Optional attributes for object update:

  • title

  • description

  • due_date

  • start_date

  • state_event

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.milestones.ProjectMilestone

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.milestones.ProjectMilestone

class gitlab.v4.objects.ProjectNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.ProjectNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.ProjectNote

class gitlab.v4.objects.ProjectNotificationSettings(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.v4.objects.notification_settings.NotificationSettings

Parameters
Return type

None

class gitlab.v4.objects.ProjectNotificationSettingsManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.notification_settings.NotificationSettingsManager

Object Creation

Object update

Optional attributes for object update:

  • level

  • notification_email

  • new_note

  • new_issue

  • reopen_issue

  • close_issue

  • reassign_issue

  • new_merge_request

  • reopen_merge_request

  • close_merge_request

  • reassign_merge_request

  • merge_merge_request

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.notification_settings.ProjectNotificationSettings

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notification_settings.ProjectNotificationSettings

class gitlab.v4.objects.ProjectPackage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

package_files: ProjectPackageFileManager
class gitlab.v4.objects.ProjectPackageFile(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPackageFileManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.DeleteMixin, gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectPackageManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.GetMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object listing filters

  • order_by

  • sort

  • package_type

  • package_name

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.packages.ProjectPackage

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.packages.ProjectPackage

class gitlab.v4.objects.ProjectPagesDomain(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPagesDomainManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • domain

Optional attributes for object create:

  • certificate

  • key

Object update

Optional attributes for object update:

  • certificate

  • key

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.pages.ProjectPagesDomain

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.pages.ProjectPagesDomain

class gitlab.v4.objects.ProjectPipeline(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

bridges: ProjectPipelineBridgeManager
cancel(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Cancel the job.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabPipelineCancelError – If the request failed

Return type

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

jobs: ProjectPipelineJobManager
retry(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Retry the job.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabPipelineRetryError – If the request failed

Return type

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

test_report: ProjectPipelineTestReportManager
test_report_summary: ProjectPipelineTestReportSummaryManager
variables: ProjectPipelineVariableManager
class gitlab.v4.objects.ProjectPipelineBridge(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineBridgeManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • scope

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineJob(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineJobManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • scope

  • include_retried

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object listing filters

  • scope

  • status

  • ref

  • sha

  • yaml_errors

  • name

  • username

  • order_by

  • sort

Object Creation

Required attributes for object create:

  • ref

Object update

Parameters
Return type

None

create(data: Optional[Dict[str, Any]] = None, **kwargs: Any) gitlab.v4.objects.pipelines.ProjectPipeline

Creates a new object.

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

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Returns

A new instance of the managed object class build with

the data sent by the server

Return type

gitlab.v4.objects.pipelines.ProjectPipeline

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.pipelines.ProjectPipeline

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.pipelines.ProjectPipeline

class gitlab.v4.objects.ProjectPipelineSchedule(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

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

Trigger a new scheduled pipeline, which runs immediately. The next scheduled run of this pipeline is not affected.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabPipelinePlayError – If the request failed

Return type

Dict[str, Any]

take_ownership(**kwargs: Any) None

Update the owner of a pipeline schedule.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabOwnershipError – If the request failed

Return type

None

variables: gitlab.v4.objects.pipelines.ProjectPipelineScheduleVariableManager
class gitlab.v4.objects.ProjectPipelineScheduleManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • description

  • ref

  • cron

Optional attributes for object create:

  • cron_timezone

  • active

Object update

Optional attributes for object update:

  • description

  • ref

  • cron

  • cron_timezone

  • active

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.pipelines.ProjectPipelineSchedule

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.pipelines.ProjectPipelineSchedule

class gitlab.v4.objects.ProjectPipelineScheduleVariable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineScheduleVariableManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • key

  • value

Object update

Required attributes for object update:

  • key

  • value

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineTestReport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineTestReportManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.pipelines.ProjectPipelineTestReport

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.pipelines.ProjectPipelineTestReport

class gitlab.v4.objects.ProjectPipelineTestReportSummary(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineTestReportSummaryManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.pipelines.ProjectPipelineTestReportSummary

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.pipelines.ProjectPipelineTestReportSummary

class gitlab.v4.objects.ProjectPipelineVariable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPipelineVariableManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectProtectedBranch(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectProtectedBranchManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Optional attributes for object create:

  • push_access_level

  • merge_access_level

  • unprotect_access_level

  • allowed_to_push

  • allowed_to_merge

  • allowed_to_unprotect

  • code_owner_approval_required

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.branches.ProjectProtectedBranch

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.branches.ProjectProtectedBranch

class gitlab.v4.objects.ProjectProtectedEnvironment(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectProtectedEnvironmentManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • deploy_access_levels

Optional attributes for object create:

  • required_approval_count

  • approval_rules

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.environments.ProjectProtectedEnvironment

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.environments.ProjectProtectedEnvironment

class gitlab.v4.objects.ProjectProtectedTag(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectProtectedTagManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Optional attributes for object create:

  • create_access_level

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.tags.ProjectProtectedTag

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.tags.ProjectProtectedTag

class gitlab.v4.objects.ProjectPushRules(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectPushRulesManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Optional attributes for object create:

  • author_email_regex

  • branch_name_regex

  • commit_committer_check

  • commit_message_negative_regex

  • commit_message_regex

  • deny_delete_tag

  • file_name_regex

  • max_file_size

  • member_check

  • prevent_secrets

  • reject_unsigned_commits

Object update

Optional attributes for object update:

  • author_email_regex

  • branch_name_regex

  • commit_committer_check

  • commit_message_negative_regex

  • commit_message_regex

  • deny_delete_tag

  • file_name_regex

  • max_file_size

  • member_check

  • prevent_secrets

  • reject_unsigned_commits

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.push_rules.ProjectPushRules

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.push_rules.ProjectPushRules

class gitlab.v4.objects.ProjectRegistryRepository(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

tags: ProjectRegistryTagManager
class gitlab.v4.objects.ProjectRegistryRepositoryManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.DeleteMixin, gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectRegistryTag(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectRegistryTagManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.DeleteMixin, gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

delete_in_bulk(name_regex_delete: str, **kwargs: Any) None

Delete Tag in bulk

Parameters
  • name_regex_delete (str) – The regex of the name to delete. To delete all tags specify .*.

  • keep_n – The amount of latest tags of given name to keep.

  • name_regex_keep – The regex of the name to keep. This value overrides any matches from name_regex.

  • older_than – Tags to delete that are older than the given time, written in human readable form 1h, 1d, 1month.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server cannot perform the request

Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.container_registry.ProjectRegistryTag

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.container_registry.ProjectRegistryTag

class gitlab.v4.objects.ProjectRelease(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectReleaseLinkManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • url

Optional attributes for object create:

  • filepath

  • link_type

Object update

Optional attributes for object update:

  • name

  • url

  • filepath

  • link_type

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.releases.ProjectReleaseLink

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.releases.ProjectReleaseLink

class gitlab.v4.objects.ProjectReleaseManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • order_by

  • sort

  • include_html_description

Object Creation

Required attributes for object create:

  • tag_name

  • description

Optional attributes for object create:

  • name

  • ref

  • assets

Object update

Optional attributes for object update:

  • name

  • description

  • milestones

  • released_at

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.releases.ProjectRelease

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.releases.ProjectRelease

class gitlab.v4.objects.ProjectRemoteMirror(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectRemoteMirrorManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • url

Optional attributes for object create:

  • enabled

  • only_protected_branches

Object update

Optional attributes for object update:

  • enabled

  • only_protected_branches

Parameters
Return type

None

class gitlab.v4.objects.ProjectRunner(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectRunnerManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • scope

  • tag_list

Object Creation

Required attributes for object create:

  • runner_id

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectSecureFile(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

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

Download the secure file.

Parameters
  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[bytes], None]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the artifacts could not be retrieved

Returns

The artifacts if streamed is False, None otherwise.

Return type

Optional[Union[bytes, Iterator[Any]]]

class gitlab.v4.objects.ProjectSecureFileManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • file

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.secure_files.ProjectSecureFile

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.secure_files.ProjectSecureFile

class gitlab.v4.objects.ProjectService(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.v4.objects.integrations.ProjectIntegration

Parameters
Return type

None

class gitlab.v4.objects.ProjectServiceManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.integrations.ProjectIntegrationManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.integrations.ProjectService

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.integrations.ProjectService

class gitlab.v4.objects.ProjectSnippet(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.UserAgentDetailMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

awardemojis: gitlab.v4.objects.award_emojis.ProjectSnippetAwardEmojiManager
content(streamed: bool = False, action: Optional[Callable[[...], Any]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Return the content of a snippet.

Parameters
  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment.

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[...], Any]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the content could not be retrieved

Returns

The snippet content

Return type

Optional[Union[bytes, Iterator[Any]]]

discussions: gitlab.v4.objects.discussions.ProjectSnippetDiscussionManager
notes: gitlab.v4.objects.notes.ProjectSnippetNoteManager
class gitlab.v4.objects.ProjectSnippetAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectSnippetAwardEmojiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.award_emojis.ProjectSnippetAwardEmoji

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.award_emojis.ProjectSnippetAwardEmoji

class gitlab.v4.objects.ProjectSnippetDiscussion(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

notes: gitlab.v4.objects.notes.ProjectSnippetDiscussionNoteManager
class gitlab.v4.objects.ProjectSnippetDiscussionManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.discussions.ProjectSnippetDiscussion

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.discussions.ProjectSnippetDiscussion

class gitlab.v4.objects.ProjectSnippetDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectSnippetDiscussionNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.mixins.CreateMixin, gitlab.mixins.UpdateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Optional attributes for object create:

  • created_at

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.ProjectSnippetDiscussionNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.ProjectSnippetDiscussionNote

class gitlab.v4.objects.ProjectSnippetManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • title

  • file_name

  • content

  • visibility

Optional attributes for object create:

  • description

Object update

Optional attributes for object update:

  • title

  • file_name

  • content

  • visibility

  • description

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.snippets.ProjectSnippet

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.snippets.ProjectSnippet

class gitlab.v4.objects.ProjectSnippetNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

awardemojis: gitlab.v4.objects.award_emojis.ProjectSnippetNoteAwardEmojiManager
class gitlab.v4.objects.ProjectSnippetNoteAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectSnippetNoteAwardEmojiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.award_emojis.ProjectSnippetNoteAwardEmoji

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.award_emojis.ProjectSnippetNoteAwardEmoji

class gitlab.v4.objects.ProjectSnippetNoteManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • body

Object update

Required attributes for object update:

  • body

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.notes.ProjectSnippetNote

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.notes.ProjectSnippetNote

class gitlab.v4.objects.ProjectStorage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.RefreshMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectStorageManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.projects.ProjectStorage

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.projects.ProjectStorage

class gitlab.v4.objects.ProjectTag(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectTagManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • tag_name

  • ref

Optional attributes for object create:

  • message

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.tags.ProjectTag

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.tags.ProjectTag

class gitlab.v4.objects.ProjectTrigger(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectTriggerManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • description

Object update

Required attributes for object update:

  • description

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.triggers.ProjectTrigger

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.triggers.ProjectTrigger

class gitlab.v4.objects.ProjectUser(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectUserManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • search

  • skip_users

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.ProjectVariable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectVariableManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • key

  • value

Optional attributes for object create:

  • protected

  • variable_type

  • masked

  • environment_scope

Object update

Required attributes for object update:

  • key

  • value

Optional attributes for object update:

  • protected

  • variable_type

  • masked

  • environment_scope

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.variables.ProjectVariable

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.variables.ProjectVariable

class gitlab.v4.objects.ProjectWiki(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.ProjectWikiManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • with_content

Object Creation

Required attributes for object create:

  • title

  • content

Optional attributes for object create:

  • format

Object update

Optional attributes for object update:

  • title

  • content

  • format

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.wikis.ProjectWiki

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.wikis.ProjectWiki

class gitlab.v4.objects.RegistryRepository(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.RegistryRepositoryManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.container_registry.RegistryRepository

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.container_registry.RegistryRepository

class gitlab.v4.objects.RepositoryMixin

Bases: object

delete_merged_branches(**kwargs: Any) None

Delete merged branches.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type

None

repository_archive(sha: Optional[str] = None, streamed: bool = False, action: Optional[Callable[[...], Any]] = None, chunk_size: int = 1024, format: Optional[str] = None, path: Optional[str] = None, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Return an archive of the repository.

Parameters
  • sha (Optional[str]) – ID of the commit (default branch by default)

  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[...], Any]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

  • format (Optional[str]) – file format (tar.gz by default)

  • path (Optional[str]) – The subpath of the repository to download (all files by default)

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the server failed to perform the request

Returns

The binary data of the archive

Return type

Optional[Union[bytes, Iterator[Any]]]

repository_blob(sha: str, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Return a file by blob SHA.

Parameters
  • sha (str) – ID of the blob

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The blob content and metadata

Return type

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

repository_compare(from_: str, to: str, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Return a diff between two branches/commits.

Parameters
  • from – Source branch/SHA

  • to (str) – Destination branch/SHA

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

  • from_ (str) –

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The diff

Return type

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

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

Return a list of contributors for the project.

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)

  • iterator – If set to True and no pagination option is defined, return a generator instead of a list

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The contributors

Return type

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

repository_merge_base(refs: List[str], **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Return a diff between two branches/commits.

Parameters
  • refs (List[str]) – The refs to find the common ancestor of. Multiple refs can be passed.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The common ancestor commit (not a RESTObject)

Return type

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

repository_raw_blob(sha: str, streamed: bool = False, action: Optional[Callable[[...], Any]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Return the raw file contents for a blob.

Parameters
  • sha (str) – ID of the blob

  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[...], Any]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The blob content if streamed is False, None otherwise

Return type

Optional[Union[bytes, Iterator[Any]]]

repository_tree(path: str = '', ref: str = '', recursive: bool = False, **kwargs: Any) Union[gitlab.client.GitlabList, List[Dict[str, Any]]]

Return a list of files in the repository.

Parameters
  • path (str) – Path of the top folder (/ by default)

  • ref (str) – Reference to a commit or branch

  • recursive (bool) – Whether to get the tree recursively

  • 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 is defined, return a generator instead of a list

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Returns

The representation of the tree

Return type

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

update_submodule(submodule: str, branch: str, commit_sha: str, **kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Update a project submodule

Parameters
  • submodule (str) – Full path to the submodule

  • branch (str) – Name of the branch to commit into

  • commit_sha (str) – Full commit SHA to update the submodule to

  • commit_message – Commit message. If no message is provided, a default one will be set (optional)

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabPutError – If the submodule could not be updated

Return type

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

class gitlab.v4.objects.Runner(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

jobs: gitlab.v4.objects.runners.RunnerJobManager
class gitlab.v4.objects.RunnerAll(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.RunnerAllManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • scope

  • type

  • status

  • paused

  • tag_list

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.RunnerJob(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.RunnerJobManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • status

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.RunnerManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • scope

  • type

  • status

  • paused

  • tag_list

Object Creation

Required attributes for object create:

  • token

Optional attributes for object create:

  • description

  • info

  • active

  • locked

  • run_untagged

  • tag_list

  • access_level

  • maximum_timeout

Object update

Optional attributes for object update:

  • description

  • active

  • tag_list

  • run_untagged

  • locked

  • access_level

  • maximum_timeout

Parameters
Return type

None

all(scope: Optional[str] = None, **kwargs: Any) List[gitlab.v4.objects.runners.Runner]

List all the runners.

Parameters
  • scope (Optional[str]) – The scope of runners to show, one of: specific, shared, active, paused, online

  • 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 is defined, return a generator instead of a list

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the server failed to perform the request

Returns

A list of runners matching the scope.

Return type

List[gitlab.v4.objects.runners.Runner]

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.runners.Runner

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.runners.Runner

verify(token: str, **kwargs: Any) None

Validates authentication credentials for a registered Runner.

Parameters
  • token (str) – The runner’s authentication token

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabVerifyError – If the server failed to verify the token

Return type

None

class gitlab.v4.objects.SharedProject(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.SharedProjectManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • archived

  • visibility

  • order_by

  • sort

  • search

  • simple

  • starred

  • with_issues_enabled

  • with_merge_requests_enabled

  • min_access_level

  • with_custom_attributes

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.SidekiqManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.base.RESTManager

Manager for the Sidekiq methods.

This manager doesn’t actually manage objects but provides helper function for the sidekiq metrics API.

Object Creation

Object update

Parameters
Return type

None

compound_metrics(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Return all available metrics and statistics.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the information couldn’t be retrieved

Returns

All available Sidekiq metrics and statistics

Return type

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

job_stats(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Return statistics about the jobs performed.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the information couldn’t be retrieved

Returns

Statistics about the Sidekiq jobs performed

Return type

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

process_metrics(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Return the registered sidekiq workers.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the information couldn’t be retrieved

Returns

Information about the register Sidekiq worker

Return type

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

queue_metrics(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Return the registered queues information.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the information couldn’t be retrieved

Returns

Information about the Sidekiq queues

Return type

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

class gitlab.v4.objects.Snippet(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.UserAgentDetailMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

content(streamed: bool = False, action: Optional[Callable[[...], Any]] = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) Optional[Union[bytes, Iterator[Any]]]

Return the content of a snippet.

Parameters
  • streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment.

  • iterator (bool) – If True directly return the underlying response iterator

  • action (Optional[Callable[[...], Any]]) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the content could not be retrieved

Returns

The snippet content

Return type

Optional[Union[bytes, Iterator[Any]]]

class gitlab.v4.objects.SnippetManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • title

  • file_name

  • content

Optional attributes for object create:

  • lifetime

  • visibility

Object update

Optional attributes for object update:

  • title

  • file_name

  • content

  • visibility

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.snippets.Snippet

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.snippets.Snippet

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

List all the public snippets.

Parameters
  • all – If True the returned object will be a list

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

  • kwargs (Any) –

Raises

GitlabListError – If the list could not be retrieved

Returns

A generator for the snippets list

Return type

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

class gitlab.v4.objects.StarredProject(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.StarredProjectManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object listing filters

  • archived

  • membership

  • min_access_level

  • order_by

  • owned

  • search

  • simple

  • sort

  • starred

  • statistics

  • visibility

  • with_custom_attributes

  • with_issues_enabled

  • with_merge_requests_enabled

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.Todo(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

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

Mark the todo as done.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabTodoError – If the server failed to perform the request

Returns

A dict with the result

Return type

Dict[str, Any]

class gitlab.v4.objects.TodoManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object listing filters

  • action

  • author_id

  • project_id

  • state

  • type

Object Creation

Object update

Parameters
Return type

None

mark_all_as_done(**kwargs: Any) None

Mark all the todos as done.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabTodoError – If the server failed to perform the request

Returns

The number of todos marked done

Return type

None

class gitlab.v4.objects.Topic(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.TopicManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

Optional attributes for object create:

  • avatar

  • description

  • title

Object update

Optional attributes for object update:

  • avatar

  • description

  • name

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.topics.Topic

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.topics.Topic

merge(source_topic_id: Union[int, str], target_topic_id: Union[int, str], **kwargs: Any) Dict[str, Any]

Merge two topics, assigning all projects to the target topic.

Parameters
  • source_topic_id (Union[int, str]) – ID of source project topic

  • target_topic_id (Union[int, str]) – ID of target project topic

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabTopicMergeError – If the merge failed

Returns

The merged topic data (not a RESTObject)

Return type

Dict[str, Any]

class gitlab.v4.objects.User(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

activate(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Activate the user.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabActivateError – If the user could not be activated

Returns

Whether the user status has been changed

Return type

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

approve(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Approve a user creation request.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUserApproveError – If the user could not be activated

Returns

The new object data (not a RESTObject)

Return type

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

ban(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Ban the user.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabBanError – If the user could not be banned

Returns

Whether the user has been banned

Return type

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

block(**kwargs: Any) Optional[bool]

Block the user.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabBlockError – If the user could not be blocked

Returns

Whether the user status has been changed

Return type

Optional[bool]

customattributes: gitlab.v4.objects.custom_attributes.UserCustomAttributeManager
deactivate(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Deactivate the user.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeactivateError – If the user could not be deactivated

Returns

Whether the user status has been changed

Return type

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

emails: UserEmailManager
events: gitlab.v4.objects.events.UserEventManager
follow(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Follow the user.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabFollowError – If the user could not be followed

Returns

The new object data (not a RESTObject)

Return type

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

followers_users: UserFollowersManager
following_users: UserFollowingManager
gpgkeys: UserGPGKeyManager
identityproviders: UserIdentityProviderManager
impersonationtokens: UserImpersonationTokenManager
keys: UserKeyManager
memberships: UserMembershipManager
personal_access_tokens: gitlab.v4.objects.personal_access_tokens.UserPersonalAccessTokenManager
projects: UserProjectManager
reject(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Reject a user creation request.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUserRejectError – If the user could not be rejected

Returns

The new object data (not a RESTObject)

Return type

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

starred_projects: StarredProjectManager
status: UserStatusManager
unban(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Unban the user.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUnbanError – If the user could not be unbanned

Returns

Whether the user has been unbanned

Return type

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

unblock(**kwargs: Any) Optional[bool]

Unblock the user.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUnblockError – If the user could not be unblocked

Returns

Whether the user status has been changed

Return type

Optional[bool]

unfollow(**kwargs: Any) Union[Dict[str, Any], requests.models.Response]

Unfollow the user.

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

  • kwargs (Any) –

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabUnfollowError – If the user could not be followed

Returns

The new object data (not a RESTObject)

Return type

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

class gitlab.v4.objects.UserActivities(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserActivitiesManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.UserCustomAttribute(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserCustomAttributeManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.SetMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.custom_attributes.UserCustomAttribute

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.custom_attributes.UserCustomAttribute

class gitlab.v4.objects.UserEmail(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserEmailManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • email

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.UserEmail

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.UserEmail

class gitlab.v4.objects.UserEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.v4.objects.events.Event

Parameters
Return type

None

class gitlab.v4.objects.UserEventManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.v4.objects.events.EventManager

Object listing filters

  • action

  • target_type

  • before

  • after

  • sort

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.UserGPGKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserGPGKeyManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • key

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.UserGPGKey

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.UserGPGKey

class gitlab.v4.objects.UserIdentityProviderManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Manager for user identities.

This manager does not actually manage objects but enables functionality for deletion of user identities by provider.

Object Creation

Object update

Parameters
Return type

None

class gitlab.v4.objects.UserImpersonationToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserImpersonationTokenManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.NoUpdateMixin, gitlab.base.RESTManager

Object listing filters

  • state

Object Creation

Required attributes for object create:

  • name

  • scopes

Optional attributes for object create:

  • expires_at

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.UserImpersonationToken

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.UserImpersonationToken

class gitlab.v4.objects.UserKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserKeyManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.mixins.CreateMixin, gitlab.mixins.DeleteMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • title

  • key

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.UserKey

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.UserKey

class gitlab.v4.objects.UserManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object listing filters

  • active

  • blocked

  • username

  • extern_uid

  • provider

  • external

  • search

  • custom_attributes

  • status

  • two_factor

Object Creation

Optional attributes for object create:

  • email

  • username

  • name

  • password

  • reset_password

  • skype

  • linkedin

  • twitter

  • projects_limit

  • extern_uid

  • provider

  • bio

  • admin

  • can_create_group

  • website_url

  • skip_confirmation

  • external

  • organization

  • location

  • avatar

  • public_email

  • private_profile

  • color_scheme_id

  • theme_id

Object update

Required attributes for object update:

  • email

  • username

  • name

Optional attributes for object update:

  • password

  • skype

  • linkedin

  • twitter

  • projects_limit

  • extern_uid

  • provider

  • bio

  • admin

  • can_create_group

  • website_url

  • skip_reconfirmation

  • external

  • organization

  • location

  • avatar

  • public_email

  • private_profile

  • color_scheme_id

  • theme_id

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.User

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.User

class gitlab.v4.objects.UserMembership(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserMembershipManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.RetrieveMixin, gitlab.base.RESTManager

Object listing filters

  • type

Object Creation

Object update

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.users.UserMembership

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.UserMembership

class gitlab.v4.objects.UserPersonalAccessToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserPersonalAccessTokenManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • name

  • scopes

Optional attributes for object create:

  • expires_at

Object update

Parameters
Return type

None

class gitlab.v4.objects.UserProject(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserProjectManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.ListMixin, gitlab.mixins.CreateMixin, gitlab.base.RESTManager

Object listing filters

  • archived

  • visibility

  • order_by

  • sort

  • search

  • simple

  • owned

  • membership

  • starred

  • statistics

  • with_issues_enabled

  • with_merge_requests_enabled

  • with_custom_attributes

  • with_programming_language

  • wiki_checksum_failed

  • repository_checksum_failed

  • min_access_level

  • id_after

  • id_before

Object Creation

Required attributes for object create:

  • name

Optional attributes for object create:

  • default_branch

  • issues_enabled

  • wall_enabled

  • merge_requests_enabled

  • wiki_enabled

  • snippets_enabled

  • squash_option

  • public

  • visibility

  • description

  • builds_enabled

  • public_builds

  • import_url

  • only_allow_merge_if_build_succeeds

Object update

Parameters
Return type

None

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)

  • iterator – If set to True and no pagination option is defined, 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 if iterator is True

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the server cannot perform the request

Return type

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

class gitlab.v4.objects.UserStatus(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.UserStatusManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.GetWithoutIdMixin, gitlab.base.RESTManager

Object Creation

Object update

Parameters
Return type

None

get(**kwargs: Any) gitlab.v4.objects.users.UserStatus

Retrieve a single object.

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

  • kwargs (Any) –

Returns

The generated RESTObject

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.users.UserStatus

class gitlab.v4.objects.Variable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

Parameters
Return type

None

class gitlab.v4.objects.VariableManager(gl: gitlab.client.Gitlab, parent: Optional[gitlab.base.RESTObject] = None)

Bases: gitlab.mixins.CRUDMixin, gitlab.base.RESTManager

Object Creation

Required attributes for object create:

  • key

  • value

Optional attributes for object create:

  • protected

  • variable_type

  • masked

Object update

Required attributes for object update:

  • key

  • value

Optional attributes for object update:

  • protected

  • variable_type

  • masked

Parameters
Return type

None

get(id: Union[str, int], lazy: bool = False, **kwargs: Any) gitlab.v4.objects.variables.Variable

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 a shallow object giving access to the managers. This is useful if you want to avoid useless calls to the API.

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

  • kwargs (Any) –

Returns

The generated RESTObject.

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type

gitlab.v4.objects.variables.Variable

Module contents