incidents
Creates, updates, deletes, gets or lists an incidents resource.
Overview
| Name | incidents |
| Type | Resource |
| Id | datadog.service_management.incidents |
Fields
The following fields are returned by SELECT queries:
- get_incident
- list_incidents
- search_incidents
| Name | Datatype | Description |
|---|---|---|
id | string | The incident's ID. (example: 00000000-0000-0000-1234-000000000000) |
attributes | object | The incident's attributes from a response. |
relationships | object | The incident's relationships from a response. |
type | string | Incident resource type. (incidents) (default: incidents, example: incidents) |
| Name | Datatype | Description |
|---|---|---|
id | string | The incident's ID. (example: 00000000-0000-0000-1234-000000000000) |
attributes | object | The incident's attributes from a response. |
relationships | object | The incident's relationships from a response. |
type | string | Incident resource type. (incidents) (default: incidents, example: incidents) |
| Name | Datatype | Description |
|---|---|---|
attributes | object | Attributes returned by an incident search. |
type | string | Incident search result type. (incidents_search_results) (default: incidents_search_results, example: incidents_search_results) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_incident | select | incident_id | include | Get the details of an incident by incident_id. |
list_incidents | select | include, page[size], page[offset] | Get all incidents for the user's organization. | |
search_incidents | select | query | include, sort, page[size], page[offset] | Search for incidents matching a certain query. |
create_incident | insert | data | Create an incident. | |
update_incident | update | incident_id, data | include | Updates an incident. Provide only the attributes that should be updated as this request is a partial update. |
delete_incident | delete | incident_id | Deletes an existing incident from the users organization. | |
import_incident | exec | data | include | Import an incident from an external system. This endpoint allows you to create incidents with<br />historical data such as custom timestamps for detection, declaration, and resolution.<br />Imported incidents do not execute integrations or notification rules. |
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 |
|---|---|---|
incident_id | string | The UUID of the incident. |
query | string | Specifies which incidents should be returned. The query can contain any number of incident facets joined by ANDs, along with multiple values for each of those facets joined by ORs. For example: state:active AND severity:(SEV-2 OR SEV-1). |
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. |
include | array | Specifies which related object types to include in the response when importing an incident. |
page[offset] | integer (int64) | Specific offset to use as the beginning of the returned page. |
page[size] | integer (int64) | Number of items to return per page. The maximum allowed value is 100. |
sort | string | Specifies the order of returned incidents. |
SELECT examples
- get_incident
- list_incidents
- search_incidents
Get the details of an incident by incident_id.
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.incidents
WHERE incident_id = '{{ incident_id }}' -- required
AND include = '{{ include }}'
;
Get all incidents for the user's organization.
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.incidents
WHERE include = '{{ include }}'
AND page[size] = '{{ page[size] }}'
AND page[offset] = '{{ page[offset] }}'
;
Search for incidents matching a certain query.
SELECT
attributes,
type
FROM datadog.service_management.incidents
WHERE query = '{{ query }}' -- required
AND include = '{{ include }}'
AND sort = '{{ sort }}'
AND page[size] = '{{ page[size] }}'
AND page[offset] = '{{ page[offset] }}'
;
INSERT examples
- create_incident
- Manifest
Create an incident.
INSERT INTO datadog.service_management.incidents (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data,
included
;
# Description fields are for documentation purposes
- name: incidents
props:
- name: data
description: |
Incident data for a create request.
value:
attributes:
customer_impact_scope: "{{ customer_impact_scope }}"
customer_impacted: {{ customer_impacted }}
fields: "{{ fields }}"
incident_type_uuid: "{{ incident_type_uuid }}"
initial_cells:
- cell_type: "{{ cell_type }}"
content:
content: "{{ content }}"
important: {{ important }}
is_test: {{ is_test }}
notification_handles:
- display_name: "{{ display_name }}"
handle: "{{ handle }}"
title: "{{ title }}"
relationships:
commander_user:
data:
id: "{{ id }}"
type: "{{ type }}"
type: "{{ type }}"
UPDATE examples
- update_incident
Updates an incident. Provide only the attributes that should be updated as this request is a partial update.
UPDATE datadog.service_management.incidents
SET
data = '{{ data }}'
WHERE
incident_id = '{{ incident_id }}' --required
AND data = '{{ data }}' --required
AND include = '{{ include}}'
RETURNING
data,
included;
DELETE examples
- delete_incident
Deletes an existing incident from the users organization.
DELETE FROM datadog.service_management.incidents
WHERE incident_id = '{{ incident_id }}' --required
;
Lifecycle Methods
EXEC variables use wire (API) names.
- import_incident
Import an incident from an external system. This endpoint allows you to create incidents with<br />historical data such as custom timestamps for detection, declaration, and resolution.<br />Imported incidents do not execute integrations or notification rules.
EXEC datadog.service_management.incidents.import_incident
@include='{{ include }}'
@@json=
'{
"data": "{{ data }}"
}'
;