Alert
Alerts are a way to notify you when something happens. For example, you can create an alert that notifies you when the temperature of a sensor is above 100 degrees. Or maybe you want to be notified when the energy consumption of a building is above 1000 kW. You can create alerts by creating/updating/deleting conditions that need to be met to trigger the alert. Then whenever the alert status changes you will be notified by email if you have the integration activated and you will also receive a notification in the platform.
Creating an Alert
To create an alert you need to specify the following parameters:
name
The name of the alert.
Yes
description
A description of the alert (optional field).
No
severity
The severity of the alert.
Yes
type
The type of the alert. Could be cron
or rate
.
Yes
tags
Tags to be associated with the alert (optional field).
No
alert_items
The items that will be used to trigger the alert. Optional when creating the alert, but required when updating.
No*
stmt_thresholds
The thresholds that will be used to trigger the alert. Optional when creating the alert, but required when updating.
No*
* Optional when creating the alert, but required when updating.
Reading Alerts
The Splight API offers a robust set of endpoints for reading alert data. You can retrieve information about all alerts or filter them using specific criteria. The API supports various query parameters to help you refine your search.
Below are some examples of how to read alerts using the API, with code snippets in both curl and Python:
Listing all Alerts
Retrive a single Alert
To retrieve a single alert, you can use the alert ID in the URL. This will return detailed information about that specific alert.
Updating an Alert
To update an alert, you can use the alert ID in the URL and specify the fields you want to update in the request body. You can update any of the fields that were used to create the alert.
All fields are optional when updating an alert, but at least one field must be specified. Fields that are not provided will remain unchanged.
The rate and cron fields are mutually exclusive. If you specify one, the other will be ignored.
Deleting an Alert
To delete an alert, you can use the alert ID in the URL. This will remove the alert from the system.
Last updated
Was this helpful?