checks
Creates, updates, deletes, gets or lists a checks resource.
Overview
| Name | checks |
| Type | Resource |
| Id | digitalocean.monitoring.checks |
Fields
The following fields are returned by SELECT queries:
- uptime_get_check
- uptime_list_checks
The response will be a JSON object with a key called check. The value of this will be an object that contains the standard attributes associated with an uptime check.
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | A unique ID that can be used to identify and reference the check. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4) |
name | string | A human-friendly display name. (example: Landing page check) |
enabled | boolean | A boolean value indicating whether the check is enabled/disabled. |
regions | array | An array containing the selected regions to perform healthchecks from. |
target | string (url) | The endpoint to perform healthchecks on. (example: https://www.landingpage.com) |
type | string | The type of health check to perform. (example: https) |
The response will be a JSON object with a key called checks. This will be set to an array of objects, each of which will contain the standard attributes associated with an uptime check
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | A unique ID that can be used to identify and reference the check. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4) |
name | string | A human-friendly display name. (example: Landing page check) |
enabled | boolean | A boolean value indicating whether the check is enabled/disabled. |
regions | array | An array containing the selected regions to perform healthchecks from. |
target | string (url) | The endpoint to perform healthchecks on. (example: https://www.landingpage.com) |
type | string | The type of health check to perform. (example: https) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
uptime_get_check | select | check_id | To show information about an existing check, send a GET request to /v2/uptime/checks/$CHECK_ID. | |
uptime_list_checks | select | per_page, page | To list all of the Uptime checks on your account, send a GET request to /v2/uptime/checks. | |
uptime_create_check | insert | data__name, data__method, data__target, data__regions, data__type, data__enabled | To create an Uptime check, send a POST request to /v2/uptime/checks specifying the attributesin the table below in the JSON body. | |
uptime_update_check | replace | check_id | To update the settings of an Uptime check, send a PUT request to /v2/uptime/checks/$CHECK_ID. | |
uptime_delete_check | delete | check_id | To delete an Uptime check, send a DELETE request to /v2/uptime/checks/$CHECK_ID. A 204 statuscode with no body will be returned in response to a successful request. Deleting a check will also delete alerts associated with the check. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
check_id | string (uuid) | A unique identifier for a check. (example: 4de7ac8b-495b-4884-9a69-1050c6793cd6) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT examples
- uptime_get_check
- uptime_list_checks
To show information about an existing check, send a GET request to /v2/uptime/checks/$CHECK_ID.
SELECT
id,
name,
enabled,
regions,
target,
type
FROM digitalocean.monitoring.checks
WHERE check_id = '{{ check_id }}' -- required
;
To list all of the Uptime checks on your account, send a GET request to /v2/uptime/checks.
SELECT
id,
name,
enabled,
regions,
target,
type
FROM digitalocean.monitoring.checks
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- uptime_create_check
- Manifest
To create an Uptime check, send a POST request to /v2/uptime/checks specifying the attributes
in the table below in the JSON body.
INSERT INTO digitalocean.monitoring.checks (
data__name,
data__type,
data__target,
data__regions,
data__enabled
)
SELECT
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ target }}' /* required */,
'{{ regions }}' /* required */,
{{ enabled }} /* required */
RETURNING
check
;
# Description fields are for documentation purposes
- name: checks
props:
- name: name
value: string
description: >
A human-friendly display name.
- name: type
value: string
description: >
The type of health check to perform.
valid_values: ['ping', 'http', 'https']
- name: target
value: string
description: >
The endpoint to perform healthchecks on.
- name: regions
value: array
description: >
An array containing the selected regions to perform healthchecks from.
- name: enabled
value: boolean
description: >
A boolean value indicating whether the check is enabled/disabled.
default: true
REPLACE examples
- uptime_update_check
To update the settings of an Uptime check, send a PUT request to /v2/uptime/checks/$CHECK_ID.
REPLACE digitalocean.monitoring.checks
SET
data__name = '{{ name }}',
data__type = '{{ type }}',
data__target = '{{ target }}',
data__regions = '{{ regions }}',
data__enabled = {{ enabled }}
WHERE
check_id = '{{ check_id }}' --required
RETURNING
check;
DELETE examples
- uptime_delete_check
To delete an Uptime check, send a DELETE request to /v2/uptime/checks/$CHECK_ID. A 204 status
code with no body will be returned in response to a successful request.
Deleting a check will also delete alerts associated with the check.
DELETE FROM digitalocean.monitoring.checks
WHERE check_id = '{{ check_id }}' --required
;