Groups¶
The following methods allow for interaction into the Tenable Vulnerability Management groups API.
Methods available on tio.groups
:
- class GroupsAPI(api: APISession)[source]¶
- add_user(group_id, user_id)[source]¶
Add a user to a user group.
- Parameters:
- Returns:
The user was successfully added to the group.
- Return type:
Examples
>>> tio.groups.add_user(1, 1)
- create(name)[source]¶
Create a new user group.
- Parameters:
name (str) – The name of the group that will be created.
- Returns:
The group resource record of the newly minted group.
- Return type:
Examples
>>> group = tio.groups.create('Group Name')
- delete(id)[source]¶
Delete a user group.
- Parameters:
id (int) – The unique identifier for the group to be deleted.
- Returns:
The group was successfully deleted.
- Return type:
Examples
>>> tio.groups.delete(1)
- delete_user(group_id, user_id)[source]¶
Delete a user from a user group.
- Parameters:
- Returns:
The user was successfully removed from the group.
- Return type:
Examples
>>> tio.groups.delete_user(1, 1)
- edit(id, name)[source]¶
Edit a user group.
- Parameters:
- Returns:
The group resource record.
- Return type:
Examples
>>> tio.groups.edit(1, 'Updated name')
- list()[source]¶
Lists all of the available user groups.
- Returns:
List of the group resource records
- Return type:
Examples
>>> for group in tio.groups.list(): ... pprint(group)
- list_users(id)[source]¶
List the user memberships within a specific user group.
- Parameters:
id (int) – The unique identifier of the group requested.
- Returns:
List of user resource records based on membership to the specified group.
- Return type:
Example
>>> for user in tio.groups.list_users(1): ... pprint(user)