Important

The Nessus Package is currently a Technology Preview

Agent Groups

Methods described in this section relate to the the agent groups API. These methods can be accessed at Nessus.agent_groups.

class AgentGroupsAPI(api: APISession)[source]
add_agent(group_id: int, agent_id: int) None[source]

Adds a singular agent to an agent group.

Parameters:
  • group_id (int) – The agent group id to modify

  • agent_id (int) – The agent id

Example

>>> nessus.agent_groups.add_agent(group_id, agent_id)
add_agents(group_id: int, agents: List[int]) None[source]

Adds multiple agents to an agent group.

Parameters:
  • group_id (int) – The agent group id to modify

  • agents (list[int]) – A list opf agent ids to add to the group.

Example

>>> nessus.agent_groups.add_agents(group_id, [agent1, agent2])
configure(group_id: int, name: str) None[source]

Changes the name of the given agent group.

Parameters:
  • group_id (int) – The agent group id to modify

  • name (str) – The name of the agent group

Example

>>> nessus.agent_groups.configure(group_id, 'Example name')
create(name: str) Dict[source]

Creates an agent group.

Parameters:

name (str) – The name of the agent group

Example

>>> group = nessus.agent_groups.create('Example agent group')
delete_agent(group_id: int, agent_id: int) None[source]

Deletes an agent from the agent group.

Parameters:
  • group_id (int) – The agent group id to modify

  • agent_id (int) – The agent id to delete from the group

Example

>>> nessus.agent_groups.delete_agent(group_id, agent_id)
delete_agents(group_id: int, agents: List[int]) None[source]

Deletes multiple agents from the agent group.

Parameters:
  • group_id (int) – The agent group to modify

  • agents (list[int]) – A list of agent ids to remove fromt he group

Example

>>> nessus.agent_groups.delete_agents(group_id, [agent1, agent2])
delete_group(group_id: int) None[source]

Deletes an agent group.

Parameters:

group_id (int) – The agent group id to be deleted.

Example

>>> nessus.agent_groups.delete_group(group_id)
delete_groups(group_ids: List[int]) None[source]

Deleted multiple agent groups.

Parameters:

group_ids (list[int]) – A list of agent group ids to delete

Example

>>> nessus.agent_groups.delete_groups([group1, group2, group3])
details(group_id: int) Dict[source]

Returns details for the given agent group

Parameters:

group_id (int) – The agent group id to retrieve

Example

>>> group = nessus.agent_groups.details(group_id)
list() List[Dict][source]

Returns a listing of the agent groups

Example

>>> groups = nessus.agent_groups.list()