Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
551 changes: 551 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions examples/v2/case-management/CreateCaseJiraIssue.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Create Jira issue for case returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_case_jira_issue".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::JiraIssueCreateRequest.new({
data: DatadogAPIClient::V2::JiraIssueCreateData.new({
attributes: DatadogAPIClient::V2::JiraIssueCreateAttributes.new({
fields: {},
issue_type_id: "10001",
jira_account_id: "1234",
project_id: "5678",
}),
type: DatadogAPIClient::V2::JiraIssueResourceType::ISSUES,
}),
})
p api_instance.create_case_jira_issue("case_id", body)
14 changes: 14 additions & 0 deletions examples/v2/case-management/CreateCaseNotebook.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Create investigation notebook for case returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_case_notebook".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::NotebookCreateRequest.new({
data: DatadogAPIClient::V2::NotebookCreateData.new({
type: DatadogAPIClient::V2::NotebookResourceType::NOTEBOOK,
}),
})
api_instance.create_case_notebook("case_id", body)
18 changes: 18 additions & 0 deletions examples/v2/case-management/CreateCaseServiceNowTicket.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Create ServiceNow ticket for case returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_case_service_now_ticket".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::ServiceNowTicketCreateRequest.new({
data: DatadogAPIClient::V2::ServiceNowTicketCreateData.new({
attributes: DatadogAPIClient::V2::ServiceNowTicketCreateAttributes.new({
assignment_group: "IT Support",
instance_name: "my-instance",
}),
type: DatadogAPIClient::V2::ServiceNowTicketResourceType::TICKETS,
}),
})
p api_instance.create_case_service_now_ticket("case_id", body)
15 changes: 15 additions & 0 deletions examples/v2/case-management/LinkIncident.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Link incident to case returns "Created" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.link_incident".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::RelationshipToIncidentRequest.new({
data: DatadogAPIClient::V2::IncidentRelationshipData.new({
id: "00000000-0000-0000-0000-000000000000",
type: DatadogAPIClient::V2::IncidentResourceType::INCIDENTS,
}),
})
p api_instance.link_incident("case_id", body)
17 changes: 17 additions & 0 deletions examples/v2/case-management/LinkJiraIssueToCase.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Link existing Jira issue to case returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.link_jira_issue_to_case".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::JiraIssueLinkRequest.new({
data: DatadogAPIClient::V2::JiraIssueLinkData.new({
attributes: DatadogAPIClient::V2::JiraIssueLinkAttributes.new({
jira_issue_url: "https://jira.example.com/browse/PROJ-123",
}),
type: DatadogAPIClient::V2::JiraIssueResourceType::ISSUES,
}),
})
api_instance.link_jira_issue_to_case("case_id", body)
15 changes: 15 additions & 0 deletions examples/v2/case-management/MoveCaseToProject.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Update case project returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.move_case_to_project".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

body = DatadogAPIClient::V2::ProjectRelationship.new({
data: DatadogAPIClient::V2::ProjectRelationshipData.new({
id: "e555e290-ed65-49bd-ae18-8acbfcf18db7",
type: DatadogAPIClient::V2::ProjectResourceType::PROJECT,
}),
})
p api_instance.move_case_to_project("case_id", body)
8 changes: 8 additions & 0 deletions examples/v2/case-management/UnlinkJiraIssue.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Remove Jira issue link from case returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.unlink_jira_issue".to_sym] = true
end
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
api_instance.unlink_jira_issue("case_id")
27 changes: 27 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,33 @@
"case_id" => "String",
"body" => "CaseUpdatePriorityRequest",
},
"v2.LinkIncident" => {
"case_id" => "String",
"body" => "RelationshipToIncidentRequest",
},
"v2.UnlinkJiraIssue" => {
"case_id" => "String",
},
"v2.LinkJiraIssueToCase" => {
"case_id" => "String",
"body" => "JiraIssueLinkRequest",
},
"v2.CreateCaseJiraIssue" => {
"case_id" => "String",
"body" => "JiraIssueCreateRequest",
},
"v2.CreateCaseNotebook" => {
"case_id" => "String",
"body" => "NotebookCreateRequest",
},
"v2.MoveCaseToProject" => {
"case_id" => "String",
"body" => "ProjectRelationship",
},
"v2.CreateCaseServiceNowTicket" => {
"case_id" => "String",
"body" => "ServiceNowTicketCreateRequest",
},
"v2.UpdateStatus" => {
"case_id" => "String",
"body" => "CaseUpdateStatusRequest",
Expand Down
195 changes: 195 additions & 0 deletions features/v2/case_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,60 @@ Feature: Case Management
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/case-management
Scenario: Create Jira issue for case returns "Accepted" response
Given operation "CreateCaseJiraIssue" enabled
And new "CreateCaseJiraIssue" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}}
When the request is sent
Then the response status is 202 Accepted

@generated @skip @team:DataDog/case-management
Scenario: Create Jira issue for case returns "Bad Request" response
Given operation "CreateCaseJiraIssue" enabled
And new "CreateCaseJiraIssue" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Create Jira issue for case returns "Not Found" response
Given operation "CreateCaseJiraIssue" enabled
And new "CreateCaseJiraIssue" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"fields": {}, "issue_type_id": "10001", "jira_account_id": "1234", "project_id": "5678"}, "type": "issues"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Create ServiceNow ticket for case returns "Accepted" response
Given operation "CreateCaseServiceNowTicket" enabled
And new "CreateCaseServiceNowTicket" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}}
When the request is sent
Then the response status is 202 Accepted

@generated @skip @team:DataDog/case-management
Scenario: Create ServiceNow ticket for case returns "Bad Request" response
Given operation "CreateCaseServiceNowTicket" enabled
And new "CreateCaseServiceNowTicket" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Create ServiceNow ticket for case returns "Not Found" response
Given operation "CreateCaseServiceNowTicket" enabled
And new "CreateCaseServiceNowTicket" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assignment_group": "IT Support", "instance_name": "my-instance"}, "type": "tickets"}}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/case-management
Scenario: Create a case returns "Bad Request" response
Given new "CreateCase" request
Expand Down Expand Up @@ -137,6 +191,33 @@ Feature: Case Management
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Create investigation notebook for case returns "Bad Request" response
Given operation "CreateCaseNotebook" enabled
And new "CreateCaseNotebook" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"type": "notebook"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Create investigation notebook for case returns "No Content" response
Given operation "CreateCaseNotebook" enabled
And new "CreateCaseNotebook" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"type": "notebook"}}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Create investigation notebook for case returns "Not Found" response
Given operation "CreateCaseNotebook" enabled
And new "CreateCaseNotebook" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"type": "notebook"}}
When the request is sent
Then the response status is 404 Not Found

@skip @team:DataDog/case-management
Scenario: Delete case comment returns "Bad Request" response
Given new "DeleteCaseComment" request
Expand Down Expand Up @@ -247,6 +328,93 @@ Feature: Case Management
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/case-management
Scenario: Link existing Jira issue to case returns "Bad Request" response
Given operation "LinkJiraIssueToCase" enabled
And new "LinkJiraIssueToCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Link existing Jira issue to case returns "Conflict" response
Given operation "LinkJiraIssueToCase" enabled
And new "LinkJiraIssueToCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}}
When the request is sent
Then the response status is 409 Conflict

@generated @skip @team:DataDog/case-management
Scenario: Link existing Jira issue to case returns "No Content" response
Given operation "LinkJiraIssueToCase" enabled
And new "LinkJiraIssueToCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Link existing Jira issue to case returns "Not Found" response
Given operation "LinkJiraIssueToCase" enabled
And new "LinkJiraIssueToCase" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"jira_issue_url": "https://jira.example.com/browse/PROJ-123"}, "type": "issues"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Link incident to case returns "Bad Request" response
Given operation "LinkIncident" enabled
And new "LinkIncident" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Link incident to case returns "Created" response
Given operation "LinkIncident" enabled
And new "LinkIncident" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/case-management
Scenario: Link incident to case returns "Not Found" response
Given operation "LinkIncident" enabled
And new "LinkIncident" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incidents"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Remove Jira issue link from case returns "Bad Request" response
Given operation "UnlinkJiraIssue" enabled
And new "UnlinkJiraIssue" request
And request contains "case_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Remove Jira issue link from case returns "No Content" response
Given operation "UnlinkJiraIssue" enabled
And new "UnlinkJiraIssue" request
And request contains "case_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/case-management
Scenario: Remove Jira issue link from case returns "Not Found" response
Given operation "UnlinkJiraIssue" enabled
And new "UnlinkJiraIssue" request
And request contains "case_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Remove a project returns "API error response" response
Given new "DeleteProject" request
Expand Down Expand Up @@ -450,6 +618,33 @@ Feature: Case Management
Then the response status is 200 OK
And the response "data.attributes.priority" is equal to "P3"

@generated @skip @team:DataDog/case-management
Scenario: Update case project returns "Bad Request" response
Given operation "MoveCaseToProject" enabled
And new "MoveCaseToProject" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/case-management
Scenario: Update case project returns "Not Found" response
Given operation "MoveCaseToProject" enabled
And new "MoveCaseToProject" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/case-management
Scenario: Update case project returns "OK" response
Given operation "MoveCaseToProject" enabled
And new "MoveCaseToProject" request
And request contains "case_id" parameter from "REPLACE.ME"
And body with value {"data": {"id": "e555e290-ed65-49bd-ae18-8acbfcf18db7", "type": "project"}}
When the request is sent
Then the response status is 200 OK

@team:DataDog/case-management
Scenario: Update case status returns "Bad Request" response
Given new "UpdateStatus" request
Expand Down
Loading
Loading