Skip to main content

checks_alerts

Creates, updates, deletes, gets or lists a checks_alerts resource.

Overview

Namechecks_alerts
TypeResource
Iddigitalocean.uptime.checks_alerts

Fields

NameDatatypeDescription
idstringA unique ID that can be used to identify and reference the alert.
namestringA human-friendly display name.
comparisonstringThe comparison operator used against the alert's threshold.
notificationsobjectThe notification settings for a trigger alert.
periodstringPeriod of time the threshold must be exceeded to trigger the alert.
thresholdintegerThe threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
typestringThe type of alert.

Methods

NameAccessible byRequired ParamsDescription
uptime_get_alertSELECTalert_id, check_idTo show information about an existing alert, send a GET request to /v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID.
uptime_list_alertsSELECTcheck_idTo list all of the alerts for an Uptime check, send a GET request to /v2/uptime/checks/$CHECK_ID/alerts.
uptime_create_alertINSERTcheck_idTo create an Uptime alert, send a POST request to /v2/uptime/checks/$CHECK_ID/alerts specifying the attributes in the table below in the JSON body.
uptime_delete_alertDELETEalert_id, check_idTo delete an Uptime alert, send a DELETE request to /v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID. A 204 status code with no body will be returned in response to a successful request.
uptime_update_alertEXECalert_id, check_idTo update the settings of an Uptime alert, send a PUT request to /v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID.

SELECT examples

To list all of the alerts for an Uptime check, send a GET request to /v2/uptime/checks/$CHECK_ID/alerts.

SELECT
id,
name,
comparison,
notifications,
period,
threshold,
type
FROM digitalocean.uptime.checks_alerts
WHERE check_id = '{{ check_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new checks_alerts resource.

/*+ create */
INSERT INTO digitalocean.uptime.checks_alerts (
data__name,
data__type,
data__threshold,
data__comparison,
data__notifications,
data__period,
check_id
)
SELECT
'{{ name }}',
'{{ type }}',
'{{ threshold }}',
'{{ comparison }}',
'{{ notifications }}',
'{{ period }}',
'{{ check_id }}'
;

DELETE example

Deletes the specified checks_alerts resource.

/*+ delete */
DELETE FROM digitalocean.uptime.checks_alerts
WHERE alert_id = '{{ alert_id }}'
AND check_id = '{{ check_id }}';