Skip to content

Commit b81a7c9

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

31 files changed

Lines changed: 3342 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 551 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Create Jira issue for case returns "Accepted" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_case_jira_issue".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
8+
9+
body = DatadogAPIClient::V2::JiraIssueCreateRequest.new({
10+
data: DatadogAPIClient::V2::JiraIssueCreateData.new({
11+
attributes: DatadogAPIClient::V2::JiraIssueCreateAttributes.new({
12+
fields: {},
13+
issue_type_id: "10001",
14+
jira_account_id: "1234",
15+
project_id: "5678",
16+
}),
17+
type: DatadogAPIClient::V2::JiraIssueResourceType::ISSUES,
18+
}),
19+
})
20+
p api_instance.create_case_jira_issue("case_id", body)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Create investigation notebook for case returns "No Content" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_case_notebook".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
8+
9+
body = DatadogAPIClient::V2::NotebookCreateRequest.new({
10+
data: DatadogAPIClient::V2::NotebookCreateData.new({
11+
type: DatadogAPIClient::V2::NotebookResourceType::NOTEBOOK,
12+
}),
13+
})
14+
api_instance.create_case_notebook("case_id", body)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Create ServiceNow ticket for case returns "Accepted" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_case_service_now_ticket".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
8+
9+
body = DatadogAPIClient::V2::ServiceNowTicketCreateRequest.new({
10+
data: DatadogAPIClient::V2::ServiceNowTicketCreateData.new({
11+
attributes: DatadogAPIClient::V2::ServiceNowTicketCreateAttributes.new({
12+
assignment_group: "IT Support",
13+
instance_name: "my-instance",
14+
}),
15+
type: DatadogAPIClient::V2::ServiceNowTicketResourceType::TICKETS,
16+
}),
17+
})
18+
p api_instance.create_case_service_now_ticket("case_id", body)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Link incident to case returns "Created" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.link_incident".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
8+
9+
body = DatadogAPIClient::V2::RelationshipToIncidentRequest.new({
10+
data: DatadogAPIClient::V2::IncidentRelationshipData.new({
11+
id: "00000000-0000-0000-0000-000000000000",
12+
type: DatadogAPIClient::V2::IncidentResourceType::INCIDENTS,
13+
}),
14+
})
15+
p api_instance.link_incident("case_id", body)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Link existing Jira issue to case returns "No Content" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.link_jira_issue_to_case".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
8+
9+
body = DatadogAPIClient::V2::JiraIssueLinkRequest.new({
10+
data: DatadogAPIClient::V2::JiraIssueLinkData.new({
11+
attributes: DatadogAPIClient::V2::JiraIssueLinkAttributes.new({
12+
jira_issue_url: "https://jira.example.com/browse/PROJ-123",
13+
}),
14+
type: DatadogAPIClient::V2::JiraIssueResourceType::ISSUES,
15+
}),
16+
})
17+
api_instance.link_jira_issue_to_case("case_id", body)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Update case project returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.move_case_to_project".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
8+
9+
body = DatadogAPIClient::V2::ProjectRelationship.new({
10+
data: DatadogAPIClient::V2::ProjectRelationshipData.new({
11+
id: "e555e290-ed65-49bd-ae18-8acbfcf18db7",
12+
type: DatadogAPIClient::V2::ProjectResourceType::PROJECT,
13+
}),
14+
})
15+
p api_instance.move_case_to_project("case_id", body)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Remove Jira issue link from case returns "No Content" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.unlink_jira_issue".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
8+
api_instance.unlink_jira_issue("case_id")

features/scenarios_model_mapping.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,33 @@
12541254
"case_id" => "String",
12551255
"body" => "CaseUpdatePriorityRequest",
12561256
},
1257+
"v2.LinkIncident" => {
1258+
"case_id" => "String",
1259+
"body" => "RelationshipToIncidentRequest",
1260+
},
1261+
"v2.UnlinkJiraIssue" => {
1262+
"case_id" => "String",
1263+
},
1264+
"v2.LinkJiraIssueToCase" => {
1265+
"case_id" => "String",
1266+
"body" => "JiraIssueLinkRequest",
1267+
},
1268+
"v2.CreateCaseJiraIssue" => {
1269+
"case_id" => "String",
1270+
"body" => "JiraIssueCreateRequest",
1271+
},
1272+
"v2.CreateCaseNotebook" => {
1273+
"case_id" => "String",
1274+
"body" => "NotebookCreateRequest",
1275+
},
1276+
"v2.MoveCaseToProject" => {
1277+
"case_id" => "String",
1278+
"body" => "ProjectRelationship",
1279+
},
1280+
"v2.CreateCaseServiceNowTicket" => {
1281+
"case_id" => "String",
1282+
"body" => "ServiceNowTicketCreateRequest",
1283+
},
12571284
"v2.UpdateStatus" => {
12581285
"case_id" => "String",
12591286
"body" => "CaseUpdateStatusRequest",

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

0 commit comments

Comments
 (0)