Skip to content

Commit 926e725

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Create OpenAPI for incidents config postmortem templates (DataDog#2965)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 3fb40f6 commit 926e725

20 files changed

Lines changed: 1843 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45141,6 +45141,92 @@ components:
4514145141
type: string
4514245142
x-enum-varnames:
4514345143
- MARKDOWN
45144+
PostmortemTemplateAttributesRequest:
45145+
properties:
45146+
name:
45147+
description: The name of the template
45148+
example: Standard Postmortem Template
45149+
type: string
45150+
required:
45151+
- name
45152+
type: object
45153+
PostmortemTemplateAttributesResponse:
45154+
properties:
45155+
createdAt:
45156+
description: When the template was created
45157+
example: '2026-01-13T17:15:53.208340Z'
45158+
format: date-time
45159+
type: string
45160+
modifiedAt:
45161+
description: When the template was last modified
45162+
example: '2026-01-13T17:15:53.208340Z'
45163+
format: date-time
45164+
type: string
45165+
name:
45166+
description: The name of the template
45167+
example: Standard Postmortem Template
45168+
type: string
45169+
required:
45170+
- name
45171+
- createdAt
45172+
- modifiedAt
45173+
type: object
45174+
PostmortemTemplateDataRequest:
45175+
properties:
45176+
attributes:
45177+
$ref: '#/components/schemas/PostmortemTemplateAttributesRequest'
45178+
type:
45179+
$ref: '#/components/schemas/PostmortemTemplateType'
45180+
required:
45181+
- type
45182+
- attributes
45183+
type: object
45184+
PostmortemTemplateDataResponse:
45185+
properties:
45186+
attributes:
45187+
$ref: '#/components/schemas/PostmortemTemplateAttributesResponse'
45188+
id:
45189+
description: The ID of the template
45190+
example: template-456
45191+
type: string
45192+
type:
45193+
$ref: '#/components/schemas/PostmortemTemplateType'
45194+
required:
45195+
- id
45196+
- type
45197+
- attributes
45198+
type: object
45199+
PostmortemTemplateRequest:
45200+
properties:
45201+
data:
45202+
$ref: '#/components/schemas/PostmortemTemplateDataRequest'
45203+
required:
45204+
- data
45205+
type: object
45206+
PostmortemTemplateResponse:
45207+
properties:
45208+
data:
45209+
$ref: '#/components/schemas/PostmortemTemplateDataResponse'
45210+
required:
45211+
- data
45212+
type: object
45213+
PostmortemTemplateType:
45214+
description: Postmortem template resource type
45215+
enum:
45216+
- postmortem_template
45217+
example: postmortem_template
45218+
type: string
45219+
x-enum-varnames:
45220+
- POSTMORTEM_TEMPLATE
45221+
PostmortemTemplatesResponse:
45222+
properties:
45223+
data:
45224+
items:
45225+
$ref: '#/components/schemas/PostmortemTemplateDataResponse'
45226+
type: array
45227+
required:
45228+
- data
45229+
type: object
4514445230
Powerpack:
4514545231
description: Powerpacks are templated groups of dashboard widgets you can save
4514645232
from an existing dashboard and turn into reusable packs in the widget tray.
@@ -78136,6 +78222,184 @@ paths:
7813678222
- incident_notification_settings_write
7813778223
x-unstable: '**Note**: This endpoint is in Preview.
7813878224

78225+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
78226+
/api/v2/incidents/config/postmortem-templates:
78227+
get:
78228+
description: Retrieve a list of all postmortem templates for incidents.
78229+
operationId: ListIncidentPostmortemTemplates
78230+
responses:
78231+
'200':
78232+
content:
78233+
application/json:
78234+
schema:
78235+
$ref: '#/components/schemas/PostmortemTemplatesResponse'
78236+
description: OK
78237+
'400':
78238+
content:
78239+
application/json:
78240+
schema:
78241+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78242+
description: Bad Request
78243+
'429':
78244+
$ref: '#/components/responses/TooManyRequestsResponse'
78245+
summary: List postmortem templates
78246+
tags:
78247+
- Incidents
78248+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
78249+
78250+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
78251+
post:
78252+
description: Create a new postmortem template for incidents.
78253+
operationId: CreateIncidentPostmortemTemplate
78254+
requestBody:
78255+
content:
78256+
application/json:
78257+
schema:
78258+
$ref: '#/components/schemas/PostmortemTemplateRequest'
78259+
required: true
78260+
responses:
78261+
'201':
78262+
content:
78263+
application/json:
78264+
schema:
78265+
$ref: '#/components/schemas/PostmortemTemplateResponse'
78266+
description: Created
78267+
'400':
78268+
content:
78269+
application/json:
78270+
schema:
78271+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78272+
description: Bad Request
78273+
'403':
78274+
content:
78275+
application/json:
78276+
schema:
78277+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78278+
description: Forbidden
78279+
'429':
78280+
$ref: '#/components/responses/TooManyRequestsResponse'
78281+
summary: Create postmortem template
78282+
tags:
78283+
- Incidents
78284+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
78285+
78286+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
78287+
/api/v2/incidents/config/postmortem-templates/{template_id}:
78288+
delete:
78289+
description: Delete a postmortem template.
78290+
operationId: DeleteIncidentPostmortemTemplate
78291+
parameters:
78292+
- description: The ID of the postmortem template
78293+
in: path
78294+
name: template_id
78295+
required: true
78296+
schema:
78297+
example: template-456
78298+
type: string
78299+
responses:
78300+
'204':
78301+
description: No Content
78302+
'400':
78303+
content:
78304+
application/json:
78305+
schema:
78306+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78307+
description: Bad Request
78308+
'404':
78309+
content:
78310+
application/json:
78311+
schema:
78312+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78313+
description: Not Found
78314+
'429':
78315+
$ref: '#/components/responses/TooManyRequestsResponse'
78316+
summary: Delete postmortem template
78317+
tags:
78318+
- Incidents
78319+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
78320+
78321+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
78322+
get:
78323+
description: Retrieve details of a specific postmortem template.
78324+
operationId: GetIncidentPostmortemTemplate
78325+
parameters:
78326+
- description: The ID of the postmortem template
78327+
in: path
78328+
name: template_id
78329+
required: true
78330+
schema:
78331+
example: template-456
78332+
type: string
78333+
responses:
78334+
'200':
78335+
content:
78336+
application/json:
78337+
schema:
78338+
$ref: '#/components/schemas/PostmortemTemplateResponse'
78339+
description: OK
78340+
'400':
78341+
content:
78342+
application/json:
78343+
schema:
78344+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78345+
description: Bad Request
78346+
'404':
78347+
content:
78348+
application/json:
78349+
schema:
78350+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78351+
description: Not Found
78352+
'429':
78353+
$ref: '#/components/responses/TooManyRequestsResponse'
78354+
summary: Get postmortem template
78355+
tags:
78356+
- Incidents
78357+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
78358+
78359+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
78360+
patch:
78361+
description: Update an existing postmortem template.
78362+
operationId: UpdateIncidentPostmortemTemplate
78363+
parameters:
78364+
- description: The ID of the postmortem template
78365+
in: path
78366+
name: template_id
78367+
required: true
78368+
schema:
78369+
example: template-456
78370+
type: string
78371+
requestBody:
78372+
content:
78373+
application/json:
78374+
schema:
78375+
$ref: '#/components/schemas/PostmortemTemplateRequest'
78376+
required: true
78377+
responses:
78378+
'200':
78379+
content:
78380+
application/json:
78381+
schema:
78382+
$ref: '#/components/schemas/PostmortemTemplateResponse'
78383+
description: OK
78384+
'400':
78385+
content:
78386+
application/json:
78387+
schema:
78388+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78389+
description: Bad Request
78390+
'404':
78391+
content:
78392+
application/json:
78393+
schema:
78394+
$ref: '#/components/schemas/JSONAPIErrorResponse'
78395+
description: Not Found
78396+
'429':
78397+
$ref: '#/components/responses/TooManyRequestsResponse'
78398+
summary: Update postmortem template
78399+
tags:
78400+
- Incidents
78401+
x-unstable: '**Note**: This endpoint is in preview and is subject to change.
78402+
7813978403
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7814078404
/api/v2/incidents/config/types:
7814178405
get:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Create postmortem template returns "Created" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_incident_postmortem_template".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8+
9+
body = DatadogAPIClient::V2::PostmortemTemplateRequest.new({
10+
data: DatadogAPIClient::V2::PostmortemTemplateDataRequest.new({
11+
attributes: DatadogAPIClient::V2::PostmortemTemplateAttributesRequest.new({
12+
name: "Standard Postmortem Template",
13+
}),
14+
type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATE,
15+
}),
16+
})
17+
p api_instance.create_incident_postmortem_template(body)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Delete postmortem template returns "No Content" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.delete_incident_postmortem_template".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8+
api_instance.delete_incident_postmortem_template("template-456")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get postmortem template returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_incident_postmortem_template".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8+
p api_instance.get_incident_postmortem_template("template-456")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List postmortem templates returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_incident_postmortem_templates".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8+
p api_instance.list_incident_postmortem_templates()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Update postmortem template returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.update_incident_postmortem_template".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
8+
9+
body = DatadogAPIClient::V2::PostmortemTemplateRequest.new({
10+
data: DatadogAPIClient::V2::PostmortemTemplateDataRequest.new({
11+
attributes: DatadogAPIClient::V2::PostmortemTemplateAttributesRequest.new({
12+
name: "Standard Postmortem Template",
13+
}),
14+
type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATE,
15+
}),
16+
})
17+
p api_instance.update_incident_postmortem_template("template-456", body)

features/scenarios_model_mapping.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,19 @@
21512151
"include" => "String",
21522152
"body" => "PatchIncidentNotificationTemplateRequest",
21532153
},
2154+
"v2.CreateIncidentPostmortemTemplate" => {
2155+
"body" => "PostmortemTemplateRequest",
2156+
},
2157+
"v2.DeleteIncidentPostmortemTemplate" => {
2158+
"template_id" => "String",
2159+
},
2160+
"v2.GetIncidentPostmortemTemplate" => {
2161+
"template_id" => "String",
2162+
},
2163+
"v2.UpdateIncidentPostmortemTemplate" => {
2164+
"template_id" => "String",
2165+
"body" => "PostmortemTemplateRequest",
2166+
},
21542167
"v2.ListIncidentTypes" => {
21552168
"include_deleted" => "Boolean",
21562169
},

0 commit comments

Comments
 (0)