incident_rules
Creates, updates, deletes, gets or lists an incident_rules resource.
Overview
| Name | incident_rules |
| Type | Resource |
| Id | datadog.service_management.incident_rules |
Fields
The following fields are returned by SELECT queries:
- get_incident_rule
- list_incident_rules
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | The rule identifier. (example: 00000000-0000-0000-0000-000000000000) |
attributes | object | Attributes of an incident rule in a response. |
type | string | Incident rule response resource type. (incidents_rules) (example: incidents_rules) |
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | The rule identifier. (example: 00000000-0000-0000-0000-000000000000) |
attributes | object | Attributes of an incident rule in a response. |
type | string | Incident rule response resource type. (incidents_rules) (example: incidents_rules) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_incident_rule | select | rule_id | Get a single incident rule by ID. | |
list_incident_rules | select | filter[task_id], filter[trigger], incident_type_uuid | List all incident rules. | |
create_incident_rule | insert | data | Create an incident rule. | |
update_incident_rule | update | rule_id, data | Update an incident rule. | |
delete_incident_rule | delete | rule_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
rule_id | string (uuid) | The UUID of the incident rule. |
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[task_id] | string | Filter rules by task ID. |
filter[trigger] | string | Filter rules by trigger. |
incident_type_uuid | string (uuid) | Filter rules by incident type UUID. (wire: incidentTypeUUID) |
SELECT examples
- get_incident_rule
- list_incident_rules
Get a single incident rule by ID.
SELECT
id,
attributes,
type
FROM datadog.service_management.incident_rules
WHERE rule_id = '{{ rule_id }}' -- required
;
List all incident rules.
SELECT
id,
attributes,
type
FROM datadog.service_management.incident_rules
WHERE filter[task_id] = '{{ filter[task_id] }}'
AND filter[trigger] = '{{ filter[trigger] }}'
AND incident_type_uuid = '{{ incident_type_uuid }}'
;
INSERT examples
- create_incident_rule
- Manifest
Create an incident rule.
INSERT INTO datadog.service_management.incident_rules (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: incident_rules
props:
- name: data
description: |
Incident rule data in a create request.
value:
attributes:
condition:
normalized_query: "{{ normalized_query }}"
raw_query: "{{ raw_query }}"
condition_table_type: {{ condition_table_type }}
conditions:
- field: "{{ field }}"
values: "{{ values }}"
enabled: {{ enabled }}
execution_type: {{ execution_type }}
incident_type_uuid: "{{ incident_type_uuid }}"
match_any_condition: {{ match_any_condition }}
task_id: "{{ task_id }}"
task_payload: "{{ task_payload }}"
trigger: "{{ trigger }}"
type: "{{ type }}"
UPDATE examples
- update_incident_rule
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_incident_rule
Delete an incident rule.
DELETE FROM datadog.service_management.incident_rules
WHERE rule_id = '{{ rule_id }}' --required
;