인시던트 규칙 업데이트
https://api.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.us3.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.us5.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.datadoghq.eu/api/v2/incidents/config/rules/{rule_id}https://api.ap1.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.ap2.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.uk1.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.ddog-gov.com/api/v2/incidents/config/rules/{rule_id}https://api.us2.ddog-gov.com/api/v2/incidents/config/rules/{rule_id}개요
인시던트 규칙을 업데이트합니다.
OAuth apps require the incident_settings_write authorization scope to access this endpoint.
인수
경로 파라미터
rule_id [required]The UUID of the incident rule.
요청
Body Data (required)
인시던트 규칙 패치 페이로드입니다.
data [required]인시던트 규칙 패치를 위한 요청 페이로드입니다.
attributesAttributes for patching an incident rule. All fields are optional.
conditionA query-based condition for an incident rule.
normalized_queryThe normalized query string.
raw_queryThe raw query string.
conditionsList of field-based conditions.
field [required]The field to match on.
values [required]The values to match.
enabledWhether the rule is enabled.
task_payloadThe JSON-encoded payload for the task.
triggerThe trigger event for an incident rule.
incident_saved_trigger, incident_created_trigger, incident_modified_triggerid [required]The rule identifier.
type [required]Incident rule resource type.
incident_rules{
"data": {
"attributes": {
"condition": {
"normalized_query": "severity:SEV-1",
"raw_query": "severity:SEV-1"
},
"conditions": [
{
"field": "severity",
"values": [
"SEV-1",
"SEV-2"
]
}
],
"enabled": true,
"task_payload": "{}",
"trigger": "incident_created_trigger"
},
"id": "00000000-0000-0000-0000-000000000000",
"type": "incident_rules"
}
}응답
OK
Response with a single incident rule.
data [required]Incident rule data in a response.
attributes [required]Attributes of an incident rule in a response.
conditionA query-based condition for an incident rule.
normalized_queryThe normalized query string.
raw_queryThe raw query string.
condition_table_typeThe condition table type.
conditionsList of field-based conditions.
field [required]The field to match on.
values [required]The values to match.
createdTimestamp when the rule was created.
created_by_uuidUUID of the user who created the rule.
deletedTimestamp when the rule was deleted.
enabledWhether the rule is enabled.
execution_typeThe execution type of the rule.
incident_settings_association_uuidThe incident settings association UUID.
match_any_conditionWhether any condition should match.
modifiedTimestamp when the rule was last modified.
modified_by_uuidUUID of the user who last modified the rule.
org_idThe organization ID.
task_idThe task ID.
task_payloadThe JSON-encoded task payload.
triggerThe trigger event for the rule.
id [required]The rule identifier.
type [required]Incident rule response resource type.
incidents_rules{
"data": {
"attributes": {
"condition": {
"normalized_query": "severity:SEV-1",
"raw_query": "severity:SEV-1"
},
"condition_table_type": 1,
"conditions": [
{
"field": "severity",
"values": [
"SEV-1",
"SEV-2"
]
}
],
"created": "2024-01-01T00:00:00.000Z",
"created_by_uuid": "00000000-0000-0000-0000-000000000001",
"deleted": null,
"enabled": true,
"execution_type": 1,
"incident_settings_association_uuid": null,
"match_any_condition": false,
"modified": "2024-01-01T00:00:00.000Z",
"modified_by_uuid": "00000000-0000-0000-0000-000000000001",
"org_id": 123456,
"task_id": "notify-incident-handles-job",
"task_payload": "{}",
"trigger": "incident_created_trigger"
},
"id": "00000000-0000-0000-0000-000000000000",
"type": "incidents_rules"
}
}Bad Request
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}코드 예시
# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF# Path parameters
export rule_id="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PATCH "https://api.${DD_SITE}/api/v2/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF