Skip to content

Commit 4093b90

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 073a97f of spec repo
1 parent 559511e commit 4093b90

File tree

13 files changed

+1479
-0
lines changed

13 files changed

+1479
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41880,6 +41880,83 @@ components:
4188041880
type: string
4188141881
x-enum-varnames:
4188241882
- PERMISSIONS
41883+
PostmortemAttachmentRequest:
41884+
properties:
41885+
data:
41886+
$ref: '#/components/schemas/PostmortemAttachmentRequestData'
41887+
required:
41888+
- data
41889+
type: object
41890+
PostmortemAttachmentRequestAttributes:
41891+
description: Postmortem attachment attributes
41892+
properties:
41893+
cells:
41894+
description: The cells of the postmortem
41895+
items:
41896+
$ref: '#/components/schemas/PostmortemCell'
41897+
type: array
41898+
content:
41899+
description: The content of the postmortem
41900+
example: '# Incident Report - IR-123
41901+
41902+
[...]'
41903+
type: string
41904+
postmortem_template_id:
41905+
description: The ID of the postmortem template
41906+
example: 93645509-874e-45c4-adfa-623bfeaead89-123
41907+
type: string
41908+
title:
41909+
description: The title of the postmortem
41910+
example: Postmortem-IR-123
41911+
type: string
41912+
type: object
41913+
PostmortemAttachmentRequestData:
41914+
description: Postmortem attachment data
41915+
properties:
41916+
attributes:
41917+
$ref: '#/components/schemas/PostmortemAttachmentRequestAttributes'
41918+
type:
41919+
$ref: '#/components/schemas/IncidentAttachmentType'
41920+
required:
41921+
- type
41922+
- attributes
41923+
type: object
41924+
PostmortemCell:
41925+
description: A cell in the postmortem
41926+
properties:
41927+
attributes:
41928+
$ref: '#/components/schemas/PostmortemCellAttributes'
41929+
id:
41930+
description: The unique identifier of the cell
41931+
example: cell-1
41932+
type: string
41933+
type:
41934+
$ref: '#/components/schemas/PostmortemCellType'
41935+
type: object
41936+
PostmortemCellAttributes:
41937+
description: Attributes of a postmortem cell
41938+
properties:
41939+
definition:
41940+
$ref: '#/components/schemas/PostmortemCellDefinition'
41941+
type: object
41942+
PostmortemCellDefinition:
41943+
description: Definition of a postmortem cell
41944+
properties:
41945+
content:
41946+
description: The content of the cell in markdown format
41947+
example: '## Incident Summary
41948+
41949+
This incident was caused by...'
41950+
type: string
41951+
type: object
41952+
PostmortemCellType:
41953+
description: The postmortem cell resource type.
41954+
enum:
41955+
- markdown
41956+
example: markdown
41957+
type: string
41958+
x-enum-varnames:
41959+
- MARKDOWN
4188341960
Powerpack:
4188441961
description: Powerpacks are templated groups of dashboard widgets you can save
4188541962
from an existing dashboard and turn into reusable packs in the widget tray.
@@ -71685,6 +71762,46 @@ paths:
7168571762
- incident_write
7168671763
x-unstable: '**Note**: This endpoint is in Preview.
7168771764

71765+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
71766+
/api/v2/incidents/{incident_id}/attachments/postmortems:
71767+
post:
71768+
description: Create a postmortem attachment for an incident.
71769+
operationId: CreateIncidentPostmortemAttachment
71770+
parameters:
71771+
- description: The ID of the incident
71772+
in: path
71773+
name: incident_id
71774+
required: true
71775+
schema:
71776+
example: 00000000-0000-0000-0000-000000000000
71777+
type: string
71778+
requestBody:
71779+
content:
71780+
application/json:
71781+
schema:
71782+
$ref: '#/components/schemas/PostmortemAttachmentRequest'
71783+
required: true
71784+
responses:
71785+
'201':
71786+
content:
71787+
application/json:
71788+
schema:
71789+
$ref: '#/components/schemas/Attachment'
71790+
description: Created
71791+
'400':
71792+
content:
71793+
application/json:
71794+
schema:
71795+
$ref: '#/components/schemas/JSONAPIErrorResponse'
71796+
description: Bad Request
71797+
'429':
71798+
$ref: '#/components/responses/TooManyRequestsResponse'
71799+
summary: Create postmortem attachment
71800+
tags:
71801+
- Incidents
71802+
x-unstable: '**Note**: This endpoint is in public beta and it''s subject to
71803+
change.
71804+
7168871805
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7168971806
/api/v2/incidents/{incident_id}/attachments/{attachment_id}:
7169071807
delete:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Create postmortem attachment 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.Attachment;
7+
import com.datadog.api.client.v2.model.IncidentAttachmentType;
8+
import com.datadog.api.client.v2.model.PostmortemAttachmentRequest;
9+
import com.datadog.api.client.v2.model.PostmortemAttachmentRequestAttributes;
10+
import com.datadog.api.client.v2.model.PostmortemAttachmentRequestData;
11+
import com.datadog.api.client.v2.model.PostmortemCell;
12+
import com.datadog.api.client.v2.model.PostmortemCellAttributes;
13+
import com.datadog.api.client.v2.model.PostmortemCellDefinition;
14+
import com.datadog.api.client.v2.model.PostmortemCellType;
15+
import java.util.Collections;
16+
17+
public class Example {
18+
public static void main(String[] args) {
19+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
20+
defaultClient.setUnstableOperationEnabled("v2.createIncidentPostmortemAttachment", true);
21+
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
22+
23+
PostmortemAttachmentRequest body =
24+
new PostmortemAttachmentRequest()
25+
.data(
26+
new PostmortemAttachmentRequestData()
27+
.attributes(
28+
new PostmortemAttachmentRequestAttributes()
29+
.cells(
30+
Collections.singletonList(
31+
new PostmortemCell()
32+
.attributes(
33+
new PostmortemCellAttributes()
34+
.definition(
35+
new PostmortemCellDefinition()
36+
.content(
37+
"""
38+
## Incident Summary
39+
This incident was caused by...
40+
""")))
41+
.id("cell-1")
42+
.type(PostmortemCellType.MARKDOWN)))
43+
.content("""
44+
# Incident Report - IR-123
45+
[...]
46+
""")
47+
.postmortemTemplateId("93645509-874e-45c4-adfa-623bfeaead89-123")
48+
.title("Postmortem-IR-123"))
49+
.type(IncidentAttachmentType.INCIDENT_ATTACHMENTS));
50+
51+
try {
52+
Attachment result =
53+
apiInstance.createIncidentPostmortemAttachment(
54+
"00000000-0000-0000-0000-000000000000", body);
55+
System.out.println(result);
56+
} catch (ApiException e) {
57+
System.err.println("Exception when calling IncidentsApi#createIncidentPostmortemAttachment");
58+
System.err.println("Status code: " + e.getCode());
59+
System.err.println("Reason: " + e.getResponseBody());
60+
System.err.println("Response headers: " + e.getResponseHeaders());
61+
e.printStackTrace();
62+
}
63+
}
64+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@ public class ApiClient {
820820
put("v2.createIncidentIntegration", false);
821821
put("v2.createIncidentNotificationRule", false);
822822
put("v2.createIncidentNotificationTemplate", false);
823+
put("v2.createIncidentPostmortemAttachment", false);
823824
put("v2.createIncidentTodo", false);
824825
put("v2.createIncidentType", false);
825826
put("v2.deleteIncident", false);

0 commit comments

Comments
 (0)