Skip to content

Commit 20730bb

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add missing incident attachments documentation (#3280)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 4f580d0 commit 20730bb

17 files changed

Lines changed: 890 additions & 0 deletions

.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:

features/v2/incidents.feature

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,24 @@ Feature: Incidents
253253
When the request is sent
254254
Then the response status is 404 Not Found
255255

256+
@generated @skip @team:DataDog/incident-app
257+
Scenario: Create postmortem attachment returns "Bad Request" response
258+
Given operation "CreateIncidentPostmortemAttachment" enabled
259+
And new "CreateIncidentPostmortemAttachment" request
260+
And request contains "incident_id" parameter from "REPLACE.ME"
261+
And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"content": "## Incident Summary\nThis incident was caused by..."}}, "id": "cell-1", "type": "markdown"}], "content": "# Incident Report - IR-123\n[...]", "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123", "title": "Postmortem-IR-123"}, "type": "incident_attachments"}}
262+
When the request is sent
263+
Then the response status is 400 Bad Request
264+
265+
@generated @skip @team:DataDog/incident-app
266+
Scenario: Create postmortem attachment returns "Created" response
267+
Given operation "CreateIncidentPostmortemAttachment" enabled
268+
And new "CreateIncidentPostmortemAttachment" request
269+
And request contains "incident_id" parameter from "REPLACE.ME"
270+
And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"content": "## Incident Summary\nThis incident was caused by..."}}, "id": "cell-1", "type": "markdown"}], "content": "# Incident Report - IR-123\n[...]", "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123", "title": "Postmortem-IR-123"}, "type": "incident_attachments"}}
271+
When the request is sent
272+
Then the response status is 201 Created
273+
256274
@generated @skip @team:Datadog/incident-app
257275
Scenario: Delete a notification template returns "Bad Request" response
258276
Given operation "DeleteIncidentNotificationTemplate" enabled

features/v2/undo.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,14 @@
17341734
"type": "unsafe"
17351735
}
17361736
},
1737+
"CreateIncidentPostmortemAttachment": {
1738+
"tag": "Incidents",
1739+
"undo": {
1740+
"operationId": "TODO",
1741+
"parameters": [],
1742+
"type": "unsafe"
1743+
}
1744+
},
17371745
"DeleteIncidentAttachment": {
17381746
"tag": "Incidents",
17391747
"undo": {

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6088,6 +6088,17 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
60886088
},
60896089
operationResponseType: "Attachment",
60906090
},
6091+
"IncidentsApi.V2.CreateIncidentPostmortemAttachment": {
6092+
incidentId: {
6093+
type: "string",
6094+
format: "",
6095+
},
6096+
body: {
6097+
type: "PostmortemAttachmentRequest",
6098+
format: "",
6099+
},
6100+
operationResponseType: "Attachment",
6101+
},
60916102
"IncidentsApi.V2.DeleteIncidentAttachment": {
60926103
incidentId: {
60936104
type: "string",

0 commit comments

Comments
 (0)