Groups¶
Groups¶
Reference¶
v4 API:
gitlab.Gitlab.groups
GitLab API: https://docs.gitlab.com/ce/api/groups.html
Examples¶
List the groups:
Get a group’s detail:
List a group’s projects:
Note
GroupProject objects returned by this API call are very limited, and do not provide all the features of Project objects. If you need to manipulate projects, create a new Project object:
You can filter and sort the result using the following parameters:
archived: limit by archived status
visibility: limit by visibility. Allowed values are public, internal and private
search: limit to groups matching the given value
order_by: sort by criteria. Allowed values are id, name, path, created_at, updated_at and last_activity_at
sort: sort order: asc or desc
ci_enabled_first: return CI enabled groups first
Create a group:
Update a group:
Remove a group:
Subgroups¶
Reference¶
v4 API:
gitlab.v4.objects.Group.subgroups
Examples¶
List the subgroups for a group:
Note
The GroupSubgroup objects don’t expose the same API as the Group objects. If you need to manipulate a subgroup as a group, create a new Group object:
Group custom attributes¶
Reference¶
v4 API:
gitlab.v4.objects.Group.customattributes
GitLab API: https://docs.gitlab.com/ce/api/custom_attributes.html
Examples¶
List custom attributes for a group:
Get a custom attribute for a group:
Set (create or update) a custom attribute for a group:
Delete a custom attribute for a group:
Search groups by custom attribute:
Group members¶
The following constants define the supported access levels:
gitlab.GUEST_ACCESS = 10
gitlab.REPORTER_ACCESS = 20
gitlab.DEVELOPER_ACCESS = 30
gitlab.MAINTAINER_ACCESS = 40
gitlab.OWNER_ACCESS = 50
Reference¶
v4 API:
gitlab.v4.objects.Group.members
GitLab API: https://docs.gitlab.com/ce/api/groups.html
Examples¶
List group members:
List the group members recursively (including inherited members through ancestor groups):
Get a group member:
Add a member to the group:
Update a member (change the access level):
Remove a member from the group:
LDAP group links¶
Add an LDAP group link to an existing GitLab group:
Remove a link:
Sync the LDAP groups:
You can use the ldapgroups manager to list available LDAP groups: