Groups API

On This Page

Before you start, make sure that the igz_mgmt package is installed and that you are logged in to the system with the igz_mgmt.Client API. If not, see Control plane API.

import igz_mgmt
client = igz_mgmt.Client(access_key="some-access-id")

Create a group

group = igz_mgmt.Group.create(client, name="random-people")

List groups

groups = igz_mgmt.Group.list(client, filter_by={"name": "random-people"})


To list resources and filter by a field, use filter_by={"fieldname": "fieldvalue"}

Get a group

group = igz_mgmt.Group.get(client,, include=["users"])

Note: this function gets a group using its id that was already generated in the database, and not by its GID.


  • To include a resource related to another (e.g.: group includes users), use include=["users"] when you .get() the group. This is optional.
  • You can also to get a group by name, instead of by id, by using: group = igz_mgmt.Group.get_by_name(client,, include=["users"])

Add / remove user from a group

An example of creating a user, and adding / removing the user from the group:

create user

import time

new_user = igz_mgmt.User.create(

# add user to group

# get the group with its users
group = igz_mgmt.Group.get(client,, include=["users"])

# make sure you see the user in group users
found = (
                lambda user: user["id"] ==,
    > 0
print("User was added: " + str(found))

# remove user from group

Delete a group

Set wait_for_job_deletion=False to continue with the functions flow without waiting for a response. The delete function does not return a response.

group.delete(client, ignore_missing=False)

Ensure project membership

Ensure that the group has the given role in the given project. If the group is not a member of the project, it is added to the project with the given role. By default, this overrides the group’s current role in the project, if it is already a member.

group = igz_mgmt.Group.get_by_name(client, "default-group")
group.ensure_project_membership(client, project_name="default", role=igz_mgmt.constants.ProjectAuthorizationRoles.admin)

Remove from project

Remove the group as a member of the project.

group = igz_mgmt.Group.get_by_name(client, "default-group")
group.remove_from_project(client, project_name="default")