apollo.groups package

Module contents

Contains possible interactions with the Apollo Groups

class apollo.groups.GroupsClient(webapolloinstance, **requestArgs)

Bases: apollo.client.Client

CLIENT_BASE = '/group/'
create_group(name)

Create a new group

Parameters:name (str) – Group name (or a list of groups to create)
Return type:dict
Returns:Group information dictionary
delete_group(group)

Delete a group

Parameters:group (str) – Group name (or a list of groups to delete)
Return type:dict
Returns:an empty dictionary
get_group_admin(group)

Get the group’s admins

Parameters:group (str) – group name
Return type:list
Returns:a list containing group admins
get_group_creator(group)

Get the group’s creator

Parameters:group (str) – group name
Return type:list
Returns:creator userId
get_groups(name=None)

Get all the groups

Parameters:name (str) – Only return group(s) with given name
Return type:list of dicts
Returns:list of a dictionaries containing group information
get_organism_permissions(group)

Get the group’s organism permissions

Parameters:group (str) – group name
Return type:list
Returns:a list containing organism permissions (if any)
show_group(group_id)

Get information about a group

Parameters:group_id (int) – Group ID Number
Return type:dict
Returns:a dictionary containing group information
update_group(group_id, new_name)

Update the name of a group

Parameters:
  • group_id (int) – group ID number
  • new_name (str) – New name for the group
Return type:

dict

Returns:

a dictionary containing group information

update_group_admin(group_id, users=[])

Update the group’s admins

Parameters:
  • group_id (int) – Group ID Number
  • users (list of str) – List of emails
Return type:

dict

Returns:

dictionary of group information

update_membership(group_id=None, users=[], memberships=[])

Update the group’s membership

Parameters:
  • group_id (int) – Group ID Number
  • users (list of str) – List of emails
  • memberships (list) – Bulk memberships to update of the form: [ {groupId: <groupId>,users: [“user1”, “user2”, “user3”]}, {groupId:<another-groupId>, users: [“user2”, “user8”]} (users and groupId will be ignored)
Return type:

dict

Returns:

dictionary of group information

update_organism_permissions(group, organism_name, administrate=False, write=False, read=False, export=False)

Update the group’s permissions on an organism

Parameters:
  • group (str) – group name
  • organism_name (str) – Organism name
  • administrate (bool) – Should the group have administrate privileges
  • read (bool) – Should the group have read privileges
  • write (bool) – Should the group have write privileges
  • export (bool) – Should the group have export privileges
Return type:

list

Returns:

list of group organism permissions