Skip to content

Commit ab9fc35

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

File tree

127 files changed

+1047
-846
lines changed

Some content is hidden

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

127 files changed

+1047
-846
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:

docs/datadog_api_client.v2.model.rst

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,20 +1320,6 @@ datadog\_api\_client.v2.model.attachment\_data\_relationships module
13201320
:members:
13211321
:show-inheritance:
13221322

1323-
datadog\_api\_client.v2.model.attachment\_data\_relationships\_last\_modified\_by\_user module
1324-
----------------------------------------------------------------------------------------------
1325-
1326-
.. automodule:: datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user
1327-
:members:
1328-
:show-inheritance:
1329-
1330-
datadog\_api\_client.v2.model.attachment\_data\_relationships\_last\_modified\_by\_user\_data module
1331-
----------------------------------------------------------------------------------------------------
1332-
1333-
.. automodule:: datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user_data
1334-
:members:
1335-
:show-inheritance:
1336-
13371323
datadog\_api\_client.v2.model.attachment\_included module
13381324
---------------------------------------------------------
13391325

@@ -27437,13 +27423,6 @@ datadog\_api\_client.v2.model.user module
2743727423
:members:
2743827424
:show-inheritance:
2743927425

27440-
datadog\_api\_client.v2.model.user140420082644000 module
27441-
--------------------------------------------------------
27442-
27443-
.. automodule:: datadog_api_client.v2.model.user140420082644000
27444-
:members:
27445-
:show-inheritance:
27446-
2744727426
datadog\_api\_client.v2.model.user\_attributes module
2744827427
-----------------------------------------------------
2744927428

@@ -27710,13 +27689,6 @@ datadog\_api\_client.v2.model.user\_teams\_response module
2771027689
:members:
2771127690
:show-inheritance:
2771227691

27713-
datadog\_api\_client.v2.model.user\_type module
27714-
-----------------------------------------------
27715-
27716-
.. automodule:: datadog_api_client.v2.model.user_type
27717-
:members:
27718-
:show-inheritance:
27719-
2772027692
datadog\_api\_client.v2.model.user\_update\_attributes module
2772127693
-------------------------------------------------------------
2772227694

examples/v2/incidents/CreateIncidentAttachment.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Create incident attachment returns "Created" response
33
"""
44

5+
from os import environ
56
from datadog_api_client import ApiClient, Configuration
67
from datadog_api_client.v2.api.incidents_api import IncidentsApi
78
from datadog_api_client.v2.model.attachment_data_attributes_attachment_type import (
@@ -15,16 +16,18 @@
1516
)
1617
from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType
1718

19+
# there is a valid "incident" in the system
20+
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]
21+
1822
body = CreateAttachmentRequest(
1923
data=CreateAttachmentRequestData(
2024
attributes=CreateAttachmentRequestDataAttributes(
2125
attachment=CreateAttachmentRequestDataAttributesAttachment(
22-
document_url="https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
23-
title="Postmortem-IR-123",
26+
document_url="https://app.datadoghq.com/notebook/ExampleIncident/Example-Incident",
27+
title="Example-Incident",
2428
),
2529
attachment_type=AttachmentDataAttributesAttachmentType.POSTMORTEM,
2630
),
27-
id="00000000-0000-0000-0000-000000000000",
2831
type=IncidentAttachmentType.INCIDENT_ATTACHMENTS,
2932
),
3033
)
@@ -33,6 +36,6 @@
3336
configuration.unstable_operations["create_incident_attachment"] = True
3437
with ApiClient(configuration) as api_client:
3538
api_instance = IncidentsApi(api_client)
36-
response = api_instance.create_incident_attachment(incident_id="incident_id", body=body)
39+
response = api_instance.create_incident_attachment(incident_id=INCIDENT_DATA_ID, body=body)
3740

3841
print(response)

0 commit comments

Comments
 (0)