Skip to content
Merged
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
767 changes: 767 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions examples/v2/servicenow-integration/CreateServiceNowTemplate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Create ServiceNow template returns "Created" response

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

body = DatadogAPIClient::V2::ServiceNowTemplateCreateRequest.new({
data: DatadogAPIClient::V2::ServiceNowTemplateCreateRequestData.new({
attributes: DatadogAPIClient::V2::ServiceNowTemplateCreateRequestAttributes.new({
assignment_group_id: "65b3341b-0680-47f9-a6d4-134db45c603e",
business_service_id: "65b3341b-0680-47f9-a6d4-134db45c603e",
fields_mapping: {
category: "software", priority: "1",
},
handle_name: "incident-template",
instance_id: "65b3341b-0680-47f9-a6d4-134db45c603e",
servicenow_tablename: "incident",
user_id: "65b3341b-0680-47f9-a6d4-134db45c603e",
}),
type: DatadogAPIClient::V2::ServiceNowTemplateType::SERVICENOW_TEMPLATES,
}),
})
p api_instance.create_service_now_template(body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Delete ServiceNow template returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.delete_service_now_template".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new
p api_instance.delete_service_now_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
8 changes: 8 additions & 0 deletions examples/v2/servicenow-integration/GetServiceNowTemplate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get ServiceNow template returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_service_now_template".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new
p api_instance.get_service_now_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List ServiceNow assignment groups returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_service_now_assignment_groups".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new
p api_instance.list_service_now_assignment_groups("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List ServiceNow business services returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_service_now_business_services".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new
p api_instance.list_service_now_business_services("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List ServiceNow instances returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_service_now_instances".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new
p api_instance.list_service_now_instances()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List ServiceNow templates returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_service_now_templates".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new
p api_instance.list_service_now_templates()
8 changes: 8 additions & 0 deletions examples/v2/servicenow-integration/ListServiceNowUsers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List ServiceNow users returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_service_now_users".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceNowIntegrationAPI.new
p api_instance.list_service_now_users("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
25 changes: 25 additions & 0 deletions examples/v2/servicenow-integration/UpdateServiceNowTemplate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Update ServiceNow template returns "OK" response

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

body = DatadogAPIClient::V2::ServiceNowTemplateUpdateRequest.new({
data: DatadogAPIClient::V2::ServiceNowTemplateUpdateRequestData.new({
attributes: DatadogAPIClient::V2::ServiceNowTemplateUpdateRequestAttributes.new({
assignment_group_id: "65b3341b-0680-47f9-a6d4-134db45c603e",
business_service_id: "65b3341b-0680-47f9-a6d4-134db45c603e",
fields_mapping: {
category: "hardware", priority: "2",
},
handle_name: "incident-template-updated",
instance_id: "65b3341b-0680-47f9-a6d4-134db45c603e",
servicenow_tablename: "incident",
user_id: "65b3341b-0680-47f9-a6d4-134db45c603e",
}),
type: DatadogAPIClient::V2::ServiceNowTemplateType::SERVICENOW_TEMPLATES,
}),
})
p api_instance.update_service_now_template("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body)
22 changes: 22 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,28 @@
"integration_service_id" => "String",
"body" => "OpsgenieServiceUpdateRequest",
},
"v2.ListServiceNowAssignmentGroups" => {
"instance_id" => "UUID",
},
"v2.ListServiceNowBusinessServices" => {
"instance_id" => "UUID",
},
"v2.CreateServiceNowTemplate" => {
"body" => "ServiceNowTemplateCreateRequest",
},
"v2.DeleteServiceNowTemplate" => {
"template_id" => "UUID",
},
"v2.GetServiceNowTemplate" => {
"template_id" => "UUID",
},
"v2.UpdateServiceNowTemplate" => {
"template_id" => "UUID",
"body" => "ServiceNowTemplateUpdateRequest",
},
"v2.ListServiceNowUsers" => {
"instance_id" => "UUID",
},
"v2.CreateCloudflareAccount" => {
"body" => "CloudflareAccountCreateRequest",
},
Expand Down
194 changes: 194 additions & 0 deletions features/v2/servicenow_integration.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
@endpoint(servicenow-integration) @endpoint(servicenow-integration-v2)
Feature: ServiceNow Integration
Manage your ServiceNow Integration. ServiceNow is a cloud-based platform
that helps organizations manage digital workflows for enterprise
operations.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "ServiceNowIntegration" API

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Create ServiceNow template returns "Bad Request" response
Given operation "CreateServiceNowTemplate" enabled
And new "CreateServiceNowTemplate" request
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "software", "priority": "1"}, "handle_name": "incident-template", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Create ServiceNow template returns "Created" response
Given operation "CreateServiceNowTemplate" enabled
And new "CreateServiceNowTemplate" request
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "software", "priority": "1"}, "handle_name": "incident-template", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Delete ServiceNow template returns "Bad Request" response
Given operation "DeleteServiceNowTemplate" enabled
And new "DeleteServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Delete ServiceNow template returns "Not Found" response
Given operation "DeleteServiceNowTemplate" enabled
And new "DeleteServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Delete ServiceNow template returns "OK" response
Given operation "DeleteServiceNowTemplate" enabled
And new "DeleteServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Get ServiceNow template returns "Bad Request" response
Given operation "GetServiceNowTemplate" enabled
And new "GetServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Get ServiceNow template returns "Not Found" response
Given operation "GetServiceNowTemplate" enabled
And new "GetServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Get ServiceNow template returns "OK" response
Given operation "GetServiceNowTemplate" enabled
And new "GetServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow assignment groups returns "Bad Request" response
Given operation "ListServiceNowAssignmentGroups" enabled
And new "ListServiceNowAssignmentGroups" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow assignment groups returns "Not Found" response
Given operation "ListServiceNowAssignmentGroups" enabled
And new "ListServiceNowAssignmentGroups" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow assignment groups returns "OK" response
Given operation "ListServiceNowAssignmentGroups" enabled
And new "ListServiceNowAssignmentGroups" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow business services returns "Bad Request" response
Given operation "ListServiceNowBusinessServices" enabled
And new "ListServiceNowBusinessServices" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow business services returns "Not Found" response
Given operation "ListServiceNowBusinessServices" enabled
And new "ListServiceNowBusinessServices" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow business services returns "OK" response
Given operation "ListServiceNowBusinessServices" enabled
And new "ListServiceNowBusinessServices" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow instances returns "Not Found" response
Given operation "ListServiceNowInstances" enabled
And new "ListServiceNowInstances" request
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow instances returns "OK" response
Given operation "ListServiceNowInstances" enabled
And new "ListServiceNowInstances" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow templates returns "OK" response
Given operation "ListServiceNowTemplates" enabled
And new "ListServiceNowTemplates" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow users returns "Bad Request" response
Given operation "ListServiceNowUsers" enabled
And new "ListServiceNowUsers" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow users returns "Not Found" response
Given operation "ListServiceNowUsers" enabled
And new "ListServiceNowUsers" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: List ServiceNow users returns "OK" response
Given operation "ListServiceNowUsers" enabled
And new "ListServiceNowUsers" request
And request contains "instance_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Update ServiceNow template returns "Bad Request" response
Given operation "UpdateServiceNowTemplate" enabled
And new "UpdateServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Update ServiceNow template returns "Not Found" response
Given operation "UpdateServiceNowTemplate" enabled
And new "UpdateServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:Datadog/collaboration-integrations
Scenario: Update ServiceNow template returns "OK" response
Given operation "UpdateServiceNowTemplate" enabled
And new "UpdateServiceNowTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"assignment_group_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "business_service_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "fields_mapping": {"category": "hardware", "priority": "2"}, "handle_name": "incident-template-updated", "instance_id": "65b3341b-0680-47f9-a6d4-134db45c603e", "servicenow_tablename": "incident", "user_id": "65b3341b-0680-47f9-a6d4-134db45c603e"}, "type": "servicenow_templates"}}
When the request is sent
Then the response status is 200 OK
Loading
Loading