Skip to main content

downtimes

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

Overview​

Namedowntimes
TypeResource
Iddatadog.service_management.downtimes

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe downtime ID. (example: 00000000-0000-1234-0000-000000000000)
attributesobjectDowntime details.
relationshipsobjectAll relationships associated with downtime.
typestringDowntime resource type. (downtime) (default: downtime, example: downtime)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_downtimeselectdowntime_idincludeGet downtime detail by downtime_id.
list_downtimesselectcurrent_only, include, page[offset], page[limit]Get all scheduled downtimes.
create_downtimeinsertdataSchedule a downtime.
update_downtimeupdatedowntime_id, dataUpdate a downtime by downtime_id.
cancel_downtimedeletedowntime_idCancel a downtime.<br /><br />Note: Downtimes canceled through the API are no longer active, but are retained for approximately two days before being permanently removed. The downtime may still appear in search results until it is permanently removed.

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
downtime_idstringID of the downtime to cancel.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
current_onlybooleanOnly return downtimes that are active when the request is made.
includestringComma-separated list of resource paths for related resources to include in the response. Supported resource paths are created_by and monitor.
page[limit]integer (int64)Maximum number of downtimes in the response. (example: 100)
page[offset]integer (int64)Specific offset to use as the beginning of the returned page.

SELECT examples​

Get downtime detail by downtime_id.

SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.downtimes
WHERE downtime_id = '{{ downtime_id }}' -- required
AND include = '{{ include }}'
;

INSERT examples​

Schedule a downtime.

INSERT INTO datadog.service_management.downtimes (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data,
included
;

UPDATE examples​

Update a downtime by downtime_id.

UPDATE datadog.service_management.downtimes
SET
data = '{{ data }}'
WHERE
downtime_id = '{{ downtime_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data,
included;

DELETE examples​

Cancel a downtime.<br /><br />Note: Downtimes canceled through the API are no longer active, but are retained for approximately two days before being permanently removed. The downtime may still appear in search results until it is permanently removed.

DELETE FROM datadog.service_management.downtimes
WHERE downtime_id = '{{ downtime_id }}' --required
;