gitlab.v4 package

Submodules

gitlab.v4.objects module

class gitlab.v4.objects.Any(*args, **kwargs)

Bases: object

Special type indicating an unconstrained type.

  • Any is compatible with every type.

  • Any assumed to have all methods.

  • All values assumed to be instances of Any.

Note that all the above statements are true from the point of view of static type checkers. At runtime, Any should not be used with instance checks.

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: SaveMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ApplicationAppearanceManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, UpdateMixin, 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:
get(**kwargs: Any) ApplicationAppearance

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ApplicationAppearance

update(id: int | str | None = None, new_data: Dict[str, Any] | None = None, **kwargs: Any) Dict[str, Any]

Update an object on the server.

Parameters:
  • id (int | str | None) – ID of the object to update (can be None if not required)

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

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

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, parent: RESTObject | None = None)

Bases: ListMixin, CreateMixin, DeleteMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

  • redirect_uri

  • scopes

Optional attributes for object create:

  • confidential

Object update

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

Bases: SaveMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ApplicationSettingsManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, UpdateMixin, 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:
get(**kwargs: Any) ApplicationSettings

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ApplicationSettings

update(id: int | str | None = None, new_data: Dict[str, Any] | None = None, **kwargs: Any) Dict[str, Any]

Update an object on the server.

Parameters:
  • id (int | str | None) – ID of the object to update (can be None if not required)

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

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

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: RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ApplicationStatisticsManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, RESTManager

Object Creation

Object update

Parameters:
get(**kwargs: Any) ApplicationStatistics

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ApplicationStatistics

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.AuditEventManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object listing filters

  • created_after

  • created_before

  • entity_type

  • entity_id

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) AuditEvent

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

AuditEvent

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.BroadcastMessageManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) BroadcastMessage

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

BroadcastMessage

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

Bases: RefreshMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.BulkImportAllEntityManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object listing filters

  • sort

  • status

Object Creation

Object update

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

Bases: RefreshMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.BulkImportEntityManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object listing filters

  • sort

  • status

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) BulkImportEntity

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

BulkImportEntity

class gitlab.v4.objects.BulkImportManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CreateMixin, RetrieveMixin, RESTManager

Object listing filters

  • sort

  • status

Object Creation

Required attributes for object create:

  • configuration

  • entities

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) BulkImport

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

BulkImport

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.CiLintManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CreateMixin, RESTManager

Object Creation

Required attributes for object create:

  • content

Optional attributes for object create:

  • include_merged_yaml

  • include_jobs

Object update

Parameters:
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:
Return type:

None

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.CurrentUserEmailManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, CreateMixin, DeleteMixin, RESTManager

Object Creation

Required attributes for object create:

  • email

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) CurrentUserEmail

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

CurrentUserEmail

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.CurrentUserGPGKeyManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, CreateMixin, DeleteMixin, RESTManager

Object Creation

Required attributes for object create:

  • key

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) CurrentUserGPGKey

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

CurrentUserGPGKey

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.CurrentUserKeyManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, CreateMixin, DeleteMixin, RESTManager

Object Creation

Required attributes for object create:

  • title

  • key

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) CurrentUserKey

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

CurrentUserKey

class gitlab.v4.objects.CurrentUserManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, RESTManager

Object Creation

Object update

Parameters:
get(**kwargs: Any) CurrentUser

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

CurrentUser

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.CurrentUserRunnerManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CreateMixin, RESTManager

Object Creation

Required attributes for object create:

  • runner_type

Optional attributes for object create:

  • group_id

  • project_id

  • description

  • paused

  • locked

  • run_untagged

  • tag_list

  • access_level

  • maximum_timeout

  • maintenance_note

Object update

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

Bases: SaveMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.CurrentUserStatusManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, UpdateMixin, RESTManager

Object Creation

Object update

Optional attributes for object update:

  • emoji

  • message

Parameters:
get(**kwargs: Any) CurrentUserStatus

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

CurrentUserStatus

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.DeployKeyManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object Creation

Object update

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.DeployTokenManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object Creation

Object update

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.DockerfileManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) Dockerfile

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

Dockerfile

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.EventManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object listing filters

  • action

  • target_type

  • before

  • after

  • sort

  • scope

Object Creation

Object update

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.FeatureManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, DeleteMixin, RESTManager

Object Creation

Object update

Parameters:
set(name: str, value: bool | int, feature_group: str | None = None, user: str | None = None, group: str | None = None, project: str | None = None, **kwargs: Any) Feature

Create or update the object.

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

  • value (bool | int) – The value to set for the object

  • feature_group (str | None) – A feature group name

  • user (str | None) – A GitLab username

  • group (str | None) – A GitLab group

  • project (str | None) – A GitLab project in form group/project

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabSetError – If an error occurred

Returns:

The created/updated attribute

Return type:

Feature

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GenericPackageManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RESTManager

Object Creation

Object update

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

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 (Callable[[bytes], None] | None) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

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:

bytes | Iterator[Any] | None

upload(package_name: str, package_version: str, file_name: str, path: str | Path | None = None, select: str | None = None, data: bytes | BinaryIO | None = None, **kwargs: Any) 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 (str | Path | None) – The path to a local file to upload

  • select (str | None) – GitLab API accepts a value of ‘package_file’

  • data (bytes | BinaryIO | None)

  • kwargs (Any)

Raises:
  • GitlabConnectionError – If the server cannot be reached

  • GitlabUploadError – If the file upload fails

  • GitlabUploadError – If path cannot be read

  • GitlabUploadError – If both path and data are passed

Returns:

An object storing the metadata of the uploaded package.

Return type:

GenericPackage

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

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

repair(**kwargs: Any) None

Repair the OAuth authentication of the geo node.

Parameters:

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

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 (Any) – Extra options to send to the server (e.g. sudo)

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, parent: RESTObject | None = None)

Bases: RetrieveMixin, UpdateMixin, DeleteMixin, RESTManager

Object Creation

Object update

Optional attributes for object update:

  • enabled

  • url

  • files_max_capacity

  • repos_max_capacity

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

Get the list of failures on the current geo node.

Parameters:

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

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: str | int, lazy: bool = False, **kwargs: Any) GeoNode

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GeoNode

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

Get the status of all the geo nodes.

Parameters:

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

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: RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GitignoreManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) Gitignore

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

Gitignore

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GitlabciymlManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) Gitlabciyml

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

Gitlabciyml

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

access_tokens: GroupAccessTokenManager
accessrequests: GroupAccessRequestManager
audit_events: GroupAuditEventManager
badges: GroupBadgeManager
billable_members: GroupBillableMemberManager
boards: GroupBoardManager
clusters: GroupClusterManager
customattributes: GroupCustomAttributeManager
deploytokens: GroupDeployTokenManager
descendant_groups: GroupDescendantGroupManager
epics: GroupEpicManager
exports: GroupExportManager
hooks: GroupHookManager
imports: GroupImportManager
invitations: GroupInvitationManager
issues: GroupIssueManager
issues_statistics: GroupIssuesStatisticsManager
iterations: GroupIterationManager
labels: GroupLabelManager
ldap_sync(**kwargs: Any) None

Sync LDAP groups.

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server cannot perform the request

Return type:

None

members: GroupMemberManager
members_all: GroupMemberAllManager
mergerequests: GroupMergeRequestManager
milestones: GroupMilestoneManager
notificationsettings: GroupNotificationSettingsManager
packages: GroupPackageManager
projects: GroupProjectManager
pushrules: GroupPushRulesManager
registry_repositories: GroupRegistryRepositoryManager
restore(**kwargs: Any) None

Restore a group marked for deletion..

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabRestoreError – If the server failed to perform the request

Return type:

None

runners: GroupRunnerManager
search(scope: str, search: str, **kwargs: Any) 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 (Any) – Extra options to send to the server (e.g. sudo)

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:

GitlabList | List[Dict[str, Any]]

service_accounts: GroupServiceAccountManager
share(group_id: int, group_access: int, expires_at: str | None = 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 (Any) – Extra options to send to the server (e.g. sudo)

  • expires_at (str | None)

  • **kwargs

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Returns:

Group

Return type:

None

shared_projects: SharedProjectManager
subgroups: GroupSubgroupManager
transfer(group_id: int | None = 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 (int | None) – ID of the new parent group. When not specified, the group to transfer is instead turned into a top-level group.

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

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 (Any) – Extra options to send to the server (e.g. sudo)

  • project_id (int)

  • **kwargs

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 (Any) – Extra options to send to the server (e.g. sudo)

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type:

None

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

Bases: AccessRequestMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupAccessRequestManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, CreateMixin, DeleteMixin, RESTManager

Object Creation

Object update

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

Bases: ObjectDeleteMixin, ObjectRotateMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupAccessTokenManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CreateMixin, DeleteMixin, RetrieveMixin, RotateMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

  • scopes

Optional attributes for object create:

  • access_level

  • expires_at

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupAccessToken

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupAccessToken

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupAuditEventManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupAuditEvent

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupAuditEvent

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupBadgeManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: BadgeRenderMixin, CRUDMixin, RESTManager

Object Creation

Required attributes for object create:

  • link_url

  • image_url

Object update

Optional attributes for object update:

  • link_url

  • image_url

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupBadge

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupBadge

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

memberships: GroupBillableMemberMembershipManager
class gitlab.v4.objects.GroupBillableMemberManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, DeleteMixin, RESTManager

Object listing filters

  • search

  • sort

Object Creation

Object update

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupBillableMemberMembershipManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object Creation

Object update

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupBoardListManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, RESTManager

Object Creation

Mutually exclusive attributes for object create:

  • label_id

  • assignee_id

  • milestone_id

Object update

Required attributes for object update:

  • position

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupBoardList

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupBoardList

class gitlab.v4.objects.GroupBoardManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupBoard

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupBoard

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupClusterManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
create(data: Dict[str, Any] | None = None, **kwargs: Any) GroupCluster

Create a new object.

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

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

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:

GroupCluster

get(id: str | int, lazy: bool = False, **kwargs: Any) GroupCluster

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupCluster

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupCustomAttributeManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, SetMixin, DeleteMixin, RESTManager

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupCustomAttribute

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupCustomAttribute

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupDeployTokenManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, CreateMixin, DeleteMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupDeployToken

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupDeployToken

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupDescendantGroupManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: 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:
class gitlab.v4.objects.GroupEpic(manager: RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: ObjectDeleteMixin, SaveMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupEpicAwardEmojiManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: NoUpdateMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupEpicAwardEmoji

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupEpicAwardEmoji

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupEpicDiscussionNoteManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetMixin, CreateMixin, UpdateMixin, DeleteMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupEpicDiscussionNote

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupEpicDiscussionNote

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

Bases: ObjectDeleteMixin, SaveMixin, RESTObject

Parameters:
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 (Any) – Extra options to send to the server (e.g. sudo)

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, parent: RESTObject | None = None)

Bases: ListMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager

Object Creation

Required attributes for object create:

  • issue_id

Object update

Optional attributes for object update:

  • move_before_id

  • move_after_id

Parameters:
create(data: Dict[str, Any] | None = None, **kwargs: Any) GroupEpicIssue

Create a new object.

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

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

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:

GroupEpicIssue

class gitlab.v4.objects.GroupEpicManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupEpic

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupEpic

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupEpicNoteAwardEmojiManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: NoUpdateMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupEpicNoteAwardEmoji

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupEpicNoteAwardEmoji

class gitlab.v4.objects.GroupEpicNoteManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupEpicNote

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupEpicNote

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupEpicResourceLabelEventManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupEpicResourceLabelEvent

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupEpicResourceLabelEvent

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

Bases: DownloadMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupExportManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, CreateMixin, RESTManager

Object Creation

Object update

Parameters:
get(**kwargs: Any) GroupExport

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupExport

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupHookManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupHook

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupHook

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupImportManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, RESTManager

Object Creation

Object update

Parameters:
get(**kwargs: Any) GroupImport

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupImport

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupInvitationManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: InvitationMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupInvitation

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupInvitation

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupIssueManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object listing filters

  • state

  • labels

  • milestone

  • order_by

  • sort

  • iids

  • author_id

  • iteration_id

  • assignee_id

  • my_reaction_emoji

  • search

  • created_after

  • created_before

  • updated_after

  • updated_before

Object Creation

Object update

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

Bases: RefreshMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupIssuesStatisticsManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, RESTManager

Object listing filters

  • iids

Object Creation

Object update

Parameters:
get(**kwargs: Any) GroupIssuesStatistics

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupIssuesStatistics

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupIterationManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object listing filters

  • include_ancestors

  • include_descendants

  • in

  • search

  • state

  • updated_after

  • updated_before

Object Creation

Object update

Parameters:

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

delete(**kwargs: Any) None

Delete the LDAP group link from the server.

Parameters:

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

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, parent: RESTObject | None = None)

Bases: ListMixin, CreateMixin, DeleteMixin, RESTManager

Object Creation

Required attributes for object create:

  • provider

  • group_access

Mutually exclusive attributes for object create:

  • cn

  • filter

Object update

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

Bases: SubscribableMixin, SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
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 (Any) – Extra options to send to the server (e.g. sudo)

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, parent: RESTObject | None = None)

Bases: RetrieveMixin, CreateMixin, UpdateMixin, DeleteMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupLabel

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupLabel

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

Update a Label on the server.

Parameters:
  • name (str | None) – The name of the label

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

  • new_data (Dict[str, Any] | None)

  • **kwargs

Return type:

Dict[str, Any]

class gitlab.v4.objects.GroupManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) Group

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

Group

import_group(file: BinaryIO, path: str, name: str, parent_id: int | str | None = None, **kwargs: Any) Dict[str, Any] | 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 (int | str | None) – ID of a parent group that the group will be imported into.

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

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:

Dict[str, Any] | Response

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupMemberAllManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupMemberAll

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupMemberAll

class gitlab.v4.objects.GroupMemberManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupMember

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupMember

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupMergeRequestManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, 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:
class gitlab.v4.objects.GroupMilestone(manager: RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

issues(**kwargs: Any) 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 (Any) – Extra options to send to the server (e.g. sudo)

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns:

The list of issues

Return type:

RESTObjectList

merge_requests(**kwargs: Any) 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 (Any) – Extra options to send to the server (e.g. sudo)

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabListError – If the list could not be retrieved

Returns:

The list of merge requests

Return type:

RESTObjectList

class gitlab.v4.objects.GroupMilestoneManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupMilestone

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupMilestone

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

Bases: NotificationSettings

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupNotificationSettingsManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: 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:
get(**kwargs: Any) GroupNotificationSettings

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupNotificationSettings

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupPackageManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object listing filters

  • exclude_subgroups

  • order_by

  • sort

  • package_type

  • package_name

Object Creation

Object update

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupProjectManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, 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:
class gitlab.v4.objects.GroupPushRules(manager: RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupPushRulesManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, CreateMixin, UpdateMixin, DeleteMixin, 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:
get(**kwargs: Any) GroupPushRules

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupPushRules

class gitlab.v4.objects.GroupRegistryRepositoryManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object Creation

Object update

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupRunnerManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object listing filters

  • scope

  • tag_list

Object Creation

Required attributes for object create:

  • runner_id

Object update

Parameters:

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupSAMLGroupLinkManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: NoUpdateMixin, RESTManager

Object Creation

Required attributes for object create:

  • saml_group_name

  • access_level

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupSAMLGroupLink

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupSAMLGroupLink

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupServiceAccountManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CreateMixin, RESTManager

Object Creation

Optional attributes for object create:

  • name

  • username

Object update

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupSubgroupManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, 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:
class gitlab.v4.objects.GroupVariable(manager: RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupVariableManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupVariable

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupVariable

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

Bases: SaveMixin, ObjectDeleteMixin, UploadMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.GroupWikiManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
get(id: str | int, lazy: bool = False, **kwargs: Any) GroupWiki

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

GroupWiki

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.HookManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: NoUpdateMixin, RESTManager

Object Creation

Required attributes for object create:

  • url

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) Hook

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

Hook

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.IssueManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object listing filters

  • state

  • labels

  • milestone

  • scope

  • author_id

  • iteration_id

  • assignee_id

  • my_reaction_emoji

  • iids

  • order_by

  • sort

  • search

  • created_after

  • created_before

  • updated_after

  • updated_before

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) Issue

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

Issue

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

Bases: RefreshMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.IssuesStatisticsManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, RESTManager

Object listing filters

  • iids

Object Creation

Object update

Parameters:
get(**kwargs: Any) IssuesStatistics

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

IssuesStatistics

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.KeyManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetMixin, RESTManager

Object Creation

Object update

Parameters:
get(id: int | str | None = None, lazy: bool = False, **kwargs: Any) Key

Retrieve a single object.

Parameters:
  • id (int | str | None) – 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 (Any) – Extra options to send to the server (e.g. sudo)

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

Key

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.LDAPGroupManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RESTManager

Object listing filters

  • search

  • provider

Object Creation

Object update

Parameters:
list(**kwargs: Any) List[LDAPGroup] | 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 (Any) – Extra options to send to the server (e.g. sudo)

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:

List[LDAPGroup] | RESTObjectList

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.LicenseManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object listing filters

  • popular

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) License

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

License

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.MergeRequestManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, 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:
class gitlab.v4.objects.Namespace(manager: RESTManager, attrs: Dict[str, Any], *, created_from_list: bool = False, lazy: bool = False)

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.NamespaceManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object listing filters

  • search

Object Creation

Object update

Parameters:
exists(namespace: str, **kwargs: Any) Namespace

Get existence of a namespace by path.

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

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

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:

Namespace

get(id: str | int, lazy: bool = False, **kwargs: Any) Namespace

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

Namespace

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

Bases: SaveMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.NotificationSettingsManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, UpdateMixin, 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:
get(**kwargs: Any) NotificationSettings

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

NotificationSettings

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.PagesDomainManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, RESTManager

Object Creation

Object update

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

Bases: ObjectDeleteMixin, ObjectRotateMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.PersonalAccessTokenManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: DeleteMixin, RetrieveMixin, RotateMixin, RESTManager

Object listing filters

  • user_id

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) PersonalAccessToken

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

PersonalAccessToken

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

Bases: RefreshMixin, SaveMixin, ObjectDeleteMixin, RepositoryMixin, UploadMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

access_tokens: ProjectAccessTokenManager
accessrequests: ProjectAccessRequestManager
additionalstatistics: ProjectAdditionalStatisticsManager
approvalrules: ProjectApprovalRuleManager
approvals: ProjectApprovalManager
archive(**kwargs: Any) None

Archive a project.

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Return type:

None

artifacts: ProjectArtifactManager
audit_events: ProjectAuditEventManager
badges: ProjectBadgeManager
boards: ProjectBoardManager
branches: ProjectBranchManager
ci_lint: ProjectCiLintManager
cluster_agents: ProjectClusterAgentManager
clusters: ProjectClusterManager
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 (Any) – Extra options to send to the server (e.g. sudo)

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the relation could not be created

Return type:

None

customattributes: ProjectCustomAttributeManager
delete_fork_relation(**kwargs: Any) None

Delete a forked relation between existing projects.

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type:

None

deployments: ProjectDeploymentManager
deploytokens: ProjectDeployTokenManager
environments: ProjectEnvironmentManager
events: ProjectEventManager
exports: ProjectExportManager
files: ProjectFileManager
forks: ProjectForkManager
generic_packages: GenericPackageManager
groups: ProjectGroupManager
hooks: ProjectHookManager
housekeeping(**kwargs: Any) None

Start the housekeeping task.

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabHousekeepingError – If the server failed to perform the request

Return type:

None

imports: ProjectImportManager
integrations: ProjectIntegrationManager
invitations: ProjectInvitationManager
issues: ProjectIssueManager
issues_statistics: ProjectIssuesStatisticsManager
iterations: ProjectIterationManager
job_token_scope: ProjectJobTokenScopeManager
jobs: ProjectJobManager
keys: ProjectKeyManager
labels: ProjectLabelManager
languages(**kwargs: Any) Dict[str, Any] | Response

Get languages used in the project with percentage value.

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server failed to perform the request

Return type:

Dict[str, Any] | Response

members: ProjectMemberManager
members_all: ProjectMemberAllManager
merge_trains: ProjectMergeTrainManager
mergerequests: ProjectMergeRequestManager
milestones: ProjectMilestoneManager
mirror_pull(**kwargs: Any) None

Start the pull mirroring process for the project.

Parameters:

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

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 (Any) – Extra options to send to the server (e.g. sudo)

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: ProjectNoteManager
notificationsettings: ProjectNotificationSettingsManager
package_protection_rules: ProjectPackageProtectionRuleManager
packages: ProjectPackageManager
pagesdomains: ProjectPagesDomainManager
pipelines: ProjectPipelineManager
pipelineschedules: ProjectPipelineScheduleManager
protected_environments: ProjectProtectedEnvironmentManager
protectedbranches: ProjectProtectedBranchManager
protectedtags: ProjectProtectedTagManager
pushrules: ProjectPushRulesManager
registry_protection_rules: ProjectRegistryProtectionRuleManager
releases: ProjectReleaseManager
remote_mirrors: ProjectRemoteMirrorManager
repositories: ProjectRegistryRepositoryManager
resource_groups: ProjectResourceGroupManager
restore(**kwargs: Any) None

Restore a project marked for deletion.

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabRestoreError – If the server failed to perform the request

Return type:

None

runners: ProjectRunnerManager
search(scope: str, search: str, **kwargs: Any) 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 (Any) – Extra options to send to the server (e.g. sudo)

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:

GitlabList | List[Dict[str, Any]]

secure_files: ProjectSecureFileManager
services: ProjectServiceManager
share(group_id: int, group_access: int, expires_at: str | None = 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 (Any) – Extra options to send to the server (e.g. sudo)

  • expires_at (str | None)

  • **kwargs

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: Callable[[bytes], None] | None = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) bytes | Iterator[Any] | None

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 (Callable[[bytes], None] | None) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

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:

bytes | Iterator[Any] | None

snippets: ProjectSnippetManager
star(**kwargs: Any) None

Star a project.

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Return type:

None

storage: ProjectStorageManager
tags: ProjectTagManager
transfer(to_namespace: int | str, **kwargs: Any) None

Transfer a project to the given namespace ID

Parameters:
  • to_namespace (int | str) – ID or path of the namespace to transfer the

  • to (project)

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabTransferProjectError – If the project could not be transferred

Return type:

None

trigger_pipeline(ref: str, token: str, variables: Dict[str, Any] | None = None, **kwargs: Any) 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 (Dict[str, Any] | None) – Variables passed to the build script

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabCreateError – If the server failed to perform the request

Return type:

ProjectPipeline

triggers: ProjectTriggerManager
unarchive(**kwargs: Any) None

Unarchive a project.

Parameters:

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

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 (Any) – Extra options to send to the server (e.g. sudo)

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 (Any) – Extra options to send to the server (e.g. sudo)

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabDeleteError – If the server failed to perform the request

Return type:

None

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

Bases: AccessRequestMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectAccessRequestManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, CreateMixin, DeleteMixin, RESTManager

Object Creation

Object update

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

Bases: ObjectDeleteMixin, ObjectRotateMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectAccessTokenManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CreateMixin, DeleteMixin, RetrieveMixin, RotateMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

  • scopes

Optional attributes for object create:

  • access_level

  • expires_at

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) ProjectAccessToken

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectAccessToken

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

Bases: RefreshMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectAdditionalStatisticsManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, RESTManager

Object Creation

Object update

Parameters:
get(**kwargs: Any) ProjectAdditionalStatistics

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectAdditionalStatistics

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

Bases: SaveMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectApprovalManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, UpdateMixin, 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:
get(**kwargs: Any) ProjectApproval

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectApproval

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectApprovalRuleManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ListMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

  • approvals_required

Optional attributes for object create:

  • user_ids

  • group_ids

  • protected_branch_ids

  • usernames

Object update

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

Bases: RESTObject

Dummy object to manage custom actions on artifacts

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectArtifactManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RESTManager

Object Creation

Object update

Parameters:
delete(**kwargs: Any) None

Delete the project’s artifacts on the server.

Parameters:

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

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: Callable[[bytes], None] | None = None, chunk_size: int = 1024, *, iterator: bool = False, **kwargs: Any) bytes | Iterator[Any] | None

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 are not supported.

  • 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 (Callable[[bytes], None] | None) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

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:

bytes | Iterator[Any] | None

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

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 (Callable[[bytes], None] | None) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

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:

bytes | Iterator[Any] | None

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

Bases: ProjectAuditEvent

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectAuditEventManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: RetrieveMixin, RESTManager

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) ProjectAuditEvent

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectAuditEvent

class gitlab.v4.objects.ProjectAuditManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: ProjectAuditEventManager

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectBadgeManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: BadgeRenderMixin, CRUDMixin, RESTManager

Object Creation

Required attributes for object create:

  • link_url

  • image_url

Object update

Optional attributes for object update:

  • link_url

  • image_url

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) ProjectBadge

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectBadge

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectBoardListManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, RESTManager

Object Creation

Mutually exclusive attributes for object create:

  • label_id

  • assignee_id

  • milestone_id

Object update

Required attributes for object update:

  • position

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) ProjectBoardList

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectBoardList

class gitlab.v4.objects.ProjectBoardManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) ProjectBoard

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectBoard

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

Bases: ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectBranchManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: NoUpdateMixin, RESTManager

Object Creation

Required attributes for object create:

  • branch

  • ref

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) ProjectBranch

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectBranch

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectCiLintManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: GetWithoutIdMixin, CreateMixin, RESTManager

Object Creation

Required attributes for object create:

  • content

Optional attributes for object create:

  • dry_run

  • include_jobs

  • ref

Object update

Parameters:
get(**kwargs: Any) ProjectCiLint

Retrieve a single object.

Parameters:

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

Returns:

The generated RESTObject

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

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:
Return type:

None

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Bases: SaveMixin, ObjectDeleteMixin, RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

class gitlab.v4.objects.ProjectClusterAgentManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: NoUpdateMixin, RESTManager

Object Creation

Required attributes for object create:

  • name

Object update

Parameters:
get(id: str | int, lazy: bool = False, **kwargs: Any) ProjectClusterAgent

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectClusterAgent

class gitlab.v4.objects.ProjectClusterManager(gl: Gitlab, parent: RESTObject | None = None)

Bases: CRUDMixin, 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:
create(data: Dict[str, Any] | None = None, **kwargs: Any) ProjectCluster

Create a new object.

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

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

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:

ProjectCluster

get(id: str | int, lazy: bool = False, **kwargs: Any) ProjectCluster

Retrieve a single object.

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

Returns:

The generated RESTObject.

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the server cannot perform the request

Return type:

ProjectCluster

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

Bases: RESTObject

Parameters:
  • manager (RESTManager)

  • attrs (Dict[str, Any])

  • created_from_list (bool)

  • lazy (bool)

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

Cherry-pick a commit into a branch.

Parameters:
  • branch (str) – Name of target branch

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

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

Return type:

None

comments: ProjectCommitCommentManager
diff(**kwargs: Any) GitlabList | List[Dict[str, Any]]

Generate the commit diff.

Parameters:

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

Raises:
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetError – If the diff could not be retrieved

Returns:

The changes done in this commit

Return type:

GitlabList | List[Dict[str, Any]]

discussions: ProjectCommitDiscussionManager</