Skip to content

Commit 919d2e5

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a1b9ec2 of spec repo
1 parent 87ede98 commit 919d2e5

20 files changed

Lines changed: 1105 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29123,6 +29123,92 @@ components:
2912329123
user_defined_fields:
2912429124
$ref: '#/components/schemas/RelationshipToIncidentUserDefinedFields'
2912529125
type: object
29126+
IncidentRuleAttributesRequest:
29127+
properties:
29128+
name:
29129+
description: The name of the rule.
29130+
example: High Severity Rule
29131+
type: string
29132+
required:
29133+
- name
29134+
type: object
29135+
IncidentRuleAttributesResponse:
29136+
properties:
29137+
createdAt:
29138+
description: When the rule was created.
29139+
example: '2026-01-13T17:15:53.208340Z'
29140+
format: date-time
29141+
type: string
29142+
modifiedAt:
29143+
description: When the rule was last modified.
29144+
example: '2026-01-13T17:15:53.208340Z'
29145+
format: date-time
29146+
type: string
29147+
name:
29148+
description: The name of the rule.
29149+
example: High Severity Rule
29150+
type: string
29151+
required:
29152+
- name
29153+
- createdAt
29154+
- modifiedAt
29155+
type: object
29156+
IncidentRuleDataRequest:
29157+
properties:
29158+
attributes:
29159+
$ref: '#/components/schemas/IncidentRuleAttributesRequest'
29160+
type:
29161+
$ref: '#/components/schemas/IncidentRuleType'
29162+
required:
29163+
- type
29164+
- attributes
29165+
type: object
29166+
IncidentRuleDataResponse:
29167+
properties:
29168+
attributes:
29169+
$ref: '#/components/schemas/IncidentRuleAttributesResponse'
29170+
id:
29171+
description: The ID of the rule.
29172+
example: 612e0c88-9137-4bd2-8de4-9356867d4c6a
29173+
type: string
29174+
type:
29175+
$ref: '#/components/schemas/IncidentRuleType'
29176+
required:
29177+
- id
29178+
- type
29179+
- attributes
29180+
type: object
29181+
IncidentRuleRequest:
29182+
properties:
29183+
data:
29184+
$ref: '#/components/schemas/IncidentRuleDataRequest'
29185+
required:
29186+
- data
29187+
type: object
29188+
IncidentRuleResponse:
29189+
properties:
29190+
data:
29191+
$ref: '#/components/schemas/IncidentRuleDataResponse'
29192+
required:
29193+
- data
29194+
type: object
29195+
IncidentRuleType:
29196+
description: Incident rule resource type.
29197+
enum:
29198+
- incident_rule
29199+
example: incident_rule
29200+
type: string
29201+
x-enum-varnames:
29202+
- INCIDENT_RULE
29203+
IncidentRulesResponse:
29204+
properties:
29205+
data:
29206+
items:
29207+
$ref: '#/components/schemas/IncidentRuleDataResponse'
29208+
type: array
29209+
required:
29210+
- data
29211+
type: object
2912629212
IncidentSearchResponse:
2912729213
description: Response with incidents and facets.
2912829214
properties:
@@ -75908,6 +75994,178 @@ paths:
7590875994
- incident_notification_settings_write
7590975995
x-unstable: '**Note**: This endpoint is in Preview.
7591075996

75997+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
75998+
/api/v2/incidents/config/rules:
75999+
get:
76000+
description: Retrieve a list of all incident rules for the organization.
76001+
operationId: ListIncidentConfigRules
76002+
responses:
76003+
'200':
76004+
content:
76005+
application/json:
76006+
schema:
76007+
$ref: '#/components/schemas/IncidentRulesResponse'
76008+
description: OK
76009+
'400':
76010+
content:
76011+
application/json:
76012+
schema:
76013+
$ref: '#/components/schemas/JSONAPIErrorResponse'
76014+
description: Bad Request
76015+
'429':
76016+
$ref: '#/components/responses/TooManyRequestsResponse'
76017+
summary: List incident rules
76018+
tags:
76019+
- Incidents
76020+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
76021+
76022+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
76023+
post:
76024+
description: Create a new incident rule for the organization.
76025+
operationId: CreateIncidentConfigRule
76026+
requestBody:
76027+
content:
76028+
application/json:
76029+
schema:
76030+
$ref: '#/components/schemas/IncidentRuleRequest'
76031+
required: true
76032+
responses:
76033+
'201':
76034+
content:
76035+
application/json:
76036+
schema:
76037+
$ref: '#/components/schemas/IncidentRuleResponse'
76038+
description: Created
76039+
'400':
76040+
content:
76041+
application/json:
76042+
schema:
76043+
$ref: '#/components/schemas/JSONAPIErrorResponse'
76044+
description: Bad Request
76045+
'429':
76046+
$ref: '#/components/responses/TooManyRequestsResponse'
76047+
summary: Create incident rule
76048+
tags:
76049+
- Incidents
76050+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
76051+
76052+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
76053+
/api/v2/incidents/config/rules/{rule_id}:
76054+
delete:
76055+
description: Delete an incident rule.
76056+
operationId: DeleteIncidentConfigRule
76057+
parameters:
76058+
- description: The ID of the incident rule.
76059+
in: path
76060+
name: rule_id
76061+
required: true
76062+
schema:
76063+
example: 612e0c88-9137-4bd2-8de4-9356867d4c6a
76064+
type: string
76065+
responses:
76066+
'204':
76067+
description: No Content
76068+
'400':
76069+
content:
76070+
application/json:
76071+
schema:
76072+
$ref: '#/components/schemas/JSONAPIErrorResponse'
76073+
description: Bad Request
76074+
'404':
76075+
content:
76076+
application/json:
76077+
schema:
76078+
$ref: '#/components/schemas/JSONAPIErrorResponse'
76079+
description: Not Found
76080+
'429':
76081+
$ref: '#/components/responses/TooManyRequestsResponse'
76082+
summary: Delete incident rule
76083+
tags:
76084+
- Incidents
76085+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
76086+
76087+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
76088+
get:
76089+
description: Retrieve details of a specific incident rule.
76090+
operationId: GetIncidentConfigRule
76091+
parameters:
76092+
- description: The ID of the incident rule.
76093+
in: path
76094+
name: rule_id
76095+
required: true
76096+
schema:
76097+
example: 612e0c88-9137-4bd2-8de4-9356867d4c6a
76098+
type: string
76099+
responses:
76100+
'200':
76101+
content:
76102+
application/json:
76103+
schema:
76104+
$ref: '#/components/schemas/IncidentRuleResponse'
76105+
description: OK
76106+
'400':
76107+
content:
76108+
application/json:
76109+
schema:
76110+
$ref: '#/components/schemas/JSONAPIErrorResponse'
76111+
description: Bad Request
76112+
'404':
76113+
content:
76114+
application/json:
76115+
schema:
76116+
$ref: '#/components/schemas/JSONAPIErrorResponse'
76117+
description: Not Found
76118+
'429':
76119+
$ref: '#/components/responses/TooManyRequestsResponse'
76120+
summary: Get incident rule
76121+
tags:
76122+
- Incidents
76123+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
76124+
76125+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
76126+
patch:
76127+
description: Update an existing incident rule.
76128+
operationId: UpdateIncidentConfigRule
76129+
parameters:
76130+
- description: The ID of the incident rule.
76131+
in: path
76132+
name: rule_id
76133+
required: true
76134+
schema:
76135+
example: 612e0c88-9137-4bd2-8de4-9356867d4c6a
76136+
type: string
76137+
requestBody:
76138+
content:
76139+
application/json:
76140+
schema:
76141+
$ref: '#/components/schemas/IncidentRuleRequest'
76142+
required: true
76143+
responses:
76144+
'200':
76145+
content:
76146+
application/json:
76147+
schema:
76148+
$ref: '#/components/schemas/IncidentRuleResponse'
76149+
description: OK
76150+
'400':
76151+
content:
76152+
application/json:
76153+
schema:
76154+
$ref: '#/components/schemas/JSONAPIErrorResponse'
76155+
description: Bad Request
76156+
'404':
76157+
content:
76158+
application/json:
76159+
schema:
76160+
$ref: '#/components/schemas/JSONAPIErrorResponse'
76161+
description: Not Found
76162+
'429':
76163+
$ref: '#/components/responses/TooManyRequestsResponse'
76164+
summary: Update incident rule
76165+
tags:
76166+
- Incidents
76167+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
76168+
7591176169
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7591276170
/api/v2/incidents/config/types:
7591376171
get:

docs/datadog_api_client.v2.model.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12296,6 +12296,62 @@ datadog\_api\_client.v2.model.incident\_response\_relationships module
1229612296
:members:
1229712297
:show-inheritance:
1229812298

12299+
datadog\_api\_client.v2.model.incident\_rule\_attributes\_request module
12300+
------------------------------------------------------------------------
12301+
12302+
.. automodule:: datadog_api_client.v2.model.incident_rule_attributes_request
12303+
:members:
12304+
:show-inheritance:
12305+
12306+
datadog\_api\_client.v2.model.incident\_rule\_attributes\_response module
12307+
-------------------------------------------------------------------------
12308+
12309+
.. automodule:: datadog_api_client.v2.model.incident_rule_attributes_response
12310+
:members:
12311+
:show-inheritance:
12312+
12313+
datadog\_api\_client.v2.model.incident\_rule\_data\_request module
12314+
------------------------------------------------------------------
12315+
12316+
.. automodule:: datadog_api_client.v2.model.incident_rule_data_request
12317+
:members:
12318+
:show-inheritance:
12319+
12320+
datadog\_api\_client.v2.model.incident\_rule\_data\_response module
12321+
-------------------------------------------------------------------
12322+
12323+
.. automodule:: datadog_api_client.v2.model.incident_rule_data_response
12324+
:members:
12325+
:show-inheritance:
12326+
12327+
datadog\_api\_client.v2.model.incident\_rule\_request module
12328+
------------------------------------------------------------
12329+
12330+
.. automodule:: datadog_api_client.v2.model.incident_rule_request
12331+
:members:
12332+
:show-inheritance:
12333+
12334+
datadog\_api\_client.v2.model.incident\_rule\_response module
12335+
-------------------------------------------------------------
12336+
12337+
.. automodule:: datadog_api_client.v2.model.incident_rule_response
12338+
:members:
12339+
:show-inheritance:
12340+
12341+
datadog\_api\_client.v2.model.incident\_rule\_type module
12342+
---------------------------------------------------------
12343+
12344+
.. automodule:: datadog_api_client.v2.model.incident_rule_type
12345+
:members:
12346+
:show-inheritance:
12347+
12348+
datadog\_api\_client.v2.model.incident\_rules\_response module
12349+
--------------------------------------------------------------
12350+
12351+
.. automodule:: datadog_api_client.v2.model.incident_rules_response
12352+
:members:
12353+
:show-inheritance:
12354+
1229912355
datadog\_api\_client.v2.model.incident\_search\_response module
1230012356
---------------------------------------------------------------
1230112357

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
Create incident rule returns "Created" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.incidents_api import IncidentsApi
7+
from datadog_api_client.v2.model.incident_rule_attributes_request import IncidentRuleAttributesRequest
8+
from datadog_api_client.v2.model.incident_rule_data_request import IncidentRuleDataRequest
9+
from datadog_api_client.v2.model.incident_rule_request import IncidentRuleRequest
10+
from datadog_api_client.v2.model.incident_rule_type import IncidentRuleType
11+
12+
body = IncidentRuleRequest(
13+
data=IncidentRuleDataRequest(
14+
attributes=IncidentRuleAttributesRequest(
15+
name="High Severity Rule",
16+
),
17+
type=IncidentRuleType.INCIDENT_RULE,
18+
),
19+
)
20+
21+
configuration = Configuration()
22+
configuration.unstable_operations["create_incident_config_rule"] = True
23+
with ApiClient(configuration) as api_client:
24+
api_instance = IncidentsApi(api_client)
25+
response = api_instance.create_incident_config_rule(body=body)
26+
27+
print(response)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
Delete incident rule returns "No Content" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.incidents_api import IncidentsApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["delete_incident_config_rule"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = IncidentsApi(api_client)
12+
api_instance.delete_incident_config_rule(
13+
rule_id="612e0c88-9137-4bd2-8de4-9356867d4c6a",
14+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Get incident rule returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.incidents_api import IncidentsApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["get_incident_config_rule"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = IncidentsApi(api_client)
12+
response = api_instance.get_incident_config_rule(
13+
rule_id="612e0c88-9137-4bd2-8de4-9356867d4c6a",
14+
)
15+
16+
print(response)

0 commit comments

Comments
 (0)