Target Groups¶
The following methods allow for interaction into the Tenable Vulnerability Management target_groups API endpoints.
Methods available on tio.target_groups
:
- class TargetGroupsAPI(api: APISession)[source]¶
- create(name, members, **kw)[source]¶
Create a target-group.
- Parameters:
name (str) – The name of the target group
members (list) – The members of the target group. FQDNs, CIDRs, IPRanges, and individual IPs are supported.
acls (list, optional) – A list of ACLs defining how the asset list can be used. For further information on how the ACL dictionaries should be written, please refer to the API documentation.
- Returns:
The resource record of the newly created target group.
- Return type:
Examples
>>> tg = tio.target_groups.create('Example', ['192.168.0.0/24'])
- delete(id)[source]¶
Delete a target group.
- Parameters:
id (int) – The unique identifier for the target group.
- Returns:
The target group was successfully deleted.
- Return type:
Examples
>>> tio.target_groups.delete(1)
- details(id)[source]¶
Retrieve the details of a target group.
- Parameters:
id (int) – The unique identifier for the target group.
- Returns:
The resource record for the target group.
- Return type:
Examples
>>> tg = tio.target_groups.details(1)
- edit(id, **kw)[source]¶
Edit an existing target group.
- Parameters:
id (int) – The unique identifier for the target group.
name (str, optional) – The name of the target group.
members (list, optional) – The members of the target group. FQDNs, CIDRs, IPRanges, and individual IPs are supported. NOTE: modifying the member list is atomic and not additive. All previous members that are desired to be kept within the member list much also be included.
acls (list, optional) – A list of ACLs defining how the asset list can be used. For further information on how the ACL dictionaries should be written, please refer to the API documentation. NOTE: modifying ACLs is atomic and not additive. Please provide the complete list of ACLs that this asset group will need.
- Returns:
The modified target group resource record.
- Return type:
Examples
>>> tio.target_groups.edit(1, name='Updated TG Name')