checks_alerts
Creates, updates, deletes, gets or lists a checks_alerts
resource.
Overview
Name | checks_alerts |
Type | Resource |
Id | digitalocean.uptime.checks_alerts |
Fields
Name | Datatype | Description |
---|---|---|
id | string | A unique ID that can be used to identify and reference the alert. |
name | string | A human-friendly display name. |
comparison | string | The comparison operator used against the alert's threshold. |
notifications | object | The notification settings for a trigger alert. |
period | string | Period of time the threshold must be exceeded to trigger the alert. |
threshold | integer | The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type. |
type | string | The type of alert. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
uptime_get_alert | SELECT | alert_id, check_id | To show information about an existing alert, send a GET request to /v2/uptime/checks/$CHECK_ID/alerts/$ALERT_ID . |
uptime_list_alerts | SELECT | check_id | To list all of the alerts for an Uptime check, send a GET request to /v2/uptime/checks/$CHECK_ID/alerts . |
uptime_create_alert | INSERT | check_id | To 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_alert | DELETE | alert_id, check_id | To 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_alert | EXEC | alert_id, check_id | To 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.
- Required Properties
- All Properties
- Manifest
/*+ 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 }}'
;
/*+ create */
INSERT INTO digitalocean.uptime.checks_alerts (
check_id
)
SELECT
'{{ check_id }}'
;
- name: checks_alerts
props:
- name: check_id
value: string
- name: name
value: string
- name: type
value: string
- name: threshold
value: integer
- name: comparison
value: string
- name: notifications
props:
- name: email
value: array
- name: slack
value: array
props:
- name: channel
value: string
- name: url
value: string
- name: period
value: string
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 }}';