gitlab.v4 package¶
Submodules¶
gitlab.v4.objects module¶
-
class
gitlab.v4.objects.Application(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ApplicationAppearance(manager, attrs)¶
-
class
gitlab.v4.objects.ApplicationAppearanceManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject update
Optional attributes for object update:
titledescriptionlogoheader_logofaviconnew_project_guidelinesheader_messagefooter_messagemessage_background_colormessage_font_coloremail_header_and_footer_enabled
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server cannot perform the request
-
class
gitlab.v4.objects.ApplicationManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
nameredirect_uriscopes
Optional attributes:
confidential
-
class
gitlab.v4.objects.ApplicationSettings(manager, attrs)¶
-
class
gitlab.v4.objects.ApplicationSettingsManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject update
Optional attributes for object update:
iddefault_projects_limitsignup_enabledpassword_authentication_enabled_for_webgravatar_enabledsign_in_textcreated_atupdated_athome_page_urldefault_branch_protectionrestricted_visibility_levelsmax_attachment_sizesession_expire_delaydefault_project_visibilitydefault_snippet_visibilitydefault_group_visibilityoutbound_local_requests_whitelistdomain_whitelistdomain_blacklist_enableddomain_blacklistexternal_authorization_service_enabledexternal_authorization_service_urlexternal_authorization_service_default_labelexternal_authorization_service_timeoutuser_oauth_applicationsafter_sign_out_pathcontainer_registry_token_expire_delayrepository_storagesplantuml_enabledplantuml_urlterminal_max_session_timepolling_interval_multiplierrsa_key_restrictiondsa_key_restrictionecdsa_key_restrictioned25519_key_restrictionfirst_day_of_weekenforce_termstermsperformance_bar_allowed_group_idinstance_statistics_visibility_privateuser_show_add_ssh_key_messagefile_template_project_idlocal_markdown_versionasset_proxy_enabledasset_proxy_urlasset_proxy_whitelistgeo_node_allowed_ipsallow_local_requests_from_hooks_and_servicesallow_local_requests_from_web_hooks_and_servicesallow_local_requests_from_system_hooks
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server cannot perform the request
-
class
gitlab.v4.objects.AuditEvent(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.AuditEventManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
created_aftercreated_beforeentity_typeentity_id
-
class
gitlab.v4.objects.BroadcastMessage(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.BroadcastMessageManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
message
Optional attributes:
starts_atends_atcolorfont
Object update
Optional attributes for object update:
messagestarts_atends_atcolorfont
-
class
gitlab.v4.objects.CurrentUser(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.CurrentUserEmail(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.CurrentUserEmailManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
email
-
class
gitlab.v4.objects.CurrentUserGPGKey(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.CurrentUserGPGKeyManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
key
-
class
gitlab.v4.objects.CurrentUserKey(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.CurrentUserKeyManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
titlekey
-
class
gitlab.v4.objects.CurrentUserManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.CurrentUserStatus(manager, attrs)¶
-
class
gitlab.v4.objects.CurrentUserStatusManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject update
Optional attributes for object update:
emojimessage
-
class
gitlab.v4.objects.DeployKey(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.DeployKeyManager(gl, parent=None)¶
-
class
gitlab.v4.objects.DeployToken(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.DeployTokenManager(gl, parent=None)¶
-
class
gitlab.v4.objects.Dockerfile(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.DockerfileManager(gl, parent=None)¶
-
class
gitlab.v4.objects.Event(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.EventManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
actiontarget_typebeforeaftersort
-
class
gitlab.v4.objects.Feature(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.FeatureManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManager-
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
GitlabAuthenticationError – If authentication is not correct
GitlabSetError – If an error occured
- Returns
The created/updated attribute
- Return type
obj
-
-
class
gitlab.v4.objects.GeoNode(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
repair(**kwargs)¶ Repair the OAuth authentication of the geo node.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabRepairError – If the server failed to perform the request
-
status(**kwargs)¶ Get the status of the geo node.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
- Returns
The status of the geo node
- Return type
dict
-
-
class
gitlab.v4.objects.GeoNodeManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject update
Optional attributes for object update:
enabledurlfiles_max_capacityrepos_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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
- Returns
The list of failures
- Return type
list
-
status(**kwargs)¶ Get the status of all the geo nodes.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
- Returns
The status of all the geo nodes
- Return type
list
-
class
gitlab.v4.objects.Gitignore(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GitignoreManager(gl, parent=None)¶
-
class
gitlab.v4.objects.Gitlabciyml(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GitlabciymlManager(gl, parent=None)¶
-
class
gitlab.v4.objects.Group(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
add_ldap_group_link(cn, group_access, provider, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
-
delete_ldap_group_link(cn, provider=None, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
-
ldap_sync(**kwargs)¶ Sync LDAP groups.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabSearchError – If the server failed to perform the request
- Returns
A list of dicts describing the resources found.
- Return type
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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server failed to perform the request
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabTransferProjectError – If the project could not be transfered
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
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server failed to perform the request
-
-
class
gitlab.v4.objects.GroupAccessRequest(manager, attrs)¶ Bases:
gitlab.mixins.AccessRequestMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupAccessRequestManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.GroupBadge(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupBadgeManager(gl, parent=None)¶ Bases:
gitlab.mixins.BadgeRenderMixin,gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
link_urlimage_url
Object update
Optional attributes for object update:
link_urlimage_url
-
class
gitlab.v4.objects.GroupBoard(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupBoardList(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupBoardListManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
label_id
Object update
Mandatory attributes for object update:
position
-
class
gitlab.v4.objects.GroupBoardManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
-
class
gitlab.v4.objects.GroupCluster(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupClusterManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
nameplatform_kubernetes_attributes
Optional attributes:
domainenabledmanagedenvironment_scope
Object update
Optional attributes for object update:
namedomainmanagement_project_idplatform_kubernetes_attributesenvironment_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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
- Returns
- A new instance of the manage object class build with
the data sent by the server
- Return type
-
class
gitlab.v4.objects.GroupCustomAttribute(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupCustomAttributeManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.SetMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.GroupDeployToken(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupDeployTokenManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
namescopes
Optional attributes:
expires_atusername
-
class
gitlab.v4.objects.GroupEpic(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.mixins.SaveMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupEpicIssue(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.mixins.SaveMixin,gitlab.base.RESTObject-
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
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server cannot perform the request
-
-
class
gitlab.v4.objects.GroupEpicIssueManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
issue_id
Object update
Optional attributes for object update:
move_before_idmove_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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
- Returns
- A new instance of the manage object class build with
the data sent by the server
- Return type
-
class
gitlab.v4.objects.GroupEpicManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
author_idlabelsorder_bysortsearch
Object Creation
Mandatory attributes:
title
Optional attributes:
labelsdescriptionstart_dateend_date
Object update
Optional attributes for object update:
titlelabelsdescriptionstart_dateend_date
-
class
gitlab.v4.objects.GroupEpicResourceLabelEvent(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupEpicResourceLabelEventManager(gl, parent=None)¶
-
class
gitlab.v4.objects.GroupExport(manager, attrs)¶
-
class
gitlab.v4.objects.GroupExportManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.GroupImport(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupImportManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.GroupIssue(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupIssueManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
statelabelsmilestoneorder_bysortiidsauthor_idassignee_idmy_reaction_emojisearchcreated_aftercreated_beforeupdated_afterupdated_before
-
class
gitlab.v4.objects.GroupLabel(manager, attrs)¶ Bases:
gitlab.mixins.SubscribableMixin,gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
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
GitlabAuthenticationError – If authentication is not correct.
GitlabUpdateError – If the server cannot perform the request.
-
-
class
gitlab.v4.objects.GroupLabelManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
namecolor
Optional attributes:
descriptionpriority
Object update
Mandatory attributes for object update:
name
Optional attributes for object update:
new_namecolordescriptionpriority
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
-
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, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
skip_groupsall_availablesearchorder_bysortstatisticsownedwith_custom_attributesmin_access_level
Object Creation
Mandatory attributes:
namepath
Optional attributes:
descriptionmembership_lockvisibilityshare_with_group_lockrequire_two_factor_authenticationtwo_factor_grace_periodproject_creation_levelauto_devops_enabledsubgroup_creation_levelemails_disabledavatarmentions_disabledlfs_enabledrequest_access_enabledparent_iddefault_branch_protection
Object update
Optional attributes for object update:
namepathdescriptionmembership_lockshare_with_group_lockvisibilityrequire_two_factor_authenticationtwo_factor_grace_periodproject_creation_levelauto_devops_enabledsubgroup_creation_levelemails_disabledavatarmentions_disabledlfs_enabledrequest_access_enableddefault_branch_protection
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabImportError – If the server failed to perform the request
- Returns
A representation of the import status.
- Return type
dict
-
class
gitlab.v4.objects.GroupMember(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupMemberManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
access_leveluser_id
Optional attributes:
expires_at
Object update
Mandatory attributes for object update:
access_level
Optional attributes for object update:
expires_at
-
all(**kwargs)¶ List all the members, included inherited ones.
- 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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
The list of members
- Return type
-
class
gitlab.v4.objects.GroupMergeRequest(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupMergeRequestManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
stateorder_bysortmilestoneviewlabelscreated_aftercreated_beforeupdated_afterupdated_beforescopeauthor_idassignee_idmy_reaction_emojisource_branchtarget_branchsearch
-
class
gitlab.v4.objects.GroupMilestone(manager, attrs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
The list of issues
- Return type
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
The list of merge requests
- Return type
-
-
class
gitlab.v4.objects.GroupMilestoneManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
iidsstatesearch
Object Creation
Mandatory attributes:
title
Optional attributes:
descriptiondue_datestart_date
Object update
Optional attributes for object update:
titledescriptiondue_datestart_datestate_event
-
class
gitlab.v4.objects.GroupNotificationSettings(manager, attrs)¶
-
class
gitlab.v4.objects.GroupNotificationSettingsManager(gl, parent=None)¶ Bases:
gitlab.v4.objects.NotificationSettingsManagerObject update
Optional attributes for object update:
levelnotification_emailnew_notenew_issuereopen_issueclose_issuereassign_issuenew_merge_requestreopen_merge_requestclose_merge_requestreassign_merge_requestmerge_merge_request
-
class
gitlab.v4.objects.GroupPackage(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupPackageManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
exclude_subgroupsorder_bysortpackage_typepackage_name
-
class
gitlab.v4.objects.GroupProject(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupProjectManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
archivedvisibilityorder_bysortsearchsimpleownedstarredwith_custom_attributesinclude_subgroupswith_issues_enabledwith_merge_requests_enabledwith_sharedmin_access_levelwith_security_reports
-
class
gitlab.v4.objects.GroupRunner(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupRunnerManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
runner_id
-
class
gitlab.v4.objects.GroupSubgroup(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.GroupSubgroupManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
skip_groupsall_availablesearchorder_bysortstatisticsownedwith_custom_attributes
-
class
gitlab.v4.objects.Hook(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.HookManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
url
-
class
gitlab.v4.objects.Issue(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.IssueManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
statelabelsmilestonescopeauthor_idassignee_idmy_reaction_emojiiidsorder_bysortsearchcreated_aftercreated_beforeupdated_afterupdated_before
-
class
gitlab.v4.objects.LDAPGroup(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.LDAPGroupManager(gl, parent=None)¶ Bases:
gitlab.base.RESTManagerObject listing filters
searchprovider
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server cannot perform the request
-
class
gitlab.v4.objects.License(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.LicenseManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.base.RESTManagerObject listing filters
popular
-
class
gitlab.v4.objects.MergeRequest(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.MergeRequestManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
stateorder_bysortmilestoneviewlabelscreated_aftercreated_beforeupdated_afterupdated_beforescopeauthor_idassignee_idmy_reaction_emojisource_branchtarget_branchsearch
-
class
gitlab.v4.objects.Namespace(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.NamespaceManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.base.RESTManagerObject listing filters
search
-
class
gitlab.v4.objects.NotificationSettings(manager, attrs)¶
-
class
gitlab.v4.objects.NotificationSettingsManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject update
Optional attributes for object update:
levelnotification_emailnew_notenew_issuereopen_issueclose_issuereassign_issuenew_merge_requestreopen_merge_requestclose_merge_requestreassign_merge_requestmerge_merge_request
-
class
gitlab.v4.objects.PagesDomain(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.PagesDomainManager(gl, parent=None)¶
-
class
gitlab.v4.objects.Project(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
archive(**kwargs)¶ Archive a project.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server failed to perform the request
-
artifact(ref_name, artifact_path, job, streamed=False, action=None, chunk_size=1024, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the artifacts could not be retrieved
- Returns
The artifacts if streamed is False, None otherwise.
- Return type
str
-
artifacts(ref_name, job, streamed=False, action=None, chunk_size=1024, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the artifacts could not be retrieved
- Returns
The artifacts if streamed is False, None otherwise.
- Return type
str
-
create_fork_relation(forked_from_id, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the relation could not be created
-
delete_fork_relation(**kwargs)¶ Delete a forked relation between existing projects.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server failed to perform the request
-
delete_merged_branches(**kwargs)¶ Delete merged branches.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server failed to perform the request
-
housekeeping(**kwargs)¶ Start the housekeeping task.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabHousekeepingError – If the server failed to perform the request
-
languages(**kwargs)¶ Get languages used in the project with percentage value.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
-
mirror_pull(**kwargs)¶ Start the pull mirroring process for the project.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server failed to perform the request
-
repository_archive(sha=None, streamed=False, action=None, chunk_size=1024, **kwargs)¶ Return a tarball of the repository.
- Parameters
sha (str) – ID of the commit (default branch by default)
streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment
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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server failed to perform the request
- Returns
The binary data of the archive
- Return type
str
-
repository_blob(sha, **kwargs)¶ Return a file by blob SHA.
- Parameters
sha (str) – ID of the blob
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
- Returns
The blob content and metadata
- Return type
dict
-
repository_compare(from_, to, **kwargs)¶ Return a diff between two branches/commits.
- Parameters
from (str) – Source branch/SHA
to (str) – Destination branch/SHA
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
- Returns
The diff
- Return type
str
-
repository_contributors(**kwargs)¶ Return a list of contributors for the project.
- 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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
- Returns
The contributors
- Return type
list
-
repository_raw_blob(sha, streamed=False, action=None, chunk_size=1024, **kwargs)¶ Return the raw file contents for a blob.
- Parameters
sha (str) – ID of the blob
streamed (bool) – If True the data will be processed by chunks of chunk_size and each chunk is passed to action for treatment
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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
- Returns
The blob content if streamed is False, None otherwise
- Return type
str
-
repository_tree(path='', ref='', recursive=False, **kwargs)¶ Return a list of files in the repository.
- Parameters
path (str) – Path of the top folder (/ by default)
ref (str) – Reference to a commit or branch
recursive (bool) – Whether to get the tree recursively
all (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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server failed to perform the request
- Returns
The representation of the tree
- Return type
list
-
search(scope, search, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabSearchError – If the server failed to perform the request
- Returns
A list of dicts describing the resources found.
- Return type
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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server failed to perform the request
-
snapshot(wiki=False, streamed=False, action=None, chunk_size=1024, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the content could not be retrieved
- Returns
The uncompressed tar archive of the repository
- Return type
str
-
star(**kwargs)¶ Star a project.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server failed to perform the request
-
transfer_project(to_namespace, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabTransferProjectError – If the project could not be transfered
-
trigger_pipeline(ref, token, variables=None, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server failed to perform the request
-
unarchive(**kwargs)¶ Unarchive a project.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server failed to perform the request
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
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server failed to perform the request
-
unstar(**kwargs)¶ Unstar a project.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server failed to perform the request
-
update_submodule(submodule, branch, commit_sha, **kwargs)¶ Update a project submodule
- Parameters
submodule (str) – Full path to the submodule
branch (str) – Name of the branch to commit into
commit_sha (str) – Full commit SHA to update the submodule to
commit_message (str) – Commit message. If no message is provided, a default one will be set (optional)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabPutError – If the submodule could not be updated
-
upload(filename, filedata=None, filepath=None, **kwargs)¶ Upload the specified file into the project.
Note
Either
filedataorfilepathMUST 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
GitlabConnectionError – If the server cannot be reached
GitlabUploadError – If the file upload fails
GitlabUploadError – If
filedataandfilepathare not specifiedGitlabUploadError – If both
filedataandfilepathare specified
- Returns
- A
dictwith the keys: alt- The alternate text for the uploadurl- The direct url to the uploaded filemarkdown- Markdown for the uploaded file
- A
- Return type
dict
-
-
class
gitlab.v4.objects.ProjectAccessRequest(manager, attrs)¶ Bases:
gitlab.mixins.AccessRequestMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectAccessRequestManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.ProjectAdditionalStatistics(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectAdditionalStatisticsManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.ProjectApproval(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectApprovalManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject update
Optional attributes for object update:
approvals_before_mergereset_approvals_on_pushdisable_overriding_approvers_per_merge_requestmerge_requests_author_approvalmerge_requests_disable_committers_approval
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server failed to perform the request
-
class
gitlab.v4.objects.ProjectApprovalRule(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectApprovalRuleManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
nameapprovals_required
Optional attributes:
user_idsgroup_ids
-
class
gitlab.v4.objects.ProjectBadge(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectBadgeManager(gl, parent=None)¶ Bases:
gitlab.mixins.BadgeRenderMixin,gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
link_urlimage_url
Object update
Optional attributes for object update:
link_urlimage_url
-
class
gitlab.v4.objects.ProjectBoard(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectBoardList(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectBoardListManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
label_id
Object update
Mandatory attributes for object update:
position
-
class
gitlab.v4.objects.ProjectBoardManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
-
class
gitlab.v4.objects.ProjectBranch(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
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
GitlabAuthenticationError – If authentication is not correct
GitlabProtectError – If the branch could not be protected
-
unprotect(**kwargs)¶ Unprotect the branch.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabProtectError – If the branch could not be unprotected
-
-
class
gitlab.v4.objects.ProjectBranchManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
branchref
-
class
gitlab.v4.objects.ProjectCluster(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectClusterManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
nameplatform_kubernetes_attributes
Optional attributes:
domainenabledmanagedenvironment_scope
Object update
Optional attributes for object update:
namedomainmanagement_project_idplatform_kubernetes_attributesenvironment_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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
- Returns
- A new instance of the manage object class build with
the data sent by the server
- Return type
-
class
gitlab.v4.objects.ProjectCommit(manager, attrs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabCherryPickError – If the cherry-pick could not be performed
-
diff(**kwargs)¶ Generate the commit diff.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the diff could not be retrieved
- Returns
The changes done in this commit
- Return type
list
-
merge_requests(**kwargs)¶ List the merge requests related to the commit.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the references could not be retrieved
- Returns
The merge requests related to the commit.
- Return type
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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the references could not be retrieved
- 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
GitlabAuthenticationError – If authentication is not correct
GitlabRevertError – If the revert could not be performed
- 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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the signature could not be retrieved
- Returns
The commit’s signature data
- Return type
dict
-
-
class
gitlab.v4.objects.ProjectCommitComment(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectCommitCommentManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
note
Optional attributes:
pathlineline_type
-
class
gitlab.v4.objects.ProjectCommitDiscussion(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectCommitDiscussionManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_at
-
class
gitlab.v4.objects.ProjectCommitDiscussionNote(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectCommitDiscussionNoteManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_atposition
Object update
Mandatory attributes for object update:
body
-
class
gitlab.v4.objects.ProjectCommitManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
branchcommit_messageactions
Optional attributes:
author_emailauthor_name
-
class
gitlab.v4.objects.ProjectCommitStatus(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectCommitStatusManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
state
Optional attributes:
descriptionnamecontextreftarget_urlcoverage
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
- Returns
- A new instance of the manage object class build with
the data sent by the server
- Return type
-
class
gitlab.v4.objects.ProjectCustomAttribute(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectCustomAttributeManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.SetMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.ProjectDeployToken(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectDeployTokenManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
namescopes
Optional attributes:
expires_atusername
-
class
gitlab.v4.objects.ProjectDeployment(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectDeploymentManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject listing filters
order_bysort
Object Creation
Mandatory attributes:
shareftagstatusenvironment
-
class
gitlab.v4.objects.ProjectEnvironment(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
stop(**kwargs)¶ Stop the environment.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabStopError – If the operation failed
-
-
class
gitlab.v4.objects.ProjectEnvironmentManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
Optional attributes:
external_url
Object update
Optional attributes for object update:
nameexternal_url
-
class
gitlab.v4.objects.ProjectEvent(manager, attrs)¶ Bases:
gitlab.v4.objects.Event
-
class
gitlab.v4.objects.ProjectEventManager(gl, parent=None)¶ Bases:
gitlab.v4.objects.EventManagerObject listing filters
actiontarget_typebeforeaftersort
-
class
gitlab.v4.objects.ProjectExport(manager, attrs)¶ Bases:
gitlab.mixins.DownloadMixin,gitlab.mixins.RefreshMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectExportManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManagerObject Creation
Optional attributes:
description
-
class
gitlab.v4.objects.ProjectFile(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
decode()¶ Returns the decoded content of the file.
- Returns
the decoded content.
- Return type
(str)
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server cannot perform the request
-
-
class
gitlab.v4.objects.ProjectFileManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
file_pathbranchcontentcommit_message
Optional attributes:
encodingauthor_emailauthor_name
Object update
Mandatory attributes for object update:
file_pathbranchcontentcommit_message
Optional attributes for object update:
encodingauthor_emailauthor_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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server failed to perform the request
- Returns
a list of commits/lines matching the file
- Return type
list(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
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the file could not be retrieved
- Returns
The generated RESTObject
- Return type
object
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the file could not be retrieved
- 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
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server cannot perform the request
-
class
gitlab.v4.objects.ProjectFork(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectForkManager(gl, parent=None)¶ Bases:
gitlab.mixins.CreateMixin,gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
archivedvisibilityorder_bysortsearchsimpleownedmembershipstarredstatisticswith_custom_attributeswith_issues_enabledwith_merge_requests_enabled
Object Creation
Optional attributes:
namespace
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
- Returns
- A new instance of the managed object class build with
the data sent by the server
- Return type
-
class
gitlab.v4.objects.ProjectHook(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectHookManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
url
Optional attributes:
push_eventsissues_eventsconfidential_issues_eventsmerge_requests_eventstag_push_eventsnote_eventsjob_eventspipeline_eventswiki_page_eventsenable_ssl_verificationtoken
Object update
Mandatory attributes for object update:
url
Optional attributes for object update:
push_eventsissues_eventsconfidential_issues_eventsmerge_requests_eventstag_push_eventsnote_eventsjob_eventspipeline_eventswiki_eventsenable_ssl_verificationtoken
-
class
gitlab.v4.objects.ProjectImport(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectImportManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.ProjectIssue(manager, attrs)¶ 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
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the issue could not be moved
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, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectIssueAwardEmojiManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
-
class
gitlab.v4.objects.ProjectIssueDiscussion(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectIssueDiscussionManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_at
-
class
gitlab.v4.objects.ProjectIssueDiscussionNote(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectIssueDiscussionNoteManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_at
Object update
Mandatory attributes for object update:
body
-
class
gitlab.v4.objects.ProjectIssueLink(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectIssueLinkManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
target_project_idtarget_issue_iid
-
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
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
-
class
gitlab.v4.objects.ProjectIssueManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
iidsstatelabelsmilestonescopeauthor_idassignee_idmy_reaction_emojiorder_bysortsearchcreated_aftercreated_beforeupdated_afterupdated_before
Object Creation
Mandatory attributes:
title
Optional attributes:
descriptionconfidentialassignee_idsassignee_idmilestone_idlabelscreated_atdue_datemerge_request_to_resolve_discussions_ofdiscussion_to_resolve
Object update
Optional attributes for object update:
titledescriptionconfidentialassignee_idsassignee_idmilestone_idlabelsstate_eventupdated_atdue_datediscussion_locked
-
class
gitlab.v4.objects.ProjectIssueNote(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectIssueNoteAwardEmoji(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectIssueNoteAwardEmojiManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
-
class
gitlab.v4.objects.ProjectIssueNoteManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_at
Object update
Mandatory attributes for object update:
body
-
class
gitlab.v4.objects.ProjectIssueResourceLabelEvent(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectIssueResourceLabelEventManager(gl, parent=None)¶
-
class
gitlab.v4.objects.ProjectIssueResourceMilestoneEvent(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectIssueResourceMilestoneEventManager(gl, parent=None)¶
-
class
gitlab.v4.objects.ProjectIssuesStatistics(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectIssuesStatisticsManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.ProjectJob(manager, attrs)¶ Bases:
gitlab.base.RESTObject,gitlab.mixins.RefreshMixin-
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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the artifacts could not be retrieved
- Returns
The artifacts if streamed is False, None otherwise.
- Return type
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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the artifacts could not be retrieved
- Returns
The artifacts if streamed is False, None otherwise.
- Return type
str
-
cancel(**kwargs)¶ Cancel the job.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabJobCancelError – If the job could not be canceled
-
delete_artifacts(**kwargs)¶ Delete artifacts of a job.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the request could not be performed
-
erase(**kwargs)¶ Erase the job (remove job artifacts and trace).
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabJobEraseError – If the job could not be erased
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the request could not be performed
-
play(**kwargs)¶ Trigger a job explicitly.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabJobPlayError – If the job could not be triggered
-
retry(**kwargs)¶ Retry the job.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabJobRetryError – If the job could not be retried
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the artifacts could not be retrieved
- Returns
The trace
- Return type
str
-
-
class
gitlab.v4.objects.ProjectJobManager(gl, parent=None)¶
-
class
gitlab.v4.objects.ProjectKey(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectKeyManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
titlekey
Optional attributes:
can_push
Object update
Optional attributes for object update:
titlecan_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
GitlabAuthenticationError – If authentication is not correct
GitlabProjectDeployKeyError – If the key could not be enabled
-
class
gitlab.v4.objects.ProjectLabel(manager, attrs)¶ Bases:
gitlab.mixins.SubscribableMixin,gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
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
GitlabAuthenticationError – If authentication is not correct.
GitlabUpdateError – If the server cannot perform the request.
-
-
class
gitlab.v4.objects.ProjectLabelManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
namecolor
Optional attributes:
descriptionpriority
Object update
Mandatory attributes for object update:
name
Optional attributes for object update:
new_namecolordescriptionpriority
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
-
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, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
searchownedstarredarchivedvisibilityorder_bysortsimplemembershipstatisticswith_issues_enabledwith_merge_requests_enabledwith_custom_attributes
Object Creation
Optional attributes:
namepathnamespace_iddefault_branchdescriptionissues_enabledmerge_requests_enabledjobs_enabledwiki_enabledsnippets_enabledissues_access_levelrepository_access_levelmerge_requests_access_levelforking_access_levelbuilds_access_levelwiki_access_levelsnippets_access_levelpages_access_levelemails_disabledresolve_outdated_diff_discussionscontainer_registry_enabledcontainer_expiration_policy_attributesshared_runners_enabledvisibilityimport_urlpublic_buildsonly_allow_merge_if_pipeline_succeedsonly_allow_merge_if_all_discussions_are_resolvedmerge_methodautoclose_referenced_issuesremove_source_branch_after_mergelfs_enabledrequest_access_enabledtag_listavatarprinting_merge_request_link_enabledbuild_git_strategybuild_timeoutauto_cancel_pending_pipelinesbuild_coverage_regexci_config_pathauto_devops_enabledauto_devops_deploy_strategyrepository_storageapprovals_before_mergeexternal_authorization_classification_labelmirrormirror_trigger_buildsinitialize_with_readmetemplate_nametemplate_project_iduse_custom_templategroup_with_project_templates_idpackages_enabled
Object update
Optional attributes for object update:
namepathdefault_branchdescriptionissues_enabledmerge_requests_enabledjobs_enabledwiki_enabledsnippets_enabledissues_access_levelrepository_access_levelmerge_requests_access_levelforking_access_levelbuilds_access_levelwiki_access_levelsnippets_access_levelpages_access_levelemails_disabledresolve_outdated_diff_discussionscontainer_registry_enabledcontainer_expiration_policy_attributesshared_runners_enabledvisibilityimport_urlpublic_buildsonly_allow_merge_if_pipeline_succeedsonly_allow_merge_if_all_discussions_are_resolvedmerge_methodautoclose_referenced_issuessuggestion_commit_messageremove_source_branch_after_mergelfs_enabledrequest_access_enabledtag_listavatarbuild_git_strategybuild_timeoutauto_cancel_pending_pipelinesbuild_coverage_regexci_config_pathci_default_git_depthauto_devops_enabledauto_devops_deploy_strategyrepository_storageapprovals_before_mergeexternal_authorization_classification_labelmirrormirror_user_idmirror_trigger_buildsonly_mirror_protected_branchesmirror_overwrites_diverged_branchespackages_enabledservice_desk_enabled
-
import_github(personal_access_token, repo_id, target_namespace, new_name=None, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server failed to perform the request
- Returns
A representation of the import status.
- Return type
dict
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, path, name=None, namespace=None, overwrite=False, override_params=None, **kwargs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server failed to perform the request
- Returns
A representation of the import status.
- Return type
dict
-
class
gitlab.v4.objects.ProjectMember(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectMemberManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
access_leveluser_id
Optional attributes:
expires_at
Object update
Mandatory attributes for object update:
access_level
Optional attributes for object update:
expires_at
-
all(**kwargs)¶ List all the members, included inherited ones.
- 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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
The list of members
- Return type
-
class
gitlab.v4.objects.ProjectMergeRequest(manager, attrs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabMRApprovalError – If the approval failed
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabMROnBuildSuccessError – If the server could not handle the request
-
changes(**kwargs)¶ List the merge request changes.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
List of changes
- Return type
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
List of issues
- Return type
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
The list of commits
- Return type
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabMRClosedError – If the merge failed
-
pipelines(**kwargs)¶ List the merge request pipelines.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
List of changes
- Return type
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabMRRebaseError – If rebasing failed
-
unapprove(**kwargs)¶ Unapprove the merge request.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabMRApprovalError – If the unapproval failed
-
-
class
gitlab.v4.objects.ProjectMergeRequestApproval(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectMergeRequestApprovalManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject update
Mandatory attributes for object update:
approvals_required
-
set_approvers(approvals_required, approver_ids=None, approver_group_ids=None, **kwargs)¶ Change MR-level allowed approvers and approver groups.
- Parameters
approvals_required (integer) – The number of required approvals for this rule
approver_ids (list) – User IDs that can approve MRs
approver_group_ids (list) – Group IDs whose members can approve MRs
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server failed to perform the request
-
class
gitlab.v4.objects.ProjectMergeRequestAwardEmoji(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectMergeRequestAwardEmojiManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
-
class
gitlab.v4.objects.ProjectMergeRequestDiff(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectMergeRequestDiffManager(gl, parent=None)¶
-
class
gitlab.v4.objects.ProjectMergeRequestDiscussion(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectMergeRequestDiscussionManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_atposition
Object update
Mandatory attributes for object update:
resolved
-
class
gitlab.v4.objects.ProjectMergeRequestDiscussionNote(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectMergeRequestDiscussionNoteManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_at
Object update
Mandatory attributes for object update:
body
-
class
gitlab.v4.objects.ProjectMergeRequestManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
stateorder_bysortmilestoneviewlabelscreated_aftercreated_beforeupdated_afterupdated_beforescopeauthor_idassignee_idmy_reaction_emojisource_branchtarget_branchsearch
Object Creation
Mandatory attributes:
source_branchtarget_branchtitle
Optional attributes:
assignee_iddescriptiontarget_project_idlabelsmilestone_idremove_source_branchallow_maintainer_to_pushsquash
Object update
Optional attributes for object update:
target_branchassignee_idtitledescriptionstate_eventlabelsmilestone_idremove_source_branchdiscussion_lockedallow_maintainer_to_pushsquash
-
class
gitlab.v4.objects.ProjectMergeRequestNote(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectMergeRequestNoteAwardEmoji(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectMergeRequestNoteAwardEmojiManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
-
class
gitlab.v4.objects.ProjectMergeRequestNoteManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Object update
Mandatory attributes for object update:
body
-
class
gitlab.v4.objects.ProjectMergeRequestResourceLabelEvent(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectMergeRequestResourceLabelEventManager(gl, parent=None)¶
-
class
gitlab.v4.objects.ProjectMergeRequestResourceMilestoneEvent(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectMergeRequestResourceMilestoneEventManager(gl, parent=None)¶
-
class
gitlab.v4.objects.ProjectMilestone(manager, attrs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
The list of issues
- Return type
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the list could not be retrieved
- Returns
The list of merge requests
- Return type
-
-
class
gitlab.v4.objects.ProjectMilestoneManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
iidsstatesearch
Object Creation
Mandatory attributes:
title
Optional attributes:
descriptiondue_datestart_datestate_event
Object update
Optional attributes for object update:
titledescriptiondue_datestart_datestate_event
-
class
gitlab.v4.objects.ProjectNote(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectNoteManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
-
class
gitlab.v4.objects.ProjectNotificationSettings(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectNotificationSettingsManager(gl, parent=None)¶ Bases:
gitlab.v4.objects.NotificationSettingsManagerObject update
Optional attributes for object update:
levelnotification_emailnew_notenew_issuereopen_issueclose_issuereassign_issuenew_merge_requestreopen_merge_requestclose_merge_requestreassign_merge_requestmerge_merge_request
-
class
gitlab.v4.objects.ProjectPackage(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectPackageManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.GetMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject listing filters
order_bysortpackage_typepackage_name
-
class
gitlab.v4.objects.ProjectPagesDomain(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectPagesDomainManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
domain
Optional attributes:
certificatekey
Object update
Optional attributes for object update:
certificatekey
-
class
gitlab.v4.objects.ProjectPipeline(manager, attrs)¶ Bases:
gitlab.base.RESTObject,gitlab.mixins.RefreshMixin,gitlab.mixins.ObjectDeleteMixin-
cancel(**kwargs)¶ Cancel the job.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabPipelineCancelError – If the request failed
-
retry(**kwargs)¶ Retry the job.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabPipelineRetryError – If the request failed
-
-
class
gitlab.v4.objects.ProjectPipelineJob(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectPipelineJobManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
scope
-
class
gitlab.v4.objects.ProjectPipelineManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject listing filters
scopestatusrefshayaml_errorsnameusernameorder_bysort
Object Creation
Mandatory attributes:
ref
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server cannot perform the request
- Returns
- A new instance of the managed object class build with
the data sent by the server
- Return type
-
class
gitlab.v4.objects.ProjectPipelineSchedule(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
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
GitlabAuthenticationError – If authentication is not correct
GitlabPipelinePlayError – If the request failed
-
take_ownership(**kwargs)¶ Update the owner of a pipeline schedule.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabOwnershipError – If the request failed
-
-
class
gitlab.v4.objects.ProjectPipelineScheduleManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
descriptionrefcron
Optional attributes:
cron_timezoneactive
Object update
Optional attributes for object update:
descriptionrefcroncron_timezoneactive
-
class
gitlab.v4.objects.ProjectPipelineScheduleVariable(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectPipelineScheduleVariableManager(gl, parent=None)¶ Bases:
gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
keyvalue
Object update
Mandatory attributes for object update:
keyvalue
-
class
gitlab.v4.objects.ProjectPipelineVariable(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectPipelineVariableManager(gl, parent=None)¶
-
class
gitlab.v4.objects.ProjectProtectedBranch(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectProtectedBranchManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
Optional attributes:
push_access_levelmerge_access_levelunprotect_access_levelallowed_to_pushallowed_to_mergeallowed_to_unprotect
-
class
gitlab.v4.objects.ProjectProtectedTag(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectProtectedTagManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
Optional attributes:
create_access_level
-
class
gitlab.v4.objects.ProjectPushRules(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectPushRulesManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Optional attributes:
deny_delete_tagmember_checkprevent_secretscommit_message_regexbranch_name_regexauthor_email_regexfile_name_regexmax_file_size
Object update
Optional attributes for object update:
deny_delete_tagmember_checkprevent_secretscommit_message_regexbranch_name_regexauthor_email_regexfile_name_regexmax_file_size
-
class
gitlab.v4.objects.ProjectRegistryRepository(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectRegistryRepositoryManager(gl, parent=None)¶ Bases:
gitlab.mixins.DeleteMixin,gitlab.mixins.ListMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.ProjectRegistryTag(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectRegistryTagManager(gl, parent=None)¶ Bases:
gitlab.mixins.DeleteMixin,gitlab.mixins.RetrieveMixin,gitlab.base.RESTManager-
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.
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
GitlabAuthenticationError – If authentication is not correct
GitlabDeleteError – If the server cannot perform the request
-
-
class
gitlab.v4.objects.ProjectRelease(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectReleaseManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
nametag_namedescription
Optional attributes:
refassets
-
class
gitlab.v4.objects.ProjectRemoteMirror(manager, attrs)¶
-
class
gitlab.v4.objects.ProjectRemoteMirrorManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
url
Optional attributes:
enabledonly_protected_branches
Object update
Optional attributes for object update:
enabledonly_protected_branches
-
class
gitlab.v4.objects.ProjectRunner(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectRunnerManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
runner_id
-
class
gitlab.v4.objects.ProjectService(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectServiceManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.mixins.ListMixin,gitlab.base.RESTManager-
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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the server cannot perform the request
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabUpdateError – If the server cannot perform the request
-
-
class
gitlab.v4.objects.ProjectSnippet(manager, attrs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the content could not be retrieved
- Returns
The snippet content
- Return type
str
-
-
class
gitlab.v4.objects.ProjectSnippetAwardEmoji(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectSnippetAwardEmojiManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
-
class
gitlab.v4.objects.ProjectSnippetDiscussion(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectSnippetDiscussionManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_at
-
class
gitlab.v4.objects.ProjectSnippetDiscussionNote(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectSnippetDiscussionNoteManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetMixin,gitlab.mixins.CreateMixin,gitlab.mixins.UpdateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Optional attributes:
created_at
Object update
Mandatory attributes for object update:
body
-
class
gitlab.v4.objects.ProjectSnippetManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
titlefile_namecontentvisibility
Optional attributes:
description
Object update
Optional attributes for object update:
titlefile_namecontentvisibilitydescription
-
class
gitlab.v4.objects.ProjectSnippetNote(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectSnippetNoteAwardEmoji(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectSnippetNoteAwardEmojiManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
name
-
class
gitlab.v4.objects.ProjectSnippetNoteManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
body
Object update
Mandatory attributes for object update:
body
-
class
gitlab.v4.objects.ProjectTag(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
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
GitlabAuthenticationError – If authentication is not correct
GitlabCreateError – If the server fails to create the release
GitlabUpdateError – If the server fails to update the release
-
-
class
gitlab.v4.objects.ProjectTagManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
tag_nameref
Optional attributes:
message
-
class
gitlab.v4.objects.ProjectTrigger(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
take_ownership(**kwargs)¶ Update the owner of a trigger.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabOwnershipError – If the request failed
-
-
class
gitlab.v4.objects.ProjectTriggerManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
description
Object update
Mandatory attributes for object update:
description
-
class
gitlab.v4.objects.ProjectUser(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectUserManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
search
-
class
gitlab.v4.objects.ProjectWiki(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.ProjectWikiManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
with_content
Object Creation
Mandatory attributes:
titlecontent
Optional attributes:
format
Object update
Optional attributes for object update:
titlecontentformat
-
class
gitlab.v4.objects.Runner(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.RunnerJob(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.RunnerJobManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.base.RESTManagerObject listing filters
status
-
class
gitlab.v4.objects.RunnerManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
scope
Object Creation
Mandatory attributes:
token
Optional attributes:
descriptioninfoactivelockedrun_untaggedtag_listmaximum_timeout
Object update
Optional attributes for object update:
descriptionactivetag_listrun_untaggedlockedaccess_levelmaximum_timeout
-
all(scope=None, **kwargs)¶ List all the runners.
- Parameters
scope (str) – The scope of runners to show, one of: specific, shared, active, paused, online
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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server failed to perform the request
- Returns
a list of runners matching the scope.
- Return type
list(Runner)
-
verify(token, **kwargs)¶ Validates authentication credentials for a registered Runner.
- Parameters
token (str) – The runner’s authentication token
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabVerifyError – If the server failed to verify the token
-
class
gitlab.v4.objects.SidekiqManager(gl, parent=None)¶ Bases:
gitlab.base.RESTManagerManager for the Sidekiq methods.
This manager doesn’t actually manage objects but provides helper fonction for the sidekiq metrics API.
-
compound_metrics(**kwargs)¶ Return all available metrics and statistics.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the information couldn’t be retrieved
- Returns
All available Sidekiq metrics and statistics
- Return type
dict
-
job_stats(**kwargs)¶ Return statistics about the jobs performed.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the information couldn’t be retrieved
- Returns
Statistics about the Sidekiq jobs performed
- Return type
dict
-
process_metrics(**kwargs)¶ Return the registred sidekiq workers.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the information couldn’t be retrieved
- Returns
Information about the register Sidekiq worker
- Return type
dict
-
queue_metrics(**kwargs)¶ Return the registred queues information.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the information couldn’t be retrieved
- Returns
Information about the Sidekiq queues
- Return type
dict
-
-
class
gitlab.v4.objects.Snippet(manager, attrs)¶ 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
GitlabAuthenticationError – If authentication is not correct
GitlabGetError – If the content could not be retrieved
- Returns
The snippet content
- Return type
str
-
-
class
gitlab.v4.objects.SnippetManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
titlefile_namecontent
Optional attributes:
lifetimevisibility
Object update
Optional attributes for object update:
titlefile_namecontentvisibility
-
public(**kwargs)¶ List all the public snippets.
- Parameters
all (bool) – If True the returned object will be a list
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabListError – If the list could not be retrieved
- Returns
A generator for the snippets list
- Return type
-
class
gitlab.v4.objects.Todo(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
mark_as_done(**kwargs)¶ Mark the todo as done.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabTodoError – If the server failed to perform the request
-
-
class
gitlab.v4.objects.TodoManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject listing filters
actionauthor_idproject_idstatetype
-
mark_all_as_done(**kwargs)¶ Mark all the todos as done.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabTodoError – If the server failed to perform the request
- Returns
The number of todos maked done
- Return type
int
-
class
gitlab.v4.objects.User(manager, attrs)¶ Bases:
gitlab.mixins.SaveMixin,gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject-
activate(**kwargs)¶ Activate the user.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabActivateError – If the user could not be activated
- Returns
Whether the user status has been changed
- Return type
bool
-
block(**kwargs)¶ Block the user.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabBlockError – If the user could not be blocked
- Returns
Whether the user status has been changed
- Return type
bool
-
deactivate(**kwargs)¶ Deactivate the user.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabDeactivateError – If the user could not be deactivated
- Returns
Whether the user status has been changed
- Return type
bool
-
unblock(**kwargs)¶ Unblock the user.
- Parameters
**kwargs – Extra options to send to the server (e.g. sudo)
- Raises
GitlabAuthenticationError – If authentication is not correct
GitlabUnblockError – If the user could not be unblocked
- Returns
Whether the user status has been changed
- Return type
bool
-
-
class
gitlab.v4.objects.UserActivities(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserActivitiesManager(gl, parent=None)¶
-
class
gitlab.v4.objects.UserCustomAttribute(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserCustomAttributeManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.SetMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManager
-
class
gitlab.v4.objects.UserEmail(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserEmailManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
email
-
class
gitlab.v4.objects.UserEvent(manager, attrs)¶ Bases:
gitlab.v4.objects.Event
-
class
gitlab.v4.objects.UserEventManager(gl, parent=None)¶ Bases:
gitlab.v4.objects.EventManagerObject listing filters
actiontarget_typebeforeaftersort
-
class
gitlab.v4.objects.UserGPGKey(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserGPGKeyManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
key
-
class
gitlab.v4.objects.UserImpersonationToken(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserImpersonationTokenManager(gl, parent=None)¶ Bases:
gitlab.mixins.NoUpdateMixin,gitlab.base.RESTManagerObject listing filters
state
Object Creation
Mandatory attributes:
namescopes
Optional attributes:
expires_at
-
class
gitlab.v4.objects.UserKey(manager, attrs)¶ Bases:
gitlab.mixins.ObjectDeleteMixin,gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserKeyManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.mixins.DeleteMixin,gitlab.base.RESTManagerObject Creation
Mandatory attributes:
titlekey
-
class
gitlab.v4.objects.UserManager(gl, parent=None)¶ Bases:
gitlab.mixins.CRUDMixin,gitlab.base.RESTManagerObject listing filters
activeblockedusernameextern_uidproviderexternalsearchcustom_attributesstatustwo_factor
Object Creation
Optional attributes:
emailusernamenamepasswordreset_passwordskypelinkedintwitterprojects_limitextern_uidproviderbioadmincan_create_groupwebsite_urlskip_confirmationexternalorganizationlocationavatarpublic_emailprivate_profilecolor_scheme_idtheme_id
Object update
Mandatory attributes for object update:
emailusernamename
Optional attributes for object update:
passwordskypelinkedintwitterprojects_limitextern_uidproviderbioadmincan_create_groupwebsite_urlskip_reconfirmationexternalorganizationlocationavatarpublic_emailprivate_profilecolor_scheme_idtheme_id
-
class
gitlab.v4.objects.UserMembership(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserMembershipManager(gl, parent=None)¶ Bases:
gitlab.mixins.RetrieveMixin,gitlab.base.RESTManagerObject listing filters
type
-
class
gitlab.v4.objects.UserProject(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserProjectManager(gl, parent=None)¶ Bases:
gitlab.mixins.ListMixin,gitlab.mixins.CreateMixin,gitlab.base.RESTManagerObject listing filters
archivedvisibilityorder_bysortsearchsimpleownedmembershipstarredstatisticswith_issues_enabledwith_merge_requests_enabledwith_custom_attributeswith_programming_languagewiki_checksum_failedrepository_checksum_failedmin_access_levelid_afterid_before
Object Creation
Mandatory attributes:
name
Optional attributes:
default_branchissues_enabledwall_enabledmerge_requests_enabledwiki_enabledsnippets_enabledpublicvisibilitydescriptionbuilds_enabledpublic_buildsimport_urlonly_allow_merge_if_build_succeeds
-
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
GitlabAuthenticationError – If authentication is not correct
GitlabListError – If the server cannot perform the request
-
class
gitlab.v4.objects.UserStatus(manager, attrs)¶ Bases:
gitlab.base.RESTObject
-
class
gitlab.v4.objects.UserStatusManager(gl, parent=None)¶ Bases:
gitlab.mixins.GetWithoutIdMixin,gitlab.base.RESTManager