Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29120,6 +29120,92 @@ components:
user_defined_fields:
$ref: '#/components/schemas/RelationshipToIncidentUserDefinedFields'
type: object
IncidentRuleAttributesRequest:
properties:
name:
description: The name of the rule
example: High Severity Rule
type: string
required:
- name
type: object
IncidentRuleAttributesResponse:
properties:
createdAt:
description: When the rule was created
example: '2026-01-13T17:15:53.208340Z'
format: date-time
type: string
modifiedAt:
description: When the rule was last modified
example: '2026-01-13T17:15:53.208340Z'
format: date-time
type: string
name:
description: The name of the rule
example: High Severity Rule
type: string
required:
- name
- createdAt
- modifiedAt
type: object
IncidentRuleDataRequest:
properties:
attributes:
$ref: '#/components/schemas/IncidentRuleAttributesRequest'
type:
$ref: '#/components/schemas/IncidentRuleType'
required:
- type
- attributes
type: object
IncidentRuleDataResponse:
properties:
attributes:
$ref: '#/components/schemas/IncidentRuleAttributesResponse'
id:
description: The ID of the rule
example: 612e0c88-9137-4bd2-8de4-9356867d4c6a
type: string
type:
$ref: '#/components/schemas/IncidentRuleType'
required:
- id
- type
- attributes
type: object
IncidentRuleRequest:
properties:
data:
$ref: '#/components/schemas/IncidentRuleDataRequest'
required:
- data
type: object
IncidentRuleResponse:
properties:
data:
$ref: '#/components/schemas/IncidentRuleDataResponse'
required:
- data
type: object
IncidentRuleType:
description: Incident rule resource type
enum:
- incident_rule
example: incident_rule
type: string
x-enum-varnames:
- INCIDENT_RULE
IncidentRulesResponse:
properties:
data:
items:
$ref: '#/components/schemas/IncidentRuleDataResponse'
type: array
required:
- data
type: object
IncidentSearchResponse:
description: Response with incidents and facets.
properties:
Expand Down Expand Up @@ -75865,6 +75951,178 @@ paths:
- incident_notification_settings_write
x-unstable: '**Note**: This endpoint is in Preview.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/incidents/config/rules:
get:
description: Retrieve a list of all incident rules for the organization.
operationId: ListIncidentConfigRules
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/IncidentRulesResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: List incident rules
tags:
- Incidents
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
post:
description: Create a new incident rule for the organization.
operationId: CreateIncidentConfigRule
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/IncidentRuleRequest'
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/IncidentRuleResponse'
description: Created
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Create incident rule
tags:
- Incidents
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/incidents/config/rules/{rule_id}:
delete:
description: Delete an incident rule.
operationId: DeleteIncidentConfigRule
parameters:
- description: The ID of the incident rule
in: path
name: rule_id
required: true
schema:
example: 612e0c88-9137-4bd2-8de4-9356867d4c6a
type: string
responses:
'204':
description: No Content
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Delete incident rule
tags:
- Incidents
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
get:
description: Retrieve details of a specific incident rule.
operationId: GetIncidentConfigRule
parameters:
- description: The ID of the incident rule
in: path
name: rule_id
required: true
schema:
example: 612e0c88-9137-4bd2-8de4-9356867d4c6a
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/IncidentRuleResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get incident rule
tags:
- Incidents
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
patch:
description: Update an existing incident rule.
operationId: UpdateIncidentConfigRule
parameters:
- description: The ID of the incident rule
in: path
name: rule_id
required: true
schema:
example: 612e0c88-9137-4bd2-8de4-9356867d4c6a
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/IncidentRuleRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/IncidentRuleResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Update incident rule
tags:
- Incidents
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/incidents/config/types:
get:
Expand Down
17 changes: 17 additions & 0 deletions examples/v2/incidents/CreateIncidentConfigRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Create incident rule returns "Created" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_incident_config_rule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new

body = DatadogAPIClient::V2::IncidentRuleRequest.new({
data: DatadogAPIClient::V2::IncidentRuleDataRequest.new({
attributes: DatadogAPIClient::V2::IncidentRuleAttributesRequest.new({
name: "High Severity Rule",
}),
type: DatadogAPIClient::V2::IncidentRuleType::INCIDENT_RULE,
}),
})
p api_instance.create_incident_config_rule(body)
8 changes: 8 additions & 0 deletions examples/v2/incidents/DeleteIncidentConfigRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Delete incident rule returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.delete_incident_config_rule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
api_instance.delete_incident_config_rule("612e0c88-9137-4bd2-8de4-9356867d4c6a")
8 changes: 8 additions & 0 deletions examples/v2/incidents/GetIncidentConfigRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get incident rule returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_incident_config_rule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.get_incident_config_rule("612e0c88-9137-4bd2-8de4-9356867d4c6a")
8 changes: 8 additions & 0 deletions examples/v2/incidents/ListIncidentConfigRules.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List incident rules returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_incident_config_rules".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.list_incident_config_rules()
17 changes: 17 additions & 0 deletions examples/v2/incidents/UpdateIncidentConfigRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Update incident rule returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_incident_config_rule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new

body = DatadogAPIClient::V2::IncidentRuleRequest.new({
data: DatadogAPIClient::V2::IncidentRuleDataRequest.new({
attributes: DatadogAPIClient::V2::IncidentRuleAttributesRequest.new({
name: "High Severity Rule",
}),
type: DatadogAPIClient::V2::IncidentRuleType::INCIDENT_RULE,
}),
})
p api_instance.update_incident_config_rule("612e0c88-9137-4bd2-8de4-9356867d4c6a", body)
13 changes: 13 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,19 @@
"include" => "String",
"body" => "PatchIncidentNotificationTemplateRequest",
},
"v2.CreateIncidentConfigRule" => {
"body" => "IncidentRuleRequest",
},
"v2.DeleteIncidentConfigRule" => {
"rule_id" => "String",
},
"v2.GetIncidentConfigRule" => {
"rule_id" => "String",
},
"v2.UpdateIncidentConfigRule" => {
"rule_id" => "String",
"body" => "IncidentRuleRequest",
},
"v2.ListIncidentTypes" => {
"include_deleted" => "Boolean",
},
Expand Down
Loading
Loading