Skip to main content

checks

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

Overview

Namechecks
TypeResource
Iddigitalocean.monitoring.checks

Fields

The following fields are returned by SELECT queries:

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.

NameDatatypeDescription
idstring (uuid)A unique ID that can be used to identify and reference the check. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4)
namestringA human-friendly display name. (example: Landing page check)
enabledbooleanA boolean value indicating whether the check is enabled/disabled.
regionsarrayAn array containing the selected regions to perform healthchecks from.
targetstring (url)The endpoint to perform healthchecks on. (example: https://www.landingpage.com)
typestringThe type of health check to perform. (example: https)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
uptime_get_checkselectcheck_idTo show information about an existing check, send a GET request to /v2/uptime/checks/$CHECK_ID.
uptime_list_checksselectper_page, pageTo list all of the Uptime checks on your account, send a GET request to /v2/uptime/checks.
uptime_create_checkinsertdata__name, data__method, data__target, data__regions, data__type, data__enabledTo create an Uptime check, send a POST request to /v2/uptime/checks specifying the attributes
in the table below in the JSON body.
uptime_update_checkreplacecheck_idTo update the settings of an Uptime check, send a PUT request to /v2/uptime/checks/$CHECK_ID.
uptime_delete_checkdeletecheck_idTo 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.

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.

NameDatatypeDescription
check_idstring (uuid)A unique identifier for a check. (example: 4de7ac8b-495b-4884-9a69-1050c6793cd6)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

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;

INSERT examples

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
;

REPLACE examples

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

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;