maintenance_windows
Creates, updates, deletes, gets or lists a maintenance_windows resource.
Overview
| Name | maintenance_windows |
| Type | Resource |
| Id | datadog.service_management.maintenance_windows |
Fields
The following fields are returned by SELECT queries:
- list_maintenance_windows
| Name | Datatype | Description |
|---|---|---|
id | string | The maintenance window's identifier. (example: a1b2c3d4-e5f6-7890-abcd-ef1234567890) |
attributes | object | Attributes of a maintenance window, including its schedule and the query that determines which cases are affected. |
type | string | JSON:API resource type for maintenance windows. (maintenance_window) (default: maintenance_window, example: maintenance_window) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_maintenance_windows | select | 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. | ||
create_maintenance_window | insert | data | Creates a maintenance window for event management cases with a name, case filter query, and time range (start and end). | |
update_maintenance_window | replace | maintenance_window_id, data | Updates the name, query, start time, or end time of an existing maintenance window. | |
delete_maintenance_window | delete | maintenance_window_id | Permanently 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.
| Name | Datatype | Description |
|---|---|---|
maintenance_window_id | string | The UUID of the maintenance window. (example: a1b2c3d4-e5f6-7890-abcd-ef1234567890) |
site | string | The 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
- list_maintenance_windows
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
- create_maintenance_window
- Manifest
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
;
# Description fields are for documentation purposes
- name: maintenance_windows
props:
- name: data
description: |
Data object for creating a maintenance window.
value:
attributes:
end_at: "{{ end_at }}"
name: "{{ name }}"
query: "{{ query }}"
start_at: "{{ start_at }}"
type: "{{ type }}"
REPLACE examples
- update_maintenance_window
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
- delete_maintenance_window
Permanently deletes a maintenance window.
DELETE FROM datadog.service_management.maintenance_windows
WHERE maintenance_window_id = '{{ maintenance_window_id }}' --required
;