Skip to main content

incident_rules

Creates, updates, deletes, gets or lists an incident_rules resource.

Overview

Nameincident_rules
TypeResource
Iddatadog.service_management.incident_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uuid)The rule identifier. (example: 00000000-0000-0000-0000-000000000000)
attributesobjectAttributes of an incident rule in a response.
typestringIncident rule response resource type. (incidents_rules) (example: incidents_rules)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_incident_ruleselectrule_idGet a single incident rule by ID.
list_incident_rulesselectfilter[task_id], filter[trigger], incident_type_uuidList all incident rules.
create_incident_ruleinsertdataCreate an incident rule.
update_incident_ruleupdaterule_id, dataUpdate an incident rule.
delete_incident_ruledeleterule_idDelete an incident rule.

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
rule_idstring (uuid)The UUID of the incident rule.
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.
filter[task_id]stringFilter rules by task ID.
filter[trigger]stringFilter rules by trigger.
incident_type_uuidstring (uuid)Filter rules by incident type UUID. (wire: incidentTypeUUID)

SELECT examples

Get a single incident rule by ID.

SELECT
id,
attributes,
type
FROM datadog.service_management.incident_rules
WHERE rule_id = '{{ rule_id }}' -- required
;

INSERT examples

Create an incident rule.

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

UPDATE examples

Update an incident rule.

UPDATE datadog.service_management.incident_rules
SET
data = '{{ data }}'
WHERE
rule_id = '{{ rule_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete an incident rule.

DELETE FROM datadog.service_management.incident_rules
WHERE rule_id = '{{ rule_id }}' --required
;