Alert creation notebook
The alerts examples notebook reads an alert that is already on the tenant, then creates a new alert and works it from start to finish: it rates the scenario-fired event, reads what a disposition prompts for, and closes the alert.
It covers:
- building the client with
SVIClient.from_env()from.envat the repository root - finding an alert with
svi.alerts.list()andsvi.alerts.get() - reading scenario-fired events and their contributing objects
- building
ObjectRef,ContributingObjectInputandScenarioFiredEventInput - previewing the request with
svi.alerts.create_preview(), sending it withsvi.alerts.create(), and resolving the alert withcreated_event.alert() - rating a scenario-fired event with
rate_productivity() - reading what a disposition prompts for with
requirements(), then closing the alert withalert.disposition()
Before you run it
The tenant needs an alert domain with at least one ACTIVE alert, and you need permission to
create and disposition alerts in it. The notebook has no settings: it takes the domain, queue
and entity type from the first ACTIVE alert it finds.
The notebook writes as you run it, so use a test tenant. It only reads the alerts that are already there, and changes only the alert it creates. Alerts cannot be deleted, so that alert stays on the tenant, closed. If you stop before the last cell, close it in Visual Investigator.
An entity has at most one active alert per domain. When the entity already has one,
create() adds the event to that alert instead of opening a new one, so the notebook picks a
record that has no active alert.
To open an investigation from an alert, see Disposition with prompts.