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
56 changes: 56 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12296,6 +12296,62 @@ datadog\_api\_client.v2.model.incident\_response\_relationships module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_rule\_attributes\_request module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_rule_attributes_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_rule\_attributes\_response module
-------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_rule_attributes_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_rule\_data\_request module
------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_rule_data_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_rule\_data\_response module
-------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_rule_data_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_rule\_request module
------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_rule_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_rule\_response module
-------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_rule_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_rule\_type module
---------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_rule_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_rules\_response module
--------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_rules_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_search\_response module
---------------------------------------------------------------

Expand Down
27 changes: 27 additions & 0 deletions examples/v2/incidents/CreateIncidentConfigRule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
Create incident rule returns "Created" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from datadog_api_client.v2.model.incident_rule_attributes_request import IncidentRuleAttributesRequest
from datadog_api_client.v2.model.incident_rule_data_request import IncidentRuleDataRequest
from datadog_api_client.v2.model.incident_rule_request import IncidentRuleRequest
from datadog_api_client.v2.model.incident_rule_type import IncidentRuleType

body = IncidentRuleRequest(
data=IncidentRuleDataRequest(
attributes=IncidentRuleAttributesRequest(
name="High Severity Rule",
),
type=IncidentRuleType.INCIDENT_RULE,
),
)

configuration = Configuration()
configuration.unstable_operations["create_incident_config_rule"] = True
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
response = api_instance.create_incident_config_rule(body=body)

print(response)
14 changes: 14 additions & 0 deletions examples/v2/incidents/DeleteIncidentConfigRule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Delete incident rule returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["delete_incident_config_rule"] = True
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
api_instance.delete_incident_config_rule(
rule_id="612e0c88-9137-4bd2-8de4-9356867d4c6a",
)
16 changes: 16 additions & 0 deletions examples/v2/incidents/GetIncidentConfigRule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
Get incident rule returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["get_incident_config_rule"] = True
with ApiClient(configuration) as api_client:
api_instance = IncidentsApi(api_client)
response = api_instance.get_incident_config_rule(
rule_id="612e0c88-9137-4bd2-8de4-9356867d4c6a",
)

print(response)
Loading