Skip to main content

maintenance_windows

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

Overview

Namemaintenance_windows
TypeResource
Iddatadog.service_management.maintenance_windows

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe maintenance window's identifier. (example: a1b2c3d4-e5f6-7890-abcd-ef1234567890)
attributesobjectAttributes of a maintenance window, including its schedule and the query that determines which cases are affected.
typestringJSON:API resource type for maintenance windows. (maintenance_window) (default: maintenance_window, example: maintenance_window)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_maintenance_windowsselectReturns all configured maintenance windows for event management cases. Maintenance windows define time periods during which case notifications and automation rules are suppressed for cases matching a given query.
create_maintenance_windowinsertdataCreates a maintenance window for event management cases with a name, case filter query, and time range (start and end).
update_maintenance_windowreplacemaintenance_window_id, dataUpdates the name, query, start time, or end time of an existing maintenance window.
delete_maintenance_windowdeletemaintenance_window_idPermanently deletes a maintenance window.

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
maintenance_window_idstringThe UUID of the maintenance window. (example: a1b2c3d4-e5f6-7890-abcd-ef1234567890)
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.

SELECT examples

Returns all configured maintenance windows for event management cases. Maintenance windows define time periods during which case notifications and automation rules are suppressed for cases matching a given query.

SELECT
id,
attributes,
type
FROM datadog.service_management.maintenance_windows
;

INSERT examples

Creates a maintenance window for event management cases with a name, case filter query, and time range (start and end).

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

REPLACE examples

Updates the name, query, start time, or end time of an existing maintenance window.

REPLACE datadog.service_management.maintenance_windows
SET
data = '{{ data }}'
WHERE
maintenance_window_id = '{{ maintenance_window_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Permanently deletes a maintenance window.

DELETE FROM datadog.service_management.maintenance_windows
WHERE maintenance_window_id = '{{ maintenance_window_id }}' --required
;