bayesline.api.AsyncIncidentsServiceApi#
- class bayesline.api.AsyncIncidentsServiceApi#
Bases:
ABC
Gives access to system incidents such as failed requests, their logs and contextual information.
Methods
__init__
()get_incident
(incident_id)Obtains the incident with the given ID.
get_incident_summary
([start_date, end_date, ...])Obtains incident summaries for the given date and index range.
submit_incident
(incident_id, source, body)Submits an incident with the given ID and source.
- abstract async submit_incident(incident_id: str, source: str, body: dict[str, Any]) IncidentSummaryItem #
Submits an incident with the given ID and source.
Parameters#
Returns#
- IncidentSummaryItem
The submitted incident item.
- abstract async get_incident_summary(start_date: str | date | datetime | None = None, end_date: str | date | datetime | None = None, start_idx: int = 0, end_idx: int = 999999999) IncidentSummary #
Obtains incident summaries for the given date and index range.
Parameters#
- start_dateDateLike | None, optional
The start date of the range. If None, the last 24 hours are used.
- end_dateDateLike | None, optional
The end date of the range. If None, now is used.
- start_idxint, optional
The start index of the range, 0 being first. Default is 0.
- end_idxint, optional
The end index of the range, -1 being last. Default is 999999999.
Returns#
- IncidentSummary
The incident summary.