Skip to content

Commit b4e5e2f

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

35 files changed

Lines changed: 2991 additions & 81 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 438 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Create global incident handle returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createGlobalIncidentHandle"] = true;
9+
const apiInstance = new v2.IncidentsApi(configuration);
10+
11+
const params: v2.IncidentsApiCreateGlobalIncidentHandleRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
fields: {
16+
severity: ["SEV-1"],
17+
},
18+
name: "@incident-sev-1",
19+
},
20+
id: "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
21+
relationships: {
22+
commanderUser: {
23+
data: {
24+
id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
25+
type: "incident_types",
26+
},
27+
},
28+
incidentType: {
29+
data: {
30+
id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
31+
type: "incident_types",
32+
},
33+
},
34+
},
35+
type: "incidents_handles",
36+
},
37+
},
38+
};
39+
40+
apiInstance
41+
.createGlobalIncidentHandle(params)
42+
.then((data: v2.IncidentHandleResponse) => {
43+
console.log(
44+
"API called successfully. Returned data: " + JSON.stringify(data)
45+
);
46+
})
47+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Delete global incident handle returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteGlobalIncidentHandle"] = true;
9+
const apiInstance = new v2.IncidentsApi(configuration);
10+
11+
apiInstance
12+
.deleteGlobalIncidentHandle()
13+
.then((data: any) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Get global incident settings returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getGlobalIncidentSettings"] = true;
9+
const apiInstance = new v2.IncidentsApi(configuration);
10+
11+
apiInstance
12+
.getGlobalIncidentSettings()
13+
.then((data: v2.GlobalIncidentSettingsResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List global incident handles returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listGlobalIncidentHandles"] = true;
9+
const apiInstance = new v2.IncidentsApi(configuration);
10+
11+
apiInstance
12+
.listGlobalIncidentHandles()
13+
.then((data: v2.IncidentHandlesResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Update global incident handle returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.updateGlobalIncidentHandle"] = true;
9+
const apiInstance = new v2.IncidentsApi(configuration);
10+
11+
const params: v2.IncidentsApiUpdateGlobalIncidentHandleRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
fields: {
16+
severity: ["SEV-1"],
17+
},
18+
name: "@incident-sev-1",
19+
},
20+
id: "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
21+
relationships: {
22+
commanderUser: {
23+
data: {
24+
id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
25+
type: "incident_types",
26+
},
27+
},
28+
incidentType: {
29+
data: {
30+
id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
31+
type: "incident_types",
32+
},
33+
},
34+
},
35+
type: "incidents_handles",
36+
},
37+
},
38+
};
39+
40+
apiInstance
41+
.updateGlobalIncidentHandle(params)
42+
.then((data: v2.IncidentHandleResponse) => {
43+
console.log(
44+
"API called successfully. Returned data: " + JSON.stringify(data)
45+
);
46+
})
47+
.catch((error: any) => console.error(error));
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Update global incident settings returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.updateGlobalIncidentSettings"] = true;
9+
const apiInstance = new v2.IncidentsApi(configuration);
10+
11+
const params: v2.IncidentsApiUpdateGlobalIncidentSettingsRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
analyticsDashboardId: "abc-123-def",
16+
},
17+
type: "incidents_global_settings",
18+
},
19+
},
20+
};
21+
22+
apiInstance
23+
.updateGlobalIncidentSettings(params)
24+
.then((data: v2.GlobalIncidentSettingsResponse) => {
25+
console.log(
26+
"API called successfully. Returned data: " + JSON.stringify(data)
27+
);
28+
})
29+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5886,6 +5886,48 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
58865886
},
58875887
"operationResponseType": "IncidentResponse",
58885888
},
5889+
"v2.ListGlobalIncidentHandles": {
5890+
"include": {
5891+
"type": "string",
5892+
"format": "",
5893+
},
5894+
"operationResponseType": "IncidentHandlesResponse",
5895+
},
5896+
"v2.UpdateGlobalIncidentHandle": {
5897+
"include": {
5898+
"type": "string",
5899+
"format": "",
5900+
},
5901+
"body": {
5902+
"type": "IncidentHandleRequest",
5903+
"format": "",
5904+
},
5905+
"operationResponseType": "IncidentHandleResponse",
5906+
},
5907+
"v2.CreateGlobalIncidentHandle": {
5908+
"include": {
5909+
"type": "string",
5910+
"format": "",
5911+
},
5912+
"body": {
5913+
"type": "IncidentHandleRequest",
5914+
"format": "",
5915+
},
5916+
"operationResponseType": "IncidentHandleResponse",
5917+
},
5918+
"v2.DeleteGlobalIncidentHandle": {
5919+
"operationResponseType": "{}",
5920+
},
5921+
"v2.GetGlobalIncidentSettings": {
5922+
"operationResponseType": "GlobalIncidentSettingsResponse",
5923+
},
5924+
"v2.UpdateGlobalIncidentSettings": {
5925+
"body": {
5926+
"type": "GlobalIncidentSettingsRequest",
5927+
"format": "",
5928+
},
5929+
"operationResponseType": "GlobalIncidentSettingsResponse",
5930+
},
58895931
"v2.ListIncidentNotificationRules": {
58905932
"include": {
58915933
"type": "string",

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

0 commit comments

Comments
 (0)