Alerts¶
Methods described in this section relate to the alerts API.
These methods can be accessed at TenableIE.alerts
.
- class AlertsAPI(api: APISession)[source]¶
- details(alert_id: str) → Dict[source]¶
Retrieves the details of a specific alert.
- Parameters:
alert_id (str) – The alert instance identifier.
- Returns:
the alert object.
- Return type:
Examples
>>> tie.alerts.details( ... alert_id='1' ... )
- list_by_profile(profile_id: str, **kwargs) → AlertIterator[source]¶
Retrieve all alert instances
- Parameters:
profile_id (str) – The profile instance identifier.
archived (optional, bool) – is alert archived?
read (optional, bool) – is alert read?
page (optional, int) – The page number user wants to retrieve.
per_page (optional, int) – The number of records per page user wants to retrieve.
max_items (optional, int) – The maximum number of records to return before stopping iteration.
max_pages (optional, int) – The maximum number of pages to request before throwing stopping iteration.
- Returns:
An iterator that handles the page management of the requested records.
- Return type:
AlertIterator
Examples
>>> for alert in tie.alerts.list_by_profile( ... profile_id='1', ... archived=False, ... read=False, ... page=1, ... per_page=20, ... max_pages=10, ... max_items=200 ... ): ... pprint(alert)
- update(alert_id: str, **kwargs) → Dict[source]¶
Update alert instance
- Parameters:
- Returns:
The updated alert object.
- Return type:
Example
>>> tie.alerts.update( ... alert_id='1', ... archived=False, ... read=False ... )