Skip to content

Commit 2670d6a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Create OpenAPI for incidents config global endpoints (#3318)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent aca990d commit 2670d6a

28 files changed

Lines changed: 2754 additions & 135 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 438 additions & 0 deletions
Large diffs are not rendered by default.

features/v2/incidents.feature

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,22 @@ Feature: Incidents
186186
When the request is sent
187187
Then the response status is 404 Not Found
188188

189+
@generated @skip @team:DataDog/incident-app
190+
Scenario: Create global incident handle returns "Bad Request" response
191+
Given operation "CreateGlobalIncidentHandle" enabled
192+
And new "CreateGlobalIncidentHandle" request
193+
And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}}
194+
When the request is sent
195+
Then the response status is 400 Bad Request
196+
197+
@generated @skip @team:DataDog/incident-app
198+
Scenario: Create global incident handle returns "Created" response
199+
Given operation "CreateGlobalIncidentHandle" enabled
200+
And new "CreateGlobalIncidentHandle" request
201+
And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}}
202+
When the request is sent
203+
Then the response status is 201 Created
204+
189205
@skip @team:DataDog/incident-app
190206
Scenario: Create incident attachment returns "Bad Request" response
191207
Given operation "CreateIncidentAttachment" enabled
@@ -450,6 +466,20 @@ Feature: Incidents
450466
When the request is sent
451467
Then the response status is 204 OK
452468

469+
@generated @skip @team:DataDog/incident-app
470+
Scenario: Delete global incident handle returns "Bad Request" response
471+
Given operation "DeleteGlobalIncidentHandle" enabled
472+
And new "DeleteGlobalIncidentHandle" request
473+
When the request is sent
474+
Then the response status is 400 Bad Request
475+
476+
@generated @skip @team:DataDog/incident-app
477+
Scenario: Delete global incident handle returns "No Content" response
478+
Given operation "DeleteGlobalIncidentHandle" enabled
479+
And new "DeleteGlobalIncidentHandle" request
480+
When the request is sent
481+
Then the response status is 204 No Content
482+
453483
@skip @team:DataDog/incident-app
454484
Scenario: Delete incident attachment returns "Bad Request" response
455485
Given operation "DeleteIncidentAttachment" enabled
@@ -633,6 +663,20 @@ Feature: Incidents
633663
When the request is sent
634664
Then the response status is 200 OK
635665

666+
@generated @skip @team:DataDog/incident-app
667+
Scenario: Get global incident settings returns "Bad Request" response
668+
Given operation "GetGlobalIncidentSettings" enabled
669+
And new "GetGlobalIncidentSettings" request
670+
When the request is sent
671+
Then the response status is 400 Bad Request
672+
673+
@generated @skip @team:DataDog/incident-app
674+
Scenario: Get global incident settings returns "OK" response
675+
Given operation "GetGlobalIncidentSettings" enabled
676+
And new "GetGlobalIncidentSettings" request
677+
When the request is sent
678+
Then the response status is 200 OK
679+
636680
@generated @skip @team:DataDog/incident-app
637681
Scenario: Get incident integration metadata details returns "Bad Request" response
638682
Given operation "GetIncidentIntegration" enabled
@@ -816,6 +860,20 @@ Feature: Incidents
816860
When the request is sent
817861
Then the response status is 200 OK
818862

863+
@generated @skip @team:DataDog/incident-app
864+
Scenario: List global incident handles returns "Bad Request" response
865+
Given operation "ListGlobalIncidentHandles" enabled
866+
And new "ListGlobalIncidentHandles" request
867+
When the request is sent
868+
Then the response status is 400 Bad Request
869+
870+
@generated @skip @team:DataDog/incident-app
871+
Scenario: List global incident handles returns "OK" response
872+
Given operation "ListGlobalIncidentHandles" enabled
873+
And new "ListGlobalIncidentHandles" request
874+
When the request is sent
875+
Then the response status is 200 OK
876+
819877
@skip @team:DataDog/incident-app
820878
Scenario: List incident attachments returns "Bad Request" response
821879
Given operation "ListIncidentAttachments" enabled
@@ -1081,6 +1139,38 @@ Feature: Incidents
10811139
When the request is sent
10821140
Then the response status is 200 OK
10831141

1142+
@generated @skip @team:DataDog/incident-app
1143+
Scenario: Update global incident handle returns "Bad Request" response
1144+
Given operation "UpdateGlobalIncidentHandle" enabled
1145+
And new "UpdateGlobalIncidentHandle" request
1146+
And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}}
1147+
When the request is sent
1148+
Then the response status is 400 Bad Request
1149+
1150+
@generated @skip @team:DataDog/incident-app
1151+
Scenario: Update global incident handle returns "OK" response
1152+
Given operation "UpdateGlobalIncidentHandle" enabled
1153+
And new "UpdateGlobalIncidentHandle" request
1154+
And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}}
1155+
When the request is sent
1156+
Then the response status is 200 OK
1157+
1158+
@generated @skip @team:DataDog/incident-app
1159+
Scenario: Update global incident settings returns "Bad Request" response
1160+
Given operation "UpdateGlobalIncidentSettings" enabled
1161+
And new "UpdateGlobalIncidentSettings" request
1162+
And body with value {"data": {"attributes": {"analytics_dashboard_id": "abc-123-def"}, "type": "incidents_global_settings"}}
1163+
When the request is sent
1164+
Then the response status is 400 Bad Request
1165+
1166+
@generated @skip @team:DataDog/incident-app
1167+
Scenario: Update global incident settings returns "OK" response
1168+
Given operation "UpdateGlobalIncidentSettings" enabled
1169+
And new "UpdateGlobalIncidentSettings" request
1170+
And body with value {"data": {"attributes": {"analytics_dashboard_id": "abc-123-def"}, "type": "incidents_global_settings"}}
1171+
When the request is sent
1172+
Then the response status is 200 OK
1173+
10841174
@skip @team:DataDog/incident-app
10851175
Scenario: Update incident attachment returns "Bad Request" response
10861176
Given operation "UpdateIncidentAttachment" enabled

features/v2/undo.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,44 @@
16021602
"type": "unsafe"
16031603
}
16041604
},
1605+
"DeleteGlobalIncidentHandle": {
1606+
"tag": "Incidents",
1607+
"undo": {
1608+
"type": "idempotent"
1609+
}
1610+
},
1611+
"ListGlobalIncidentHandles": {
1612+
"tag": "Incidents",
1613+
"undo": {
1614+
"type": "safe"
1615+
}
1616+
},
1617+
"CreateGlobalIncidentHandle": {
1618+
"tag": "Incidents",
1619+
"undo": {
1620+
"operationId": "DeleteGlobalIncidentHandle",
1621+
"parameters": [],
1622+
"type": "unsafe"
1623+
}
1624+
},
1625+
"UpdateGlobalIncidentHandle": {
1626+
"tag": "Incidents",
1627+
"undo": {
1628+
"type": "idempotent"
1629+
}
1630+
},
1631+
"GetGlobalIncidentSettings": {
1632+
"tag": "Incidents",
1633+
"undo": {
1634+
"type": "safe"
1635+
}
1636+
},
1637+
"UpdateGlobalIncidentSettings": {
1638+
"tag": "Incidents",
1639+
"undo": {
1640+
"type": "idempotent"
1641+
}
1642+
},
16051643
"ListIncidentNotificationRules": {
16061644
"tag": "Incidents",
16071645
"undo": {

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5896,6 +5896,48 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
58965896
},
58975897
operationResponseType: "IncidentResponse",
58985898
},
5899+
"IncidentsApi.V2.ListGlobalIncidentHandles": {
5900+
include: {
5901+
type: "string",
5902+
format: "",
5903+
},
5904+
operationResponseType: "IncidentHandlesResponse",
5905+
},
5906+
"IncidentsApi.V2.UpdateGlobalIncidentHandle": {
5907+
include: {
5908+
type: "string",
5909+
format: "",
5910+
},
5911+
body: {
5912+
type: "IncidentHandleRequest",
5913+
format: "",
5914+
},
5915+
operationResponseType: "IncidentHandleResponse",
5916+
},
5917+
"IncidentsApi.V2.CreateGlobalIncidentHandle": {
5918+
include: {
5919+
type: "string",
5920+
format: "",
5921+
},
5922+
body: {
5923+
type: "IncidentHandleRequest",
5924+
format: "",
5925+
},
5926+
operationResponseType: "IncidentHandleResponse",
5927+
},
5928+
"IncidentsApi.V2.DeleteGlobalIncidentHandle": {
5929+
operationResponseType: "{}",
5930+
},
5931+
"IncidentsApi.V2.GetGlobalIncidentSettings": {
5932+
operationResponseType: "GlobalIncidentSettingsResponse",
5933+
},
5934+
"IncidentsApi.V2.UpdateGlobalIncidentSettings": {
5935+
body: {
5936+
type: "GlobalIncidentSettingsRequest",
5937+
format: "",
5938+
},
5939+
operationResponseType: "GlobalIncidentSettingsResponse",
5940+
},
58995941
"IncidentsApi.V2.ListIncidentNotificationRules": {
59005942
include: {
59015943
type: "string",

0 commit comments

Comments
 (0)