Skip to content

Commit e0f0839

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update api/v2/incidents/id/attachment endpoints documentation (#3364)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent bc54c5b commit e0f0839

File tree

124 files changed

+1211
-1223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+1211
-1223
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 49 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ components:
178178
required: true
179179
schema:
180180
type: string
181+
AttachmentIDPathParameter:
182+
description: The ID of the attachment.
183+
in: path
184+
name: attachment_id
185+
required: true
186+
schema:
187+
example: 00000000-0000-0000-0000-000000000001
188+
type: string
181189
AttachmentIncludeQueryParameter:
182190
description: 'Resource to include in the response. Supported value: `last_modified_by_user`.'
183191
explode: false
@@ -5340,6 +5348,8 @@ components:
53405348
- project
53415349
type: object
53425350
Attachment:
5351+
description: An attachment response containing the attachment data and related
5352+
objects.
53435353
properties:
53445354
data:
53455355
$ref: '#/components/schemas/AttachmentData'
@@ -5349,22 +5359,9 @@ components:
53495359
type: array
53505360
type: object
53515361
AttachmentArray:
5362+
description: A list of incident attachments.
53525363
properties:
53535364
data:
5354-
example:
5355-
- attributes:
5356-
attachment:
5357-
documentUrl: https://app.datadoghq.com/notebook/123/Postmortem-IR-123
5358-
title: Postmortem IR-123
5359-
attachment_type: postmortem
5360-
modified: '2025-01-01T01:01:01.000000001Z'
5361-
id: 00000000-abcd-0002-0000-000000000000
5362-
relationships:
5363-
last_modified_by_user:
5364-
data:
5365-
id: 00000000-0000-0000-cccc-000000000000
5366-
type: users
5367-
type: incident_attachments
53685365
items:
53695366
$ref: '#/components/schemas/AttachmentData'
53705367
type: array
@@ -5376,24 +5373,12 @@ components:
53765373
- data
53775374
type: object
53785375
AttachmentData:
5379-
example:
5380-
attributes:
5381-
attachment:
5382-
documentUrl: https://app.datadoghq.com/notebook/123/Postmortem-IR-123
5383-
title: Postmortem IR-123
5384-
attachment_type: postmortem
5385-
modified: '2025-01-01T01:01:01.000000001Z'
5386-
id: 00000000-abcd-0002-0000-000000000000
5387-
relationships:
5388-
last_modified_by_user:
5389-
data:
5390-
id: 00000000-0000-0000-cccc-000000000000
5391-
type: users
5392-
type: incident_attachments
5376+
description: Attachment data from a response.
53935377
properties:
53945378
attributes:
53955379
$ref: '#/components/schemas/AttachmentDataAttributes'
53965380
id:
5381+
description: The unique identifier of the attachment.
53975382
example: 00000000-abcd-0002-0000-000000000000
53985383
type: string
53995384
relationships:
@@ -5407,56 +5392,52 @@ components:
54075392
- id
54085393
type: object
54095394
AttachmentDataAttributes:
5395+
description: The attachment's attributes.
54105396
properties:
54115397
attachment:
54125398
$ref: '#/components/schemas/AttachmentDataAttributesAttachment'
54135399
attachment_type:
54145400
$ref: '#/components/schemas/AttachmentDataAttributesAttachmentType'
54155401
modified:
5402+
description: Timestamp when the attachment was last modified.
5403+
example: '2025-01-01T01:01:01.000000001Z'
54165404
format: date-time
54175405
type: string
54185406
type: object
54195407
AttachmentDataAttributesAttachment:
5408+
description: The attachment object.
54205409
properties:
54215410
documentUrl:
5411+
description: The URL of the attachment.
5412+
example: https://app.datadoghq.com/notebook/123/Postmortem-IR-123
54225413
type: string
54235414
title:
5415+
description: The title of the attachment.
5416+
example: Postmortem IR-123
54245417
type: string
54255418
type: object
54265419
AttachmentDataAttributesAttachmentType:
5420+
description: The type of the attachment.
54275421
enum:
54285422
- postmortem
54295423
- link
5424+
example: postmortem
54305425
type: string
54315426
x-enum-varnames:
54325427
- POSTMORTEM
54335428
- LINK
54345429
AttachmentDataRelationships:
5430+
description: The attachment's resource relationships.
54355431
properties:
5432+
incident:
5433+
$ref: '#/components/schemas/RelationshipToIncident'
54365434
last_modified_by_user:
5437-
$ref: '#/components/schemas/AttachmentDataRelationshipsLastModifiedByUser'
5438-
type: object
5439-
AttachmentDataRelationshipsLastModifiedByUser:
5440-
properties:
5441-
data:
5442-
$ref: '#/components/schemas/AttachmentDataRelationshipsLastModifiedByUserData'
5443-
required:
5444-
- data
5445-
type: object
5446-
AttachmentDataRelationshipsLastModifiedByUserData:
5447-
properties:
5448-
id:
5449-
example: ''
5450-
type: string
5451-
type:
5452-
$ref: '#/components/schemas/UserType'
5453-
required:
5454-
- type
5455-
- id
5435+
$ref: '#/components/schemas/RelationshipToUser'
54565436
type: object
54575437
AttachmentIncluded:
5438+
description: Objects related to an attachment.
54585439
oneOf:
5459-
- $ref: '#/components/schemas/User140420082644000'
5440+
- $ref: '#/components/schemas/IncidentUserData'
54605441
AuditLogsEvent:
54615442
description: Object description of an Audit Logs event after it is processed
54625443
and stored by Datadog.
@@ -13143,20 +13124,13 @@ components:
1314313124
- type
1314413125
type: object
1314513126
CreateAttachmentRequest:
13146-
example:
13147-
data:
13148-
attributes:
13149-
attachment:
13150-
documentUrl: https://app.datadoghq.com/notebook/123/Postmortem-IR-123
13151-
title: Postmortem-IR-123
13152-
attachment_type: postmortem
13153-
id: 00000000-0000-0000-0000-000000000000
13154-
type: incident_attachments
13127+
description: Create request for an attachment.
1315513128
properties:
1315613129
data:
1315713130
$ref: '#/components/schemas/CreateAttachmentRequestData'
1315813131
type: object
1315913132
CreateAttachmentRequestData:
13133+
description: Attachment data for a create request.
1316013134
properties:
1316113135
attributes:
1316213136
$ref: '#/components/schemas/CreateAttachmentRequestDataAttributes'
@@ -13168,17 +13142,23 @@ components:
1316813142
- type
1316913143
type: object
1317013144
CreateAttachmentRequestDataAttributes:
13145+
description: The attributes for creating an attachment.
1317113146
properties:
1317213147
attachment:
1317313148
$ref: '#/components/schemas/CreateAttachmentRequestDataAttributesAttachment'
1317413149
attachment_type:
1317513150
$ref: '#/components/schemas/AttachmentDataAttributesAttachmentType'
1317613151
type: object
1317713152
CreateAttachmentRequestDataAttributesAttachment:
13153+
description: The attachment object for creating an attachment.
1317813154
properties:
1317913155
documentUrl:
13156+
description: The URL of the attachment.
13157+
example: https://app.datadoghq.com/notebook/123/Postmortem-IR-123
1318013158
type: string
1318113159
title:
13160+
description: The title of the attachment.
13161+
example: Postmortem-IR-123
1318213162
type: string
1318313163
type: object
1318413164
CreateCaseRequestArray:
@@ -42775,38 +42755,41 @@ components:
4277542755
type: array
4277642756
type: object
4277742757
PatchAttachmentRequest:
42778-
example:
42779-
data:
42780-
attributes:
42781-
attachment:
42782-
documentUrl: https://app.datadoghq.com/notebook/124/Postmortem-IR-124
42783-
title: Postmortem-IR-124
42784-
type: incident_attachments
42758+
description: Request to update an attachment.
4278542759
properties:
4278642760
data:
4278742761
$ref: '#/components/schemas/PatchAttachmentRequestData'
4278842762
type: object
4278942763
PatchAttachmentRequestData:
42764+
description: Attachment data for an update request.
4279042765
properties:
4279142766
attributes:
4279242767
$ref: '#/components/schemas/PatchAttachmentRequestDataAttributes'
4279342768
id:
42769+
description: The unique identifier of the attachment.
42770+
example: 00000000-abcd-0002-0000-000000000000
4279442771
type: string
4279542772
type:
4279642773
$ref: '#/components/schemas/IncidentAttachmentType'
4279742774
required:
4279842775
- type
4279942776
type: object
4280042777
PatchAttachmentRequestDataAttributes:
42778+
description: The attributes for updating an attachment.
4280142779
properties:
4280242780
attachment:
4280342781
$ref: '#/components/schemas/PatchAttachmentRequestDataAttributesAttachment'
4280442782
type: object
4280542783
PatchAttachmentRequestDataAttributesAttachment:
42784+
description: The updated attachment object.
4280642785
properties:
4280742786
documentUrl:
42787+
description: The updated URL for the attachment.
42788+
example: https://app.datadoghq.com/notebook/124/Postmortem-IR-124
4280842789
type: string
4280942790
title:
42791+
description: The updated title for the attachment.
42792+
example: Postmortem-IR-124
4281042793
type: string
4281142794
type: object
4281242795
PatchComponentRequest:
@@ -62229,17 +62212,6 @@ components:
6222962212
type:
6223062213
$ref: '#/components/schemas/UsersType'
6223162214
type: object
62232-
User140420082644000:
62233-
properties:
62234-
attributes:
62235-
$ref: '#/components/schemas/UserAttributes'
62236-
id:
62237-
type: string
62238-
type:
62239-
$ref: '#/components/schemas/UserType'
62240-
required:
62241-
- type
62242-
type: object
6224362215
UserAttributes:
6224462216
description: Attributes of user object returned by the API.
6224562217
properties:
@@ -62690,15 +62662,6 @@ components:
6269062662
meta:
6269162663
$ref: '#/components/schemas/TeamsResponseMeta'
6269262664
type: object
62693-
UserType:
62694-
default: users
62695-
description: Users resource type.
62696-
enum:
62697-
- users
62698-
example: users
62699-
type: string
62700-
x-enum-varnames:
62701-
- USERS
6270262665
UserUpdateAttributes:
6270362666
description: Attributes of the edited user.
6270462667
properties:
@@ -74906,12 +74869,7 @@ paths:
7490674869
operationId: DeleteIncidentAttachment
7490774870
parameters:
7490874871
- $ref: '#/components/parameters/IncidentIDPathParameter'
74909-
- description: The ID of the attachment.
74910-
in: path
74911-
name: attachment_id
74912-
required: true
74913-
schema:
74914-
example: 00000000-0000-0000-0000-000000000002
74872+
- $ref: '#/components/parameters/AttachmentIDPathParameter'
7491574873
responses:
7491674874
'204':
7491774875
description: No Content
@@ -74942,12 +74900,7 @@ paths:
7494274900
operationId: UpdateIncidentAttachment
7494374901
parameters:
7494474902
- $ref: '#/components/parameters/IncidentIDPathParameter'
74945-
- description: The ID of the attachment.
74946-
in: path
74947-
name: attachment_id
74948-
required: true
74949-
schema:
74950-
example: 00000000-0000-0000-0000-000000000002
74903+
- $ref: '#/components/parameters/AttachmentIDPathParameter'
7495174904
- $ref: '#/components/parameters/AttachmentIncludeQueryParameter'
7495274905
requestBody:
7495374906
content:

examples/v2/incidents/CreateIncidentAttachment.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public static void main(String[] args) {
1717
defaultClient.setUnstableOperationEnabled("v2.createIncidentAttachment", true);
1818
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
1919

20+
// there is a valid "incident" in the system
21+
String INCIDENT_DATA_ID = System.getenv("INCIDENT_DATA_ID");
22+
2023
CreateAttachmentRequest body =
2124
new CreateAttachmentRequest()
2225
.data(
@@ -26,14 +29,13 @@ public static void main(String[] args) {
2629
.attachment(
2730
new CreateAttachmentRequestDataAttributesAttachment()
2831
.documentUrl(
29-
"https://app.datadoghq.com/notebook/123/Postmortem-IR-123")
30-
.title("Postmortem-IR-123"))
32+
"https://app.datadoghq.com/notebook/ExampleIncident/Example-Incident")
33+
.title("Example-Incident"))
3134
.attachmentType(AttachmentDataAttributesAttachmentType.POSTMORTEM))
32-
.id("00000000-0000-0000-0000-000000000000")
3335
.type(IncidentAttachmentType.INCIDENT_ATTACHMENTS));
3436

3537
try {
36-
Attachment result = apiInstance.createIncidentAttachment("incident_id", body);
38+
Attachment result = apiInstance.createIncidentAttachment(INCIDENT_DATA_ID, body);
3739
System.out.println(result);
3840
} catch (ApiException e) {
3941
System.err.println("Exception when calling IncidentsApi#createIncidentAttachment");

examples/v2/incidents/DeleteIncidentAttachment.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ public static void main(String[] args) {
1010
defaultClient.setUnstableOperationEnabled("v2.deleteIncidentAttachment", true);
1111
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
1212

13+
// there is a valid "incident" in the system
14+
String INCIDENT_DATA_ID = System.getenv("INCIDENT_DATA_ID");
15+
16+
// there is a valid "incident_attachment" in the system
17+
String INCIDENT_ATTACHMENT_DATA_ID = System.getenv("INCIDENT_ATTACHMENT_DATA_ID");
18+
1319
try {
14-
apiInstance.deleteIncidentAttachment("incident_id", "00000000-0000-0000-0000-000000000002");
20+
apiInstance.deleteIncidentAttachment(INCIDENT_DATA_ID, INCIDENT_ATTACHMENT_DATA_ID);
1521
} catch (ApiException e) {
1622
System.err.println("Exception when calling IncidentsApi#deleteIncidentAttachment");
1723
System.err.println("Status code: " + e.getCode());

examples/v2/incidents/ListIncidentAttachments.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ public static void main(String[] args) {
1111
defaultClient.setUnstableOperationEnabled("v2.listIncidentAttachments", true);
1212
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
1313

14+
// there is a valid "incident" in the system
15+
String INCIDENT_DATA_ID = System.getenv("INCIDENT_DATA_ID");
16+
1417
try {
15-
AttachmentArray result = apiInstance.listIncidentAttachments("incident_id");
18+
AttachmentArray result = apiInstance.listIncidentAttachments(INCIDENT_DATA_ID);
1619
System.out.println(result);
1720
} catch (ApiException e) {
1821
System.err.println("Exception when calling IncidentsApi#listIncidentAttachments");

examples/v2/incidents/UpdateIncidentAttachment.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ public static void main(String[] args) {
1616
defaultClient.setUnstableOperationEnabled("v2.updateIncidentAttachment", true);
1717
IncidentsApi apiInstance = new IncidentsApi(defaultClient);
1818

19+
// there is a valid "incident" in the system
20+
String INCIDENT_DATA_ID = System.getenv("INCIDENT_DATA_ID");
21+
22+
// there is a valid "incident_attachment" in the system
23+
String INCIDENT_ATTACHMENT_DATA_ID = System.getenv("INCIDENT_ATTACHMENT_DATA_ID");
24+
1925
PatchAttachmentRequest body =
2026
new PatchAttachmentRequest()
2127
.data(
@@ -25,14 +31,14 @@ public static void main(String[] args) {
2531
.attachment(
2632
new PatchAttachmentRequestDataAttributesAttachment()
2733
.documentUrl(
28-
"https://app.datadoghq.com/notebook/124/Postmortem-IR-124")
29-
.title("Postmortem-IR-124")))
34+
"https://app.datadoghq.com/notebook/124/Example-Incident")
35+
.title("Example-Incident")))
36+
.id(INCIDENT_ATTACHMENT_DATA_ID)
3037
.type(IncidentAttachmentType.INCIDENT_ATTACHMENTS));
3138

3239
try {
3340
Attachment result =
34-
apiInstance.updateIncidentAttachment(
35-
"incident_id", "00000000-0000-0000-0000-000000000002", body);
41+
apiInstance.updateIncidentAttachment(INCIDENT_DATA_ID, INCIDENT_ATTACHMENT_DATA_ID, body);
3642
System.out.println(result);
3743
} catch (ApiException e) {
3844
System.err.println("Exception when calling IncidentsApi#updateIncidentAttachment");

0 commit comments

Comments
 (0)