statuspage_maintenances
Creates, updates, deletes, gets or lists a statuspage_maintenances resource.
Overview
| Name | statuspage_maintenances |
| Type | Resource |
| Id | datadog.service_management.statuspage_maintenances |
Fields
The following fields are returned by SELECT queries:
- get_maintenance
- list_maintenances
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | The ID of the maintenance. |
attributes | object | The attributes of a maintenance. |
relationships | object | The relationships of a maintenance. |
type | string | Maintenances resource type. (maintenances) (default: maintenances, example: maintenances) |
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | The ID of the maintenance. |
attributes | object | The attributes of a maintenance. |
relationships | object | The relationships of a maintenance. |
type | string | Maintenances resource type. (maintenances) (default: maintenances, example: maintenances) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_maintenance | select | page_id, maintenance_id | include | Retrieves a specific maintenance by its ID. |
list_maintenances | select | filter[page_id], page[offset], page[limit], include, filter[status], sort | Lists all maintenances for the organization. Optionally filter by status and page. | |
create_maintenance | insert | page_id | notify_subscribers, include | Schedules a new maintenance. |
update_maintenance | update | page_id, maintenance_id | notify_subscribers, include | Updates an existing maintenance's attributes. |
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_id | string (uuid) | The ID of the maintenance. |
page_id | string (uuid) | The ID of the status page. |
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. |
filter[page_id] | string | Optional page id filter. |
filter[status] | string | Optional maintenance status filter. Supported values: scheduled, in_progress, completed. |
include | string | Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page. |
notify_subscribers | boolean | Whether to notify page subscribers of the maintenance. |
page[limit] | integer (int64) | The number of maintenances to return per page. |
page[offset] | integer (int64) | Offset to use as the start of the page. |
sort | string | Sort order. Prefix with '-' for descending. Supported values: created_at, -created_at, start_date, -start_date. |
SELECT examples
- get_maintenance
- list_maintenances
Retrieves a specific maintenance by its ID.
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.statuspage_maintenances
WHERE page_id = '{{ page_id }}' -- required
AND maintenance_id = '{{ maintenance_id }}' -- required
AND include = '{{ include }}'
;
Lists all maintenances for the organization. Optionally filter by status and page.
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.statuspage_maintenances
WHERE filter[page_id] = '{{ filter[page_id] }}'
AND page[offset] = '{{ page[offset] }}'
AND page[limit] = '{{ page[limit] }}'
AND include = '{{ include }}'
AND filter[status] = '{{ filter[status] }}'
AND sort = '{{ sort }}'
;
INSERT examples
- create_maintenance
- Manifest
Schedules a new maintenance.
INSERT INTO datadog.service_management.statuspage_maintenances (
data,
page_id,
notify_subscribers,
include
)
SELECT
'{{ data }}',
'{{ page_id }}',
'{{ notify_subscribers }}',
'{{ include }}'
RETURNING
data,
included
;
# Description fields are for documentation purposes
- name: statuspage_maintenances
props:
- name: page_id
value: "{{ page_id }}"
description: Required parameter for the statuspage_maintenances resource.
- name: data
description: |
The data object for creating a maintenance.
value:
attributes:
completed_date: "{{ completed_date }}"
completed_description: "{{ completed_description }}"
components_affected:
- id: "{{ id }}"
name: "{{ name }}"
status: "{{ status }}"
in_progress_description: "{{ in_progress_description }}"
scheduled_description: "{{ scheduled_description }}"
start_date: "{{ start_date }}"
title: "{{ title }}"
relationships:
template:
data:
id: "{{ id }}"
type: "{{ type }}"
type: "{{ type }}"
- name: notify_subscribers
value: {{ notify_subscribers }}
description: Whether to notify page subscribers of the maintenance.
description: Whether to notify page subscribers of the maintenance.
- name: include
value: "{{ include }}"
description: Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page.
description: Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page.
UPDATE examples
- update_maintenance
Updates an existing maintenance's attributes.
UPDATE datadog.service_management.statuspage_maintenances
SET
data = '{{ data }}'
WHERE
page_id = '{{ page_id }}' --required
AND maintenance_id = '{{ maintenance_id }}' --required
AND notify_subscribers = {{ notify_subscribers}}
AND include = '{{ include}}'
RETURNING
data,
included;