Skip to content

Commit 14caa52

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Create OpenAPI for incidents config postmortem templates (#3445)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent efebef5 commit 14caa52

18 files changed

+2613
-17
lines changed

.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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Create postmortem template returns "Created" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.IncidentsApi;
6+
import com.datadog.api.client.v2.model.PostmortemTemplateAttributesRequest;
7+
import com.datadog.api.client.v2.model.PostmortemTemplateDataRequest;
8+
import com.datadog.api.client.v2.model.PostmortemTemplateRequest;
9+
import com.datadog.api.client.v2.model.PostmortemTemplateResponse;
10+
import com.datadog.api.client.v2.model.PostmortemTemplateType;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
defaultClient.setUnstableOperationEnabled("v2.createIncidentPostmortemTemplate", true);
16+
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
17+
18+
PostmortemTemplateRequest body =
19+
new PostmortemTemplateRequest()
20+
.data(
21+
new PostmortemTemplateDataRequest()
22+
.attributes(
23+
new PostmortemTemplateAttributesRequest()
24+
.name("Standard Postmortem Template"))
25+
.type(PostmortemTemplateType.POSTMORTEM_TEMPLATE));
26+
27+
try {
28+
PostmortemTemplateResponse result = apiInstance.createIncidentPostmortemTemplate(body);
29+
System.out.println(result);
30+
} catch (ApiException e) {
31+
System.err.println("Exception when calling IncidentsApi#createIncidentPostmortemTemplate");
32+
System.err.println("Status code: " + e.getCode());
33+
System.err.println("Reason: " + e.getResponseBody());
34+
System.err.println("Response headers: " + e.getResponseHeaders());
35+
e.printStackTrace();
36+
}
37+
}
38+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Delete postmortem template returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.IncidentsApi;
6+
7+
public class Example {
8+
public static void main(String[] args) {
9+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
10+
defaultClient.setUnstableOperationEnabled("v2.deleteIncidentPostmortemTemplate", true);
11+
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
12+
13+
try {
14+
apiInstance.deleteIncidentPostmortemTemplate("template-456");
15+
} catch (ApiException e) {
16+
System.err.println("Exception when calling IncidentsApi#deleteIncidentPostmortemTemplate");
17+
System.err.println("Status code: " + e.getCode());
18+
System.err.println("Reason: " + e.getResponseBody());
19+
System.err.println("Response headers: " + e.getResponseHeaders());
20+
e.printStackTrace();
21+
}
22+
}
23+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get postmortem template returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.IncidentsApi;
6+
import com.datadog.api.client.v2.model.PostmortemTemplateResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getIncidentPostmortemTemplate", true);
12+
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
13+
14+
try {
15+
PostmortemTemplateResponse result = apiInstance.getIncidentPostmortemTemplate("template-456");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling IncidentsApi#getIncidentPostmortemTemplate");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// List postmortem templates returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.IncidentsApi;
6+
import com.datadog.api.client.v2.model.PostmortemTemplatesResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.listIncidentPostmortemTemplates", true);
12+
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
13+
14+
try {
15+
PostmortemTemplatesResponse result = apiInstance.listIncidentPostmortemTemplates();
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling IncidentsApi#listIncidentPostmortemTemplates");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)