downtimes
Creates, updates, deletes, gets or lists a downtimes
resource.
Overview
Name | downtimes |
Type | Resource |
Id | datadog.service_management.downtimes |
Fields
The following fields are returned by SELECT
queries:
- get_downtime
- list_downtimes
Name | Datatype | Description |
---|---|---|
id | string | The downtime ID. (example: 00000000-0000-1234-0000-000000000000) |
attributes | object | Downtime details. |
relationships | object | All relationships associated with downtime. |
type | string | Downtime resource type. (default: downtime, example: downtime) |
Name | Datatype | Description |
---|---|---|
id | string | The downtime ID. (example: 00000000-0000-1234-0000-000000000000) |
attributes | object | Downtime details. |
relationships | object | All relationships associated with downtime. |
type | string | Downtime resource type. (default: downtime, example: downtime) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_downtime | select | downtime_id , region | include | Get downtime detail by downtime_id . |
list_downtimes | select | region | current_only , include , page[offset] , page[limit] | Get all scheduled downtimes. |
create_downtime | insert | region , data__data | Schedule a downtime. | |
update_downtime | update | downtime_id , region , data__data | Update a downtime by downtime_id . | |
cancel_downtime | delete | downtime_id , region | Cancel a downtime. 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.
Name | Datatype | Description |
---|---|---|
downtime_id | string | ID of the downtime to cancel. |
region | string | (default: datadoghq.com) |
current_only | boolean | Only return downtimes that are active when the request is made. |
include | string | Comma-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
- list_downtimes
Get downtime detail by downtime_id
.
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.downtimes
WHERE downtime_id = '{{ downtime_id }}' -- required
AND region = '{{ region }}' -- required
AND include = '{{ include }}'
;
Get all scheduled downtimes.
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.downtimes
WHERE region = '{{ region }}' -- required
AND current_only = '{{ current_only }}'
AND include = '{{ include }}'
AND page[offset] = '{{ page[offset] }}'
AND page[limit] = '{{ page[limit] }}'
;
INSERT
examples
- create_downtime
- Manifest
Schedule a downtime.
INSERT INTO datadog.service_management.downtimes (
data__data,
region
)
SELECT
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data,
included
;
# Description fields are for documentation purposes
- name: downtimes
props:
- name: region
value: string
description: Required parameter for the downtimes resource.
- name: data
value: object
description: |
Object to create a downtime.
UPDATE
examples
- update_downtime
Update a downtime by downtime_id
.
UPDATE datadog.service_management.downtimes
SET
data__data = '{{ data }}'
WHERE
downtime_id = '{{ downtime_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data,
included;
DELETE
examples
- cancel_downtime
Cancel a downtime.
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
AND region = '{{ region }}' --required
;