gitlab.v4 package

Submodules

gitlab.v4.objects module

class gitlab.v4.objects.Application(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.ApplicationAppearance(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

Optional attributes for object update:

  • title

  • description

  • logo

  • header_logo

  • favicon

  • new_project_guidelines

  • header_message

  • footer_message

  • message_background_color

  • message_font_color

  • email_header_and_footer_enabled

gitlab: gitlab.client.Gitlab
update(id=None, new_data=None, **kwargs)

Update an object on the server.

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

  • new_data – the update data for the object

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

Returns

The new object data (not a RESTObject)

Return type

dict

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

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

Object Creation

Mandatory attributes:

  • name

  • redirect_uri

  • scopes

Optional attributes:

  • confidential

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ApplicationSettings(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

Optional attributes for object update:

  • id

  • default_projects_limit

  • signup_enabled

  • password_authentication_enabled_for_web

  • gravatar_enabled

  • sign_in_text

  • created_at

  • updated_at

  • home_page_url

  • default_branch_protection

  • restricted_visibility_levels

  • max_attachment_size

  • session_expire_delay

  • default_project_visibility

  • default_snippet_visibility

  • default_group_visibility

  • outbound_local_requests_whitelist

  • disabled_oauth_sign_in_sources

  • domain_whitelist

  • domain_blacklist_enabled

  • domain_blacklist

  • domain_allowlist

  • domain_denylist_enabled

  • domain_denylist

  • external_authorization_service_enabled

  • external_authorization_service_url

  • external_authorization_service_default_label

  • external_authorization_service_timeout

  • import_sources

  • user_oauth_applications

  • after_sign_out_path

  • container_registry_token_expire_delay

  • repository_storages

  • plantuml_enabled

  • plantuml_url

  • terminal_max_session_time

  • polling_interval_multiplier

  • rsa_key_restriction

  • dsa_key_restriction

  • ecdsa_key_restriction

  • ed25519_key_restriction

  • first_day_of_week

  • enforce_terms

  • terms

  • performance_bar_allowed_group_id

  • instance_statistics_visibility_private

  • user_show_add_ssh_key_message

  • file_template_project_id

  • local_markdown_version

  • asset_proxy_enabled

  • asset_proxy_url

  • asset_proxy_whitelist

  • asset_proxy_allowlist

  • geo_node_allowed_ips

  • allow_local_requests_from_hooks_and_services

  • allow_local_requests_from_web_hooks_and_services

  • allow_local_requests_from_system_hooks

gitlab: gitlab.client.Gitlab
update(id=None, new_data=None, **kwargs)

Update an object on the server.

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

  • new_data – the update data for the object

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

Returns

The new object data (not a RESTObject)

Return type

dict

Raises
class gitlab.v4.objects.AuditEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • created_after

  • created_before

  • entity_type

  • entity_id

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.BroadcastMessage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • message

Optional attributes:

  • starts_at

  • ends_at

  • color

  • font

Object update

Optional attributes for object update:

  • message

  • starts_at

  • ends_at

  • color

  • font

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.CurrentUser(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

manager: gitlab.base.RESTManager
class gitlab.v4.objects.CurrentUserEmail(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • email

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.CurrentUserGPGKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • key

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.CurrentUserKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • title

  • key

Object update

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.CurrentUserStatus(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

Optional attributes for object update:

  • emoji

  • message

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.DeployKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.DeployToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Dockerfile(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Event(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • action

  • target_type

  • before

  • after

  • sort

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Feature(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
set(name, value, feature_group=None, user=None, group=None, project=None, **kwargs)

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) – A feature group name

  • user (str) – A GitLab username

  • group (str) – A GitLab group

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

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

Raises
Returns

The created/updated attribute

Return type

obj

class gitlab.v4.objects.GenericPackage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

Bases: gitlab.base.RESTManager

Object Creation

Object update

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

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 reatment

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The package content if streamed is False, None otherwise

Return type

str

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

Upload a file as a generic package.

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

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

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

  • path (str) – The path to a local file to upload

Raises
Returns

An object storing the metadata of the uploaded package.

Return type

GenericPackage

class gitlab.v4.objects.GeoNode(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
repair(**kwargs)

Repair the OAuth authentication of the geo node.

Parameters

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

Raises
status(**kwargs)

Get the status of the geo node.

Parameters

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

Raises
Returns

The status of the geo node

Return type

dict

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

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

Object Creation

Object update

Optional attributes for object update:

  • enabled

  • url

  • files_max_capacity

  • repos_max_capacity

current_failures(**kwargs)

Get the list of failures on the current geo node.

Parameters

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

Raises
Returns

The list of failures

Return type

list

gitlab: gitlab.client.Gitlab
status(**kwargs)

Get the status of all the geo nodes.

Parameters

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

Raises
Returns

The status of all the geo nodes

Return type

list

class gitlab.v4.objects.Gitignore(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Gitlabciyml(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Group(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

Add an LDAP group link.

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

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

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

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

Raises

Delete an LDAP group link.

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

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

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

Raises
ldap_sync(**kwargs)

Sync LDAP groups.

Parameters

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

Raises
manager: gitlab.base.RESTManager
search(scope, search, **kwargs)

Search the group resources matching the provided string.’

Parameters
  • scope (str) – Scope of the search

  • search (str) – Search string

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

Raises
Returns

A list of dicts describing the resources found.

Return type

GitlabList

share(group_id, group_access, expires_at=None, **kwargs)

Share the group with a group.

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

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

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

Raises
transfer_project(to_project_id, **kwargs)

Transfer a project to this group.

Parameters
  • to_project_id (int) – ID of the project to transfer

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

Raises
unshare(group_id, **kwargs)

Delete a shared group link within a group.

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

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

Raises
class gitlab.v4.objects.GroupAccessRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupAuditEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupBadge(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • link_url

  • image_url

Object update

Optional attributes for object update:

  • link_url

  • image_url

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupBillableMember(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object listing filters

  • search

  • sort

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupBillableMemberMembership(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupBoard(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.GroupBoardList(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • label_id

Object update

Mandatory attributes for object update:

  • position

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

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

Object Creation

Mandatory attributes:

  • name

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupCluster(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

  • platform_kubernetes_attributes

Optional attributes:

  • domain

  • enabled

  • managed

  • environment_scope

Object update

Optional attributes for object update:

  • name

  • domain

  • management_project_id

  • platform_kubernetes_attributes

  • environment_scope

create(data, **kwargs)

Create a new object.

Parameters
  • data (dict) – Parameters to send to the server to create the resource

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

Raises
Returns

A new instance of the manage object class build with

the data sent by the server

Return type

RESTObject

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupCustomAttribute(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupDeployToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

  • scopes

Optional attributes:

  • expires_at

  • username

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupDescendantGroup(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

Bases: gitlab.v4.objects.groups.GroupSubgroupManager

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

Object listing filters

  • skip_groups

  • all_available

  • search

  • order_by

  • sort

  • statistics

  • owned

  • with_custom_attributes

  • min_access_level

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupEpic(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.GroupEpicIssue(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

Save the changes made to the object to the server.

The object is updated to match what the server returns.

Parameters

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

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

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

Object Creation

Mandatory attributes:

  • issue_id

Object update

Optional attributes for object update:

  • move_before_id

  • move_after_id

create(data, **kwargs)

Create a new object.

Parameters
  • data (dict) – Parameters to send to the server to create the resource

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

Raises
Returns

A new instance of the manage object class build with

the data sent by the server

Return type

RESTObject

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

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

Object listing filters

  • author_id

  • labels

  • order_by

  • sort

  • search

Object Creation

Mandatory attributes:

  • title

Optional attributes:

  • labels

  • description

  • start_date

  • end_date

Object update

Optional attributes for object update:

  • title

  • labels

  • description

  • start_date

  • end_date

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupEpicResourceLabelEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupExport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupHook(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • url

Optional attributes:

  • 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

Mandatory 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

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupImport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupIssue(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • state

  • labels

  • milestone

  • order_by

  • sort

  • iids

  • author_id

  • assignee_id

  • my_reaction_emoji

  • search

  • created_after

  • created_before

  • updated_after

  • updated_before

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupIssuesStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupLabel(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

Saves the changes made to the object to the server.

The object is updated to match what the server returns.

Parameters

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

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

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

Object Creation

Mandatory attributes:

  • name

  • color

Optional attributes:

  • description

  • priority

Object update

Mandatory attributes for object update:

  • name

Optional attributes for object update:

  • new_name

  • color

  • description

  • priority

delete(name, **kwargs)

Delete a Label on the server.

Parameters
  • name – The name of the label

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

Raises
gitlab: gitlab.client.Gitlab
update(name, new_data=None, **kwargs)

Update a Label on the server.

Parameters
  • name – The name of the label

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

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

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

Object listing filters

  • skip_groups

  • all_available

  • search

  • order_by

  • sort

  • statistics

  • owned

  • with_custom_attributes

  • min_access_level

  • top_level_only

Object Creation

Mandatory attributes:

  • name

  • path

Optional attributes:

  • 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

gitlab: gitlab.client.Gitlab
import_group(file, path, name, parent_id=None, **kwargs)

Import a group from an archive file.

Parameters
  • file – 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 (str) – ID of a parent group that the group will be imported into.

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

Raises
Returns

A representation of the import status.

Return type

dict

class gitlab.v4.objects.GroupMember(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

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

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

Object Creation

Mandatory attributes:

  • access_level

  • user_id

Optional attributes:

  • expires_at

Object update

Mandatory attributes for object update:

  • access_level

Optional attributes for object update:

  • expires_at

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupMergeRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • state

  • order_by

  • sort

  • milestone

  • view

  • labels

  • created_after

  • created_before

  • updated_after

  • updated_before

  • scope

  • author_id

  • assignee_id

  • approver_ids

  • approved_by_ids

  • my_reaction_emoji

  • source_branch

  • target_branch

  • search

  • wip

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupMilestone(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

issues(**kwargs)

List issues related to this milestone.

Parameters
  • all (bool) – If True, return all the items, without pagination

  • per_page (int) – Number of items to retrieve per request

  • page (int) – ID of the page to return (starts with page 1)

  • as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list

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

Raises
Returns

The list of issues

Return type

RESTObjectList

manager: gitlab.base.RESTManager
merge_requests(**kwargs)

List the merge requests related to this milestone.

Parameters
  • all (bool) – If True, return all the items, without pagination

  • per_page (int) – Number of items to retrieve per request

  • page (int) – ID of the page to return (starts with page 1)

  • as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list

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

Raises
Returns

The list of merge requests

Return type

RESTObjectList

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

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

Object listing filters

  • iids

  • state

  • search

Object Creation

Mandatory attributes:

  • title

Optional attributes:

  • description

  • due_date

  • start_date

Object update

Optional attributes for object update:

  • title

  • description

  • due_date

  • start_date

  • state_event

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupNotificationSettings(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.v4.objects.notification_settings.NotificationSettings

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

Bases: gitlab.v4.objects.notification_settings.NotificationSettingsManager

Object Creation

Object update

Optional attributes for object update:

  • level

  • notification_email

  • new_note

  • new_issue

  • reopen_issue

  • close_issue

  • reassign_issue

  • new_merge_request

  • reopen_merge_request

  • close_merge_request

  • reassign_merge_request

  • merge_merge_request

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupPackage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • exclude_subgroups

  • order_by

  • sort

  • package_type

  • package_name

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupProject(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • archived

  • visibility

  • order_by

  • sort

  • search

  • simple

  • owned

  • starred

  • with_custom_attributes

  • include_subgroups

  • with_issues_enabled

  • with_merge_requests_enabled

  • with_shared

  • min_access_level

  • with_security_reports

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupRunner(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object listing filters

  • scope

  • tag_list

Object Creation

Mandatory attributes:

  • runner_id

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupSubgroup(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • skip_groups

  • all_available

  • search

  • order_by

  • sort

  • statistics

  • owned

  • with_custom_attributes

  • min_access_level

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupVariable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • key

  • value

Optional attributes:

  • protected

  • variable_type

  • masked

Object update

Mandatory attributes for object update:

  • key

  • value

Optional attributes for object update:

  • protected

  • variable_type

  • masked

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.GroupWiki(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object listing filters

  • with_content

Object Creation

Mandatory attributes:

  • title

  • content

Optional attributes:

  • format

Object update

Optional attributes for object update:

  • title

  • content

  • format

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Hook(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • url

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Issue(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • state

  • labels

  • milestone

  • scope

  • author_id

  • assignee_id

  • my_reaction_emoji

  • iids

  • order_by

  • sort

  • search

  • created_after

  • created_before

  • updated_after

  • updated_before

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.IssuesStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Key(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

get(id=None, **kwargs)

Retrieve a single object.

Parameters
  • id (int or str) – ID of the object to retrieve

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

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

Returns

The generated RESTObject.

Return type

object

Raises
gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.LDAPGroup(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

Bases: gitlab.base.RESTManager

Object listing filters

  • search

  • provider

Object Creation

Object update

gitlab: gitlab.client.Gitlab
list(**kwargs)

Retrieve a list of objects.

Parameters
  • all (bool) – If True, return all the items, without pagination

  • per_page (int) – Number of items to retrieve per request

  • page (int) – ID of the page to return (starts with page 1)

  • as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list

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

Returns

The list of objects, or a generator if as_list is False

Return type

list

Raises
class gitlab.v4.objects.License(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • popular

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.MergeRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • state

  • order_by

  • sort

  • milestone

  • view

  • labels

  • with_labels_details

  • with_merge_status_recheck

  • created_after

  • created_before

  • updated_after

  • updated_before

  • scope

  • author_id

  • author_username

  • assignee_id

  • approver_ids

  • approved_by_ids

  • reviewer_id

  • reviewer_username

  • my_reaction_emoji

  • source_branch

  • target_branch

  • search

  • in

  • wip

  • not

  • environment

  • deployed_before

  • deployed_after

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Namespace(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • search

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.NotificationSettings(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

Optional attributes for object update:

  • level

  • notification_email

  • new_note

  • new_issue

  • reopen_issue

  • close_issue

  • reassign_issue

  • new_merge_request

  • reopen_merge_request

  • close_merge_request

  • reassign_merge_request

  • merge_merge_request

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.PagesDomain(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.PersonalAccessToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • user_id

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Project(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

archive(**kwargs: Any)None

Archive a project.

Parameters

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

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

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

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The artifacts if streamed is False, None otherwise.

Return type

str

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

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

  • not supported. (are) –

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

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

  • job_token (str) – 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

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The artifacts if streamed is False, None otherwise.

Return type

str

create_fork_relation(forked_from_id: int, **kwargs: Any)None

Create a forked from/to relation between existing projects.

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

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

Raises
delete_fork_relation(**kwargs: Any)None

Delete a forked relation between existing projects.

Parameters

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

Raises
housekeeping(**kwargs: Any)None

Start the housekeeping task.

Parameters

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

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

Get languages used in the project with percentage value.

Parameters

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

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

Start the pull mirroring process for the project.

Parameters

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

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

Search the project resources matching the provided string.’

Parameters
  • scope (str) – Scope of the search

  • search (str) – Search string

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

Raises
Returns

A list of dicts describing the resources found.

Return type

GitlabList

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

Share the project with a group.

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

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

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

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

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.

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The uncompressed tar archive of the repository

Return type

str

star(**kwargs: Any)None

Star a project.

Parameters

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

Raises
transfer_project(to_namespace: str, **kwargs: Any)None

Transfer a project to the given namespace ID

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

  • to (project) –

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

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

Trigger a CI build.

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

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

  • token (str) – The trigger token

  • variables (dict) – Variables passed to the build script

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

Raises
unarchive(**kwargs: Any)None

Unarchive a project.

Parameters

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

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

Delete a shared project link within a group.

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

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

Raises
unstar(**kwargs: Any)None

Unstar a project.

Parameters

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

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

Upload the specified file into the project.

Note

Either filedata or filepath MUST be specified.

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

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

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

Raises
Returns

A dict with the keys:
  • alt - The alternate text for the upload

  • url - The direct url to the uploaded file

  • markdown - Markdown for the uploaded file

Return type

dict

class gitlab.v4.objects.ProjectAccessRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectAdditionalStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectApproval(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

Optional attributes for object update:

  • approvals_before_merge

  • reset_approvals_on_push

  • disable_overriding_approvers_per_merge_request

  • merge_requests_author_approval

  • merge_requests_disable_committers_approval

gitlab: gitlab.client.Gitlab
set_approvers(approver_ids=None, approver_group_ids=None, **kwargs)

Change project-level allowed approvers and approver groups.

Parameters
  • approver_ids (list) – User IDs that can approve MRs

  • approver_group_ids (list) – Group IDs whose members can approve MRs

Raises
class gitlab.v4.objects.ProjectApprovalRule(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

  • approvals_required

Optional attributes:

  • user_ids

  • group_ids

  • protected_branch_ids

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectAudit(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.v4.objects.audit_events.ProjectAuditEvent

manager: gitlab.base.RESTManager
class gitlab.v4.objects.ProjectAuditEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

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

Bases: gitlab.v4.objects.audit_events.ProjectAuditEventManager

Object listing filters

  • created_after

  • created_before

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectBadge(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • link_url

  • image_url

Object update

Optional attributes for object update:

  • link_url

  • image_url

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectBoard(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.ProjectBoardList(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • label_id

Object update

Mandatory attributes for object update:

  • position

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

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

Object Creation

Mandatory attributes:

  • name

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectBranch(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
protect(developers_can_push=False, developers_can_merge=False, **kwargs)

Protect the branch.

Parameters
  • developers_can_push (bool) – Set to True if developers are allowed to push to the branch

  • developers_can_merge (bool) – Set to True if developers are allowed to merge to the branch

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

Raises
unprotect(**kwargs)

Unprotect the branch.

Parameters

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

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

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

Object Creation

Mandatory attributes:

  • branch

  • ref

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectCluster(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

  • platform_kubernetes_attributes

Optional attributes:

  • domain

  • enabled

  • managed

  • environment_scope

Object update

Optional attributes for object update:

  • name

  • domain

  • management_project_id

  • platform_kubernetes_attributes

  • environment_scope

create(data, **kwargs)

Create a new object.

Parameters
  • data (dict) – Parameters to send to the server to create the resource

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

Raises
Returns

A new instance of the manage object class build with

the data sent by the server

Return type

RESTObject

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectCommit(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

cherry_pick(branch, **kwargs)

Cherry-pick a commit into a branch.

Parameters
  • branch (str) – Name of target branch

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

Raises
diff(**kwargs)

Generate the commit diff.

Parameters

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

Raises
Returns

The changes done in this commit

Return type

list

manager: gitlab.base.RESTManager
merge_requests(**kwargs)

List the merge requests related to the commit.

Parameters

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

Raises
Returns

The merge requests related to the commit.

Return type

list

refs(type='all', **kwargs)

List the references the commit is pushed to.

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

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

Raises
Returns

The references the commit is pushed to.

Return type

list

revert(branch, **kwargs)

Revert a commit on a given branch.

Parameters
  • branch (str) – Name of target branch

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

Raises
Returns

The new commit data (not a RESTObject)

Return type

dict

signature(**kwargs)

Get the signature of the commit.

Parameters

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

Raises
Returns

The commit’s signature data

Return type

dict

class gitlab.v4.objects.ProjectCommitComment(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Mandatory attributes:

  • note

Optional attributes:

  • path

  • line

  • line_type

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectCommitDiscussion(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectCommitDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

  • position

Object update

Mandatory attributes for object update:

  • body

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

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

Object Creation

Mandatory attributes:

  • branch

  • commit_message

  • actions

Optional attributes:

  • author_email

  • author_name

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectCommitStatus(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • state

Optional attributes:

  • description

  • name

  • context

  • ref

  • target_url

  • coverage

Object update

create(data, **kwargs)

Create a new object.

Parameters
  • data (dict) – Parameters to send to the server to create the resource

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

Raises
Returns

A new instance of the manage object class build with

the data sent by the server

Return type

RESTObject

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectCustomAttribute(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectDeployToken(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

  • scopes

Optional attributes:

  • expires_at

  • username

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectDeployment(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object listing filters

  • order_by

  • sort

  • updated_after

  • updated_before

  • environment

  • status

Object Creation

Mandatory attributes:

  • sha

  • ref

  • tag

  • status

  • environment

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectDeploymentMergeRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.v4.objects.merge_requests.MergeRequest

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

Bases: gitlab.v4.objects.merge_requests.MergeRequestManager

Object listing filters

  • state

  • order_by

  • sort

  • milestone

  • view

  • labels

  • with_labels_details

  • with_merge_status_recheck

  • created_after

  • created_before

  • updated_after

  • updated_before

  • scope

  • author_id

  • author_username

  • assignee_id

  • approver_ids

  • approved_by_ids

  • reviewer_id

  • reviewer_username

  • my_reaction_emoji

  • source_branch

  • target_branch

  • search

  • in

  • wip

  • not

  • environment

  • deployed_before

  • deployed_after

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectEnvironment(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
stop(**kwargs)

Stop the environment.

Parameters

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

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

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

Object Creation

Mandatory attributes:

  • name

Optional attributes:

  • external_url

Object update

Optional attributes for object update:

  • name

  • external_url

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.v4.objects.events.Event

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

Bases: gitlab.v4.objects.events.EventManager

Object listing filters

  • action

  • target_type

  • before

  • after

  • sort

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectExport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Optional attributes:

  • description

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectFile(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

decode()bytes

Returns the decoded content of the file.

Returns

the decoded content.

Return type

(bytes)

delete(branch, commit_message, **kwargs)

Delete the file from the server.

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

  • commit_message (str) – Commit message for the deletion

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

Raises
manager: gitlab.base.RESTManager
save(branch, commit_message, **kwargs)

Save the changes made to the file to the server.

The object is updated to match what the server returns.

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

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

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

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

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

Object Creation

Mandatory attributes:

  • file_path

  • branch

  • content

  • commit_message

Optional attributes:

  • encoding

  • author_email

  • author_name

Object update

Mandatory attributes for object update:

  • file_path

  • branch

  • content

  • commit_message

Optional attributes for object update:

  • encoding

  • author_email

  • author_name

blame(file_path, ref, **kwargs)

Return the content of a file for a commit.

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

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

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

Raises
Returns

a list of commits/lines matching the file

Return type

list(blame)

create(data, **kwargs)

Create a new object.

Parameters
  • data (dict) – parameters to send to the server to create the resource

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

Returns

a new instance of the managed object class built with

the data sent by the server

Return type

RESTObject

Raises
delete(file_path, branch, commit_message, **kwargs)

Delete a file on the server.

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

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

  • commit_message (str) – Commit message for the deletion

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

Raises
get(file_path, ref, **kwargs)

Retrieve a single file.

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

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

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

Raises
Returns

The generated RESTObject

Return type

object

gitlab: gitlab.client.Gitlab
raw(file_path, ref, streamed=False, action=None, chunk_size=1024, **kwargs)

Return the content of a file for a commit.

Parameters
  • ref (str) – ID of the commit

  • filepath (str) – Path of the file to return

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

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The file content

Return type

str

update(file_path, new_data=None, **kwargs)

Update an object on the server.

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

  • new_data – the update data for the object

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

Returns

The new object data (not a RESTObject)

Return type

dict

Raises
class gitlab.v4.objects.ProjectFork(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • archived

  • visibility

  • order_by

  • sort

  • search

  • simple

  • owned

  • membership

  • starred

  • statistics

  • with_custom_attributes

  • with_issues_enabled

  • with_merge_requests_enabled

Object Creation

Optional attributes:

  • namespace

Object update

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

Creates a new object.

Parameters
  • data (dict) – Parameters to send to the server to create the resource

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

Raises
Returns

A new instance of the managed object class build with

the data sent by the server

Return type

RESTObject

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectHook(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • url

Optional attributes:

  • push_events

  • issues_events

  • confidential_issues_events

  • merge_requests_events

  • tag_push_events

  • note_events

  • job_events

  • pipeline_events

  • wiki_page_events

  • enable_ssl_verification

  • token

Object update

Mandatory attributes for object update:

  • url

Optional attributes for object update:

  • push_events

  • issues_events

  • confidential_issues_events

  • merge_requests_events

  • tag_push_events

  • note_events

  • job_events

  • pipeline_events

  • wiki_events

  • enable_ssl_verification

  • token

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectImport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectIssue(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.mixins.UserAgentDetailMixin, gitlab.mixins.SubscribableMixin, gitlab.mixins.TodoMixin, gitlab.mixins.TimeTrackingMixin, gitlab.mixins.ParticipantsMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

closed_by(**kwargs)

List merge requests that will close the issue when merged.

Parameters

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

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetErrot – If the merge requests could not be retrieved

Returns

The list of merge requests.

Return type

list

manager: gitlab.base.RESTManager
move(to_project_id, **kwargs)

Move the issue to another project.

Parameters
  • to_project_id (int) – ID of the target project

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

Raises
related_merge_requests(**kwargs)

List merge requests related to the issue.

Parameters

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

Raises
  • GitlabAuthenticationError – If authentication is not correct

  • GitlabGetErrot – If the merge requests could not be retrieved

Returns

The list of merge requests.

Return type

list

class gitlab.v4.objects.ProjectIssueAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectIssueDiscussion(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectIssueDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

Object update

Mandatory attributes for object update:

  • body

gitlab: gitlab.client.Gitlab

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

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

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

Object Creation

Mandatory attributes:

  • target_project_id

  • target_issue_iid

Object update

create(data, **kwargs)

Create a new object.

Parameters
  • data (dict) – parameters to send to the server to create the resource

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

Returns

The source and target issues

Return type

RESTObject, RESTObject

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

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

Object listing filters

  • iids

  • state

  • labels

  • milestone

  • scope

  • author_id

  • assignee_id

  • my_reaction_emoji

  • order_by

  • sort

  • search

  • created_after

  • created_before

  • updated_after

  • updated_before

Object Creation

Mandatory attributes:

  • title

Optional attributes:

  • description

  • confidential

  • assignee_ids

  • assignee_id

  • milestone_id

  • labels

  • created_at

  • due_date

  • merge_request_to_resolve_discussions_of

  • discussion_to_resolve

Object update

Optional attributes for object update:

  • title

  • description

  • confidential

  • assignee_ids

  • assignee_id

  • milestone_id

  • labels

  • state_event

  • updated_at

  • due_date

  • discussion_locked

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectIssueNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.ProjectIssueNoteAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

Object update

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

Object update

Mandatory attributes for object update:

  • body

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectIssueResourceLabelEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectIssueResourceMilestoneEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectIssueResourceStateEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectIssuesStatistics(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectJob(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

artifact(path, streamed=False, action=None, chunk_size=1024, **kwargs)

Get a single artifact file from within the job’s artifacts archive.

Parameters
  • path (str) – Path of the artifact

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

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The artifacts if streamed is False, None otherwise.

Return type

str

artifacts(streamed=False, action=None, chunk_size=1024, **kwargs)

Get the job artifacts.

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

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The artifacts if streamed is False, None otherwise.

Return type

str

cancel(**kwargs)

Cancel the job.

Parameters

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

Raises
delete_artifacts(**kwargs)

Delete artifacts of a job.

Parameters

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

Raises
erase(**kwargs)

Erase the job (remove job artifacts and trace).

Parameters

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

Raises
keep_artifacts(**kwargs)

Prevent artifacts from being deleted when expiration is set.

Parameters

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

Raises
manager: gitlab.base.RESTManager
play(**kwargs)

Trigger a job explicitly.

Parameters

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

Raises
retry(**kwargs)

Retry the job.

Parameters

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

Raises
trace(streamed=False, action=None, chunk_size=1024, **kwargs)

Get the job trace.

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

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The trace

Return type

str

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectKey(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • title

  • key

Optional attributes:

  • can_push

Object update

Optional attributes for object update:

  • title

  • can_push

enable(key_id, **kwargs)

Enable a deploy key for a project.

Parameters
  • key_id (int) – The ID of the key to enable

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

Raises
gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectLabel(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

Saves the changes made to the object to the server.

The object is updated to match what the server returns.

Parameters

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

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

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

Object Creation

Mandatory attributes:

  • name

  • color

Optional attributes:

  • description

  • priority

Object update

Mandatory attributes for object update:

  • name

Optional attributes for object update:

  • new_name

  • color

  • description

  • priority

delete(name, **kwargs)

Delete a Label on the server.

Parameters
  • name – The name of the label

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

Raises
gitlab: gitlab.client.Gitlab
update(name, new_data=None, **kwargs)

Update a Label on the server.

Parameters
  • name – The name of the label

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

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

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

Object listing filters

  • archived

  • id_after

  • id_before

  • last_activity_after

  • last_activity_before

  • membership

  • min_access_level

  • order_by

  • owned

  • repository_checksum_failed

  • repository_storage

  • search_namespaces

  • search

  • simple

  • sort

  • starred

  • statistics

  • topic

  • visibility

  • wiki_checksum_failed

  • with_custom_attributes

  • with_issues_enabled

  • with_merge_requests_enabled

  • with_programming_language

Object Creation

Optional attributes:

  • name

  • path

  • allow_merge_on_skipped_pipeline

  • analytics_access_level

  • approvals_before_merge

  • auto_cancel_pending_pipelines

  • auto_devops_deploy_strategy

  • auto_devops_enabled

  • autoclose_referenced_issues

  • avatar

  • build_coverage_regex

  • build_git_strategy

  • build_timeout

  • builds_access_level

  • ci_config_path

  • container_expiration_policy_attributes

  • container_registry_enabled

  • default_branch

  • description

  • emails_disabled

  • external_authorization_classification_label

  • forking_access_level

  • group_with_project_templates_id

  • import_url

  • initialize_with_readme

  • issues_access_level

  • issues_enabled

  • jobs_enabled

  • lfs_enabled

  • merge_method

  • merge_requests_access_level

  • merge_requests_enabled

  • mirror_trigger_builds

  • mirror

  • namespace_id

  • operations_access_level

  • only_allow_merge_if_all_discussions_are_resolved

  • only_allow_merge_if_pipeline_succeeds

  • packages_enabled

  • pages_access_level

  • requirements_access_level

  • printing_merge_request_link_enabled

  • public_builds

  • remove_source_branch_after_merge

  • repository_access_level

  • repository_storage

  • request_access_enabled

  • resolve_outdated_diff_discussions

  • shared_runners_enabled

  • show_default_award_emojis

  • snippets_access_level

  • snippets_enabled

  • tag_list

  • template_name

  • template_project_id

  • use_custom_template

  • visibility

  • wiki_access_level

  • wiki_enabled

Object update

Optional attributes for object update:

  • allow_merge_on_skipped_pipeline

  • analytics_access_level

  • approvals_before_merge

  • auto_cancel_pending_pipelines

  • auto_devops_deploy_strategy

  • auto_devops_enabled

  • autoclose_referenced_issues

  • avatar

  • build_coverage_regex

  • build_git_strategy

  • build_timeout

  • builds_access_level

  • ci_config_path

  • ci_default_git_depth

  • ci_forward_deployment_enabled

  • container_expiration_policy_attributes

  • container_registry_enabled

  • default_branch

  • description

  • emails_disabled

  • external_authorization_classification_label

  • forking_access_level

  • import_url

  • issues_access_level

  • issues_enabled

  • jobs_enabled

  • lfs_enabled

  • merge_method

  • merge_requests_access_level

  • merge_requests_enabled

  • mirror_overwrites_diverged_branches

  • mirror_trigger_builds

  • mirror_user_id

  • mirror

  • name

  • operations_access_level

  • only_allow_merge_if_all_discussions_are_resolved

  • only_allow_merge_if_pipeline_succeeds

  • only_mirror_protected_branches

  • packages_enabled

  • pages_access_level

  • requirements_access_level

  • restrict_user_defined_variables

  • path

  • public_builds

  • remove_source_branch_after_merge

  • repository_access_level

  • repository_storage

  • request_access_enabled

  • resolve_outdated_diff_discussions

  • service_desk_enabled

  • shared_runners_enabled

  • show_default_award_emojis

  • snippets_access_level

  • snippets_enabled

  • suggestion_commit_message

  • tag_list

  • visibility

  • wiki_access_level

  • wiki_enabled

  • issues_template

  • merge_requests_template

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

Retrieve a single object.

Parameters
  • id (int or str) – ID of the object to retrieve

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

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

Returns

The generated RESTObject.

Return type

object

Raises
gitlab: gitlab.client.Gitlab
import_bitbucket_server(bitbucket_server_url: str, bitbucket_server_username: str, personal_access_token: str, bitbucket_server_project: str, bitbucket_server_repo: str, new_name: Optional[str] = None, target_namespace: Optional[str] = None, **kwargs: Any)Union[Dict[str, Any], requests.models.Response]

Import a project from BitBucket Server to Gitlab (schedule the import)

This method will return when an import operation has been safely queued, or an error has occurred. After triggering an import, check the import_status of the newly created project to detect when the import operation has completed.

Note

This request may take longer than most other API requests. So this method will specify a 60 second default timeout if none is specified. A timeout can be specified via kwargs to override this functionality.

Parameters
  • bitbucket_server_url (str) – Bitbucket Server URL

  • bitbucket_server_username (str) – Bitbucket Server Username

  • personal_access_token (str) – Bitbucket Server personal access token/password

  • bitbucket_server_project (str) – Bitbucket Project Key

  • bitbucket_server_repo (str) – Bitbucket Repository Name

  • new_name (str) – New repository name (Optional)

  • target_namespace (str) – Namespace to import repository into. Supports subgroups like /namespace/subgroup (Optional)

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

Raises
Returns

A representation of the import status.

Return type

dict

Example:

gl = gitlab.Gitlab_from_config()
print("Triggering import")
result = gl.projects.import_bitbucket_server(
    bitbucket_server_url="https://some.server.url",
    bitbucket_server_username="some_bitbucket_user",
    personal_access_token="my_password_or_access_token",
    bitbucket_server_project="my_project",
    bitbucket_server_repo="my_repo",
    new_name="gl_project_name",
    target_namespace="gl_project_path"
)
project = gl.projects.get(ret['id'])
print("Waiting for import to complete")
while project.import_status == u'started':
    time.sleep(1.0)
    project = gl.projects.get(project.id)
print("BitBucket import complete")
import_github(personal_access_token: str, repo_id: int, target_namespace: str, new_name: Optional[str] = None, **kwargs: Any)Union[Dict[str, Any], requests.models.Response]

Import a project from Github to Gitlab (schedule the import)

This method will return when an import operation has been safely queued, or an error has occurred. After triggering an import, check the import_status of the newly created project to detect when the import operation has completed.

Note

This request may take longer than most other API requests. So this method will specify a 60 second default timeout if none is specified. A timeout can be specified via kwargs to override this functionality.

Parameters
  • personal_access_token (str) – GitHub personal access token

  • repo_id (int) – Github repository ID

  • target_namespace (str) – Namespace to import repo into

  • new_name (str) – New repo name (Optional)

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

Raises
Returns

A representation of the import status.

Return type

dict

Example:

gl = gitlab.Gitlab_from_config()
print("Triggering import")
result = gl.projects.import_github(ACCESS_TOKEN,
                                   123456,
                                   "my-group/my-subgroup")
project = gl.projects.get(ret['id'])
print("Waiting for import to complete")
while project.import_status == u'started':
    time.sleep(1.0)
    project = gl.projects.get(project.id)
print("Github import complete")
import_project(file: str, path: str, name: Optional[str] = None, namespace: Optional[str] = None, overwrite: bool = False, override_params: Optional[Dict[str, Any]] = None, **kwargs: Any)Union[Dict[str, Any], requests.models.Response]

Import a project from an archive file.

Parameters
  • file – Data or file object containing the project

  • path (str) – Name and path for the new project

  • namespace (str) – The ID or path of the namespace that the project will be imported to

  • overwrite (bool) – If True overwrite an existing project with the same path

  • override_params (dict) – Set the specific settings for the project

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

Raises
Returns

A representation of the import status.

Return type

dict

class gitlab.v4.objects.ProjectMember(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

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

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

Object Creation

Mandatory attributes:

  • access_level

  • user_id

Optional attributes:

  • expires_at

Object update

Mandatory attributes for object update:

  • access_level

Optional attributes for object update:

  • expires_at

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequest(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.mixins.SubscribableMixin, gitlab.mixins.TodoMixin, gitlab.mixins.TimeTrackingMixin, gitlab.mixins.ParticipantsMixin, gitlab.mixins.SaveMixin, gitlab.mixins.ObjectDeleteMixin, gitlab.base.RESTObject

approve(sha=None, **kwargs)

Approve the merge request.

Parameters
  • sha (str) – Head SHA of MR

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

Raises
cancel_merge_when_pipeline_succeeds(**kwargs)

Cancel merge when the pipeline succeeds.

Parameters

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

Raises
changes(**kwargs)

List the merge request changes.

Parameters

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

Raises
Returns

List of changes

Return type

RESTObjectList

closes_issues(**kwargs)

List issues that will close on merge.”

Parameters
  • all (bool) – If True, return all the items, without pagination

  • per_page (int) – Number of items to retrieve per request

  • page (int) – ID of the page to return (starts with page 1)

  • as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list

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

Raises
Returns

List of issues

Return type

RESTObjectList

commits(**kwargs)

List the merge request commits.

Parameters
  • all (bool) – If True, return all the items, without pagination

  • per_page (int) – Number of items to retrieve per request

  • page (int) – ID of the page to return (starts with page 1)

  • as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list

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

Raises
Returns

The list of commits

Return type

RESTObjectList

manager: gitlab.base.RESTManager
merge(merge_commit_message=None, should_remove_source_branch=False, merge_when_pipeline_succeeds=False, **kwargs)

Accept the merge request.

Parameters
  • merge_commit_message (bool) – Commit message

  • should_remove_source_branch (bool) – If True, removes the source branch

  • merge_when_pipeline_succeeds (bool) – Wait for the build to succeed, then merge

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

Raises
merge_ref(**kwargs)
Attempt to merge changes between source and target branches into

refs/merge-requests/:iid/merge.

Parameters

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

Raises

GitlabGetError – If cannot be merged

rebase(**kwargs)

Attempt to rebase the source branch onto the target branch

Parameters

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

Raises
unapprove(**kwargs)

Unapprove the merge request.

Parameters

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

Raises
class gitlab.v4.objects.ProjectMergeRequestApproval(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

Mandatory attributes for object update:

  • approvals_required

gitlab: gitlab.client.Gitlab
set_approvers(approvals_required, approver_ids=None, approver_group_ids=None, approval_rule_name='name', **kwargs)

Change MR-level allowed approvers and approver groups.

Parameters
  • approvals_required (integer) – The number of required approvals for this rule

  • approver_ids (list of integers) – User IDs that can approve MRs

  • approver_group_ids (list) – Group IDs whose members can approve MRs

Raises
class gitlab.v4.objects.ProjectMergeRequestApprovalRule(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

Save the changes made to the object to the server.

The object is updated to match what the server returns.

Parameters

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

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

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

Object listing filters

  • name

  • rule_type

Object Creation

Mandatory attributes:

  • id

  • merge_request_iid

  • name

  • approvals_required

Optional attributes:

  • approval_project_rule_id

  • user_ids

  • group_ids

Object update

Mandatory attributes for object update:

  • id

  • merge_request_iid

  • approval_rule_id

  • name

  • approvals_required

Optional attributes for object update:

  • user_ids

  • group_ids

create(data, **kwargs)

Create a new object.

Parameters
  • data (dict) – Parameters to send to the server to create the resource

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

Raises
Returns

A new instance of the manage object class build with

the data sent by the server

Return type

RESTObject

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestDiff(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestDiscussion(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

  • position

Object update

Mandatory attributes for object update:

  • resolved

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

Object update

Mandatory attributes for object update:

  • body

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

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

Object listing filters

  • state

  • order_by

  • sort

  • milestone

  • view

  • labels

  • created_after

  • created_before

  • updated_after

  • updated_before

  • scope

  • iids

  • author_id

  • assignee_id

  • approver_ids

  • approved_by_ids

  • my_reaction_emoji

  • source_branch

  • target_branch

  • search

  • wip

Object Creation

Mandatory attributes:

  • source_branch

  • target_branch

  • title

Optional attributes:

  • assignee_id

  • description

  • target_project_id

  • labels

  • milestone_id

  • remove_source_branch

  • allow_maintainer_to_push

  • squash

  • reviewer_ids

Object update

Optional attributes for object update:

  • target_branch

  • assignee_id

  • title

  • description

  • state_event

  • labels

  • milestone_id

  • remove_source_branch

  • discussion_locked

  • allow_maintainer_to_push

  • squash

  • reviewer_ids

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.ProjectMergeRequestNoteAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

Object update

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

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

Object Creation

Mandatory attributes:

  • body

Object update

Mandatory attributes for object update:

  • body

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestPipeline(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestResourceLabelEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestResourceMilestoneEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMergeRequestResourceStateEvent(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectMilestone(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

issues(**kwargs)

List issues related to this milestone.

Parameters
  • all (bool) – If True, return all the items, without pagination

  • per_page (int) – Number of items to retrieve per request

  • page (int) – ID of the page to return (starts with page 1)

  • as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list

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

Raises
Returns

The list of issues

Return type

RESTObjectList

manager: gitlab.base.RESTManager
merge_requests(**kwargs)

List the merge requests related to this milestone.

Parameters
  • all (bool) – If True, return all the items, without pagination

  • per_page (int) – Number of items to retrieve per request

  • page (int) – ID of the page to return (starts with page 1)

  • as_list (bool) – If set to False and no pagination option is defined, return a generator instead of a list

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

Raises
Returns

The list of merge requests

Return type

RESTObjectList

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

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

Object listing filters

  • iids

  • state

  • search

Object Creation

Mandatory attributes:

  • title

Optional attributes:

  • description

  • due_date

  • start_date

  • state_event

Object update

Optional attributes for object update:

  • title

  • description

  • due_date

  • start_date

  • state_event

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Mandatory attributes:

  • body

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectNotificationSettings(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.v4.objects.notification_settings.NotificationSettings

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

Bases: gitlab.v4.objects.notification_settings.NotificationSettingsManager

Object Creation

Object update

Optional attributes for object update:

  • level

  • notification_email

  • new_note

  • new_issue

  • reopen_issue

  • close_issue

  • reassign_issue

  • new_merge_request

  • reopen_merge_request

  • close_merge_request

  • reassign_merge_request

  • merge_merge_request

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPackage(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.ProjectPackageFile(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

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

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

Object listing filters

  • order_by

  • sort

  • package_type

  • package_name

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPagesDomain(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • domain

Optional attributes:

  • certificate

  • key

Object update

Optional attributes for object update:

  • certificate

  • key

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPipeline(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

cancel(**kwargs)

Cancel the job.

Parameters

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

Raises
manager: gitlab.base.RESTManager
retry(**kwargs)

Retry the job.

Parameters

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

Raises
class gitlab.v4.objects.ProjectPipelineBridge(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • scope

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPipelineJob(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • scope

  • include_retried

Object Creation

Object update

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

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

Object listing filters

  • scope

  • status

  • ref

  • sha

  • yaml_errors

  • name

  • username

  • order_by

  • sort

Object Creation

Mandatory attributes:

  • ref

Object update

create(data, **kwargs)

Creates a new object.

Parameters
  • data (dict) – Parameters to send to the server to create the resource

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

Raises
Returns

A new instance of the managed object class build with

the data sent by the server

Return type

RESTObject

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPipelineSchedule(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
play(**kwargs)

Trigger a new scheduled pipeline, which runs immediately. The next scheduled run of this pipeline is not affected.

Parameters

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

Raises
take_ownership(**kwargs)

Update the owner of a pipeline schedule.

Parameters

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

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

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

Object Creation

Mandatory attributes:

  • description

  • ref

  • cron

Optional attributes:

  • cron_timezone

  • active

Object update

Optional attributes for object update:

  • description

  • ref

  • cron

  • cron_timezone

  • active

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPipelineScheduleVariable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • key

  • value

Object update

Mandatory attributes for object update:

  • key

  • value

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPipelineTestReport(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPipelineVariable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectProtectedBranch(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

Optional attributes:

  • push_access_level

  • merge_access_level

  • unprotect_access_level

  • allowed_to_push

  • allowed_to_merge

  • allowed_to_unprotect

  • code_owner_approval_required

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectProtectedTag(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

Optional attributes:

  • create_access_level

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectPushRules(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Optional attributes:

  • deny_delete_tag

  • member_check

  • prevent_secrets

  • commit_message_regex

  • branch_name_regex

  • author_email_regex

  • file_name_regex

  • max_file_size

Object update

Optional attributes for object update:

  • deny_delete_tag

  • member_check

  • prevent_secrets

  • commit_message_regex

  • branch_name_regex

  • author_email_regex

  • file_name_regex

  • max_file_size

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectRegistryRepository(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectRegistryTag(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

delete_in_bulk(name_regex='.*', **kwargs)

Delete Tag in bulk

Parameters
  • name_regex (string) – The regex of the name to delete. To delete all tags specify .*.

  • keep_n (integer) – The amount of latest tags of given name to keep.

  • name_regex_keep (string) – The regex of the name to keep. This value overrides any matches from name_regex.

  • older_than (string) – Tags to delete that are older than the given time, written in human readable form 1h, 1d, 1month.

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

Raises
gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectRelease(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager

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

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

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

Object Creation

Mandatory attributes:

  • name

  • url

Optional attributes:

  • filepath

  • link_type

Object update

Optional attributes for object update:

  • name

  • url

  • filepath

  • link_type

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

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

Object Creation

Mandatory attributes:

  • tag_name

  • description

Optional attributes:

  • name

  • ref

  • assets

Object update

Optional attributes for object update:

  • name

  • description

  • milestones

  • released_at

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectRemoteMirror(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • url

Optional attributes:

  • enabled

  • only_protected_branches

Object update

Optional attributes for object update:

  • enabled

  • only_protected_branches

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectRunner(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object listing filters

  • scope

  • tag_list

Object Creation

Mandatory attributes:

  • runner_id

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectService(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Object update

available(**kwargs)

List the services known by python-gitlab.

Returns

The list of service code names.

Return type

list (str)

get(id, **kwargs)

Retrieve a single object.

Parameters
  • id (int or str) – ID of the object to retrieve

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

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

Returns

The generated RESTObject.

Return type

object

Raises
gitlab: gitlab.client.Gitlab
update(id=None, new_data=None, **kwargs)

Update an object on the server.

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

  • new_data – the update data for the object

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

Returns

The new object data (not a RESTObject)

Return type

dict

Raises
class gitlab.v4.objects.ProjectSnippet(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

content(streamed=False, action=None, chunk_size=1024, **kwargs)

Return the content of a snippet.

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

  • action (callable) – Callable responsible of dealing with chunk of data

  • chunk_size (int) – Size of each chunk

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

Raises
Returns

The snippet content

Return type

str

manager: gitlab.base.RESTManager
class gitlab.v4.objects.ProjectSnippetAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectSnippetDiscussion(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectSnippetDiscussionNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • body

Optional attributes:

  • created_at

Object update

Mandatory attributes for object update:

  • body

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

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

Object Creation

Mandatory attributes:

  • title

  • file_name

  • content

  • visibility

Optional attributes:

  • description

Object update

Optional attributes for object update:

  • title

  • file_name

  • content

  • visibility

  • description

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectSnippetNote(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.ProjectSnippetNoteAwardEmoji(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • name

Object update

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

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

Object Creation

Mandatory attributes:

  • body

Object update

Mandatory attributes for object update:

  • body

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectTag(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
set_release_description(description, **kwargs)

Set the release notes on the tag.

If the release doesn’t exist yet, it will be created. If it already exists, its description will be updated.

Parameters
  • description (str) – Description of the release.

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

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

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

Object Creation

Mandatory attributes:

  • tag_name

  • ref

Optional attributes:

  • message

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectTrigger(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
take_ownership(**kwargs)

Update the owner of a trigger.

Parameters

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

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

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

Object Creation

Mandatory attributes:

  • description

Object update

Mandatory attributes for object update:

  • description

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectUser(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

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

Object listing filters

  • search

  • skip_users

Object Creation

Object update

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectVariable(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object Creation

Mandatory attributes:

  • key

  • value

Optional attributes:

  • protected

  • variable_type

  • masked

  • environment_scope

Object update

Mandatory attributes for object update:

  • key

  • value

Optional attributes for object update:

  • protected

  • variable_type

  • masked

  • environment_scope

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.ProjectWiki(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

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

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

Object listing filters

  • with_content

Object Creation

Mandatory attributes:

  • title

  • content

Optional attributes:

  • format

Object update

Optional attributes for object update:

  • title

  • content

  • format

gitlab: gitlab.client.Gitlab
class gitlab.v4.objects.Runner(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

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

manager: gitlab.base.RESTManager
class gitlab.v4.objects.RunnerJob(manager: gitlab.base.RESTManager, attrs: Dict[str, Any])

Bases: gitlab.base.RESTObject

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

Bases: