Skip to content

Commit e6aa5f9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI documentation for case-rapid-api relationship endpoints (#3378)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 6ee12bc commit e6aa5f9

27 files changed

Lines changed: 3159 additions & 113 deletions

.generator/schemas/v2/openapi.yaml

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

features/v2/case_management.feature

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,60 @@ Feature: Case Management
9090
When the request is sent
9191
Then the response status is 200 OK
9292

93+
@generated @skip @team:DataDog/case-management
94+
Scenario: Create Jira issue for case returns "Accepted" response
95+
Given operation "CreateCaseJiraIssue" enabled
96+
And new "CreateCaseJiraIssue" request
97+
And request contains "case_id" parameter from "REPLACE.ME"
98+
And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}}
99+
When the request is sent
100+
Then the response status is 202 Accepted
101+
102+
@generated @skip @team:DataDog/case-management
103+
Scenario: Create Jira issue for case returns "Bad Request" response
104+
Given operation "CreateCaseJiraIssue" enabled
105+
And new "CreateCaseJiraIssue" request
106+
And request contains "case_id" parameter from "REPLACE.ME"
107+
And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}}
108+
When the request is sent
109+
Then the response status is 400 Bad Request
110+
111+
@generated @skip @team:DataDog/case-management
112+
Scenario: Create Jira issue for case returns "Not Found" response
113+
Given operation "CreateCaseJiraIssue" enabled
114+
And new "CreateCaseJiraIssue" request
115+
And request contains "case_id" parameter from "REPLACE.ME"
116+
And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}}
117+
When the request is sent
118+
Then the response status is 404 Not Found
119+
120+
@generated @skip @team:DataDog/case-management
121+
Scenario: Create ServiceNow ticket for case returns "Accepted" response
122+
Given operation "CreateCaseServiceNowTicket" enabled
123+
And new "CreateCaseServiceNowTicket" request
124+
And request contains "case_id" parameter from "REPLACE.ME"
125+
And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}}
126+
When the request is sent
127+
Then the response status is 202 Accepted
128+
129+
@generated @skip @team:DataDog/case-management
130+
Scenario: Create ServiceNow ticket for case returns "Bad Request" response
131+
Given operation "CreateCaseServiceNowTicket" enabled
132+
And new "CreateCaseServiceNowTicket" request
133+
And request contains "case_id" parameter from "REPLACE.ME"
134+
And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}}
135+
When the request is sent
136+
Then the response status is 400 Bad Request
137+
138+
@generated @skip @team:DataDog/case-management
139+
Scenario: Create ServiceNow ticket for case returns "Not Found" response
140+
Given operation "CreateCaseServiceNowTicket" enabled
141+
And new "CreateCaseServiceNowTicket" request
142+
And request contains "case_id" parameter from "REPLACE.ME"
143+
And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}}
144+
When the request is sent
145+
Then the response status is 404 Not Found
146+
93147
@team:DataDog/case-management
94148
Scenario: Create a case returns "Bad Request" response
95149
Given new "CreateCase" request
@@ -161,6 +215,33 @@ Feature: Case Management
161215
When the request is sent
162216
Then the response status is 404 Not Found
163217

218+
@generated @skip @team:DataDog/case-management
219+
Scenario: Create investigation notebook for case returns "Bad Request" response
220+
Given operation "CreateCaseNotebook" enabled
221+
And new "CreateCaseNotebook" request
222+
And request contains "case_id" parameter from "REPLACE.ME"
223+
And body with value {"data": {"type": "notebook"}}
224+
When the request is sent
225+
Then the response status is 400 Bad Request
226+
227+
@generated @skip @team:DataDog/case-management
228+
Scenario: Create investigation notebook for case returns "No Content" response
229+
Given operation "CreateCaseNotebook" enabled
230+
And new "CreateCaseNotebook" request
231+
And request contains "case_id" parameter from "REPLACE.ME"
232+
And body with value {"data": {"type": "notebook"}}
233+
When the request is sent
234+
Then the response status is 204 No Content
235+
236+
@generated @skip @team:DataDog/case-management
237+
Scenario: Create investigation notebook for case returns "Not Found" response
238+
Given operation "CreateCaseNotebook" enabled
239+
And new "CreateCaseNotebook" request
240+
And request contains "case_id" parameter from "REPLACE.ME"
241+
And body with value {"data": {"type": "notebook"}}
242+
When the request is sent
243+
Then the response status is 404 Not Found
244+
164245
@generated @skip @team:DataDog/case-management
165246
Scenario: Delete a notification rule returns "API error response" response
166247
Given new "DeleteProjectNotificationRule" request
@@ -308,6 +389,93 @@ Feature: Case Management
308389
When the request is sent
309390
Then the response status is 200 OK
310391

392+
@generated @skip @team:DataDog/case-management
393+
Scenario: Link existing Jira issue to case returns "Bad Request" response
394+
Given operation "LinkJiraIssueToCase" enabled
395+
And new "LinkJiraIssueToCase" request
396+
And request contains "case_id" parameter from "REPLACE.ME"
397+
And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}}
398+
When the request is sent
399+
Then the response status is 400 Bad Request
400+
401+
@generated @skip @team:DataDog/case-management
402+
Scenario: Link existing Jira issue to case returns "Conflict" response
403+
Given operation "LinkJiraIssueToCase" enabled
404+
And new "LinkJiraIssueToCase" request
405+
And request contains "case_id" parameter from "REPLACE.ME"
406+
And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}}
407+
When the request is sent
408+
Then the response status is 409 Conflict
409+
410+
@generated @skip @team:DataDog/case-management
411+
Scenario: Link existing Jira issue to case returns "No Content" response
412+
Given operation "LinkJiraIssueToCase" enabled
413+
And new "LinkJiraIssueToCase" request
414+
And request contains "case_id" parameter from "REPLACE.ME"
415+
And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}}
416+
When the request is sent
417+
Then the response status is 204 No Content
418+
419+
@generated @skip @team:DataDog/case-management
420+
Scenario: Link existing Jira issue to case returns "Not Found" response
421+
Given operation "LinkJiraIssueToCase" enabled
422+
And new "LinkJiraIssueToCase" request
423+
And request contains "case_id" parameter from "REPLACE.ME"
424+
And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}}
425+
When the request is sent
426+
Then the response status is 404 Not Found
427+
428+
@generated @skip @team:DataDog/case-management
429+
Scenario: Link incident to case returns "Bad Request" response
430+
Given operation "LinkIncident" enabled
431+
And new "LinkIncident" request
432+
And request contains "case_id" parameter from "REPLACE.ME"
433+
And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}}
434+
When the request is sent
435+
Then the response status is 400 Bad Request
436+
437+
@generated @skip @team:DataDog/case-management
438+
Scenario: Link incident to case returns "Created" response
439+
Given operation "LinkIncident" enabled
440+
And new "LinkIncident" request
441+
And request contains "case_id" parameter from "REPLACE.ME"
442+
And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}}
443+
When the request is sent
444+
Then the response status is 201 Created
445+
446+
@generated @skip @team:DataDog/case-management
447+
Scenario: Link incident to case returns "Not Found" response
448+
Given operation "LinkIncident" enabled
449+
And new "LinkIncident" request
450+
And request contains "case_id" parameter from "REPLACE.ME"
451+
And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}}
452+
When the request is sent
453+
Then the response status is 404 Not Found
454+
455+
@generated @skip @team:DataDog/case-management
456+
Scenario: Remove Jira issue link from case returns "Bad Request" response
457+
Given operation "UnlinkJiraIssue" enabled
458+
And new "UnlinkJiraIssue" request
459+
And request contains "case_id" parameter from "REPLACE.ME"
460+
When the request is sent
461+
Then the response status is 400 Bad Request
462+
463+
@generated @skip @team:DataDog/case-management
464+
Scenario: Remove Jira issue link from case returns "No Content" response
465+
Given operation "UnlinkJiraIssue" enabled
466+
And new "UnlinkJiraIssue" request
467+
And request contains "case_id" parameter from "REPLACE.ME"
468+
When the request is sent
469+
Then the response status is 204 No Content
470+
471+
@generated @skip @team:DataDog/case-management
472+
Scenario: Remove Jira issue link from case returns "Not Found" response
473+
Given operation "UnlinkJiraIssue" enabled
474+
And new "UnlinkJiraIssue" request
475+
And request contains "case_id" parameter from "REPLACE.ME"
476+
When the request is sent
477+
Then the response status is 404 Not Found
478+
311479
@generated @skip @team:DataDog/case-management
312480
Scenario: Remove a project returns "API error response" response
313481
Given new "DeleteProject" request
@@ -564,6 +732,33 @@ Feature: Case Management
564732
Then the response status is 200 OK
565733
And the response "data.attributes.priority" is equal to "P3"
566734

735+
@generated @skip @team:DataDog/case-management
736+
Scenario: Update case project returns "Bad Request" response
737+
Given operation "MoveCaseToProject" enabled
738+
And new "MoveCaseToProject" request
739+
And request contains "case_id" parameter from "REPLACE.ME"
740+
And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}
741+
When the request is sent
742+
Then the response status is 400 Bad Request
743+
744+
@generated @skip @team:DataDog/case-management
745+
Scenario: Update case project returns "Not Found" response
746+
Given operation "MoveCaseToProject" enabled
747+
And new "MoveCaseToProject" request
748+
And request contains "case_id" parameter from "REPLACE.ME"
749+
And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}
750+
When the request is sent
751+
Then the response status is 404 Not Found
752+
753+
@generated @skip @team:DataDog/case-management
754+
Scenario: Update case project returns "OK" response
755+
Given operation "MoveCaseToProject" enabled
756+
And new "MoveCaseToProject" request
757+
And request contains "case_id" parameter from "REPLACE.ME"
758+
And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}
759+
When the request is sent
760+
Then the response status is 200 OK
761+
567762
@team:DataDog/case-management
568763
Scenario: Update case status returns "Bad Request" response
569764
Given new "UpdateStatus" request

features/v2/undo.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,56 @@
836836
"type": "idempotent"
837837
}
838838
},
839+
"LinkIncident": {
840+
"tag": "Case Management",
841+
"undo": {
842+
"operationId": "TODO",
843+
"parameters": [],
844+
"type": "unsafe"
845+
}
846+
},
847+
"UnlinkJiraIssue": {
848+
"tag": "Case Management",
849+
"undo": {
850+
"type": "idempotent"
851+
}
852+
},
853+
"LinkJiraIssueToCase": {
854+
"tag": "Case Management",
855+
"undo": {
856+
"type": "idempotent"
857+
}
858+
},
859+
"CreateCaseJiraIssue": {
860+
"tag": "Case Management",
861+
"undo": {
862+
"operationId": "TODO",
863+
"parameters": [],
864+
"type": "unsafe"
865+
}
866+
},
867+
"CreateCaseNotebook": {
868+
"tag": "Case Management",
869+
"undo": {
870+
"operationId": "TODO",
871+
"parameters": [],
872+
"type": "unsafe"
873+
}
874+
},
875+
"MoveCaseToProject": {
876+
"tag": "Case Management",
877+
"undo": {
878+
"type": "idempotent"
879+
}
880+
},
881+
"CreateCaseServiceNowTicket": {
882+
"tag": "Case Management",
883+
"undo": {
884+
"operationId": "TODO",
885+
"parameters": [],
886+
"type": "unsafe"
887+
}
888+
},
839889
"UpdateStatus": {
840890
"tag": "Case Management",
841891
"undo": {

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3517,6 +3517,79 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
35173517
},
35183518
operationResponseType: "CaseResponse",
35193519
},
3520+
"CaseManagementApi.V2.LinkIncident": {
3521+
caseId: {
3522+
type: "string",
3523+
format: "",
3524+
},
3525+
body: {
3526+
type: "RelationshipToIncidentRequest",
3527+
format: "",
3528+
},
3529+
operationResponseType: "CaseResponse",
3530+
},
3531+
"CaseManagementApi.V2.CreateCaseJiraIssue": {
3532+
caseId: {
3533+
type: "string",
3534+
format: "",
3535+
},
3536+
body: {
3537+
type: "JiraIssueCreateRequest",
3538+
format: "",
3539+
},
3540+
operationResponseType: "{}",
3541+
},
3542+
"CaseManagementApi.V2.UnlinkJiraIssue": {
3543+
caseId: {
3544+
type: "string",
3545+
format: "",
3546+
},
3547+
operationResponseType: "{}",
3548+
},
3549+
"CaseManagementApi.V2.LinkJiraIssueToCase": {
3550+
caseId: {
3551+
type: "string",
3552+
format: "",
3553+
},
3554+
body: {
3555+
type: "JiraIssueLinkRequest",
3556+
format: "",
3557+
},
3558+
operationResponseType: "{}",
3559+
},
3560+
"CaseManagementApi.V2.CreateCaseNotebook": {
3561+
caseId: {
3562+
type: "string",
3563+
format: "",
3564+
},
3565+
body: {
3566+
type: "NotebookCreateRequest",
3567+
format: "",
3568+
},
3569+
operationResponseType: "{}",
3570+
},
3571+
"CaseManagementApi.V2.MoveCaseToProject": {
3572+
caseId: {
3573+
type: "string",
3574+
format: "",
3575+
},
3576+
body: {
3577+
type: "ProjectRelationship",
3578+
format: "",
3579+
},
3580+
operationResponseType: "CaseResponse",
3581+
},
3582+
"CaseManagementApi.V2.CreateCaseServiceNowTicket": {
3583+
caseId: {
3584+
type: "string",
3585+
format: "",
3586+
},
3587+
body: {
3588+
type: "ServiceNowTicketCreateRequest",
3589+
format: "",
3590+
},
3591+
operationResponseType: "{}",
3592+
},
35203593
"CaseManagementApi.V2.UpdateStatus": {
35213594
caseId: {
35223595
type: "string",

0 commit comments

Comments
 (0)