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
403 changes: 403 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions examples/v2/web-integrations/CreateWebIntegrationAccount.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Create a web integration account returns "CREATED" response

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

body = DatadogAPIClient::V2::WebIntegrationAccountCreateRequest.new({
data: DatadogAPIClient::V2::WebIntegrationAccountCreateRequestData.new({
attributes: DatadogAPIClient::V2::WebIntegrationAccountCreateRequestAttributes.new({
name: "my-databricks-account",
secrets: DatadogAPIClient::V2::WebIntegrationAccountSecrets.new({}),
settings: DatadogAPIClient::V2::WebIntegrationAccountSettings.new({}),
}),
type: DatadogAPIClient::V2::WebIntegrationAccountType::ACCOUNT,
}),
})
p api_instance.create_web_integration_account("integration_name", body)
8 changes: 8 additions & 0 deletions examples/v2/web-integrations/DeleteWebIntegrationAccount.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Delete a web integration account returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.delete_web_integration_account".to_sym] = true
end
api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new
api_instance.delete_web_integration_account("integration_name", "account_id")
8 changes: 8 additions & 0 deletions examples/v2/web-integrations/GetWebIntegrationAccount.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a web integration account returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_web_integration_account".to_sym] = true
end
api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new
p api_instance.get_web_integration_account("integration_name", "account_id")
8 changes: 8 additions & 0 deletions examples/v2/web-integrations/ListWebIntegrationAccounts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List web integration accounts returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_web_integration_accounts".to_sym] = true
end
api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new
p api_instance.list_web_integration_accounts("integration_name")
19 changes: 19 additions & 0 deletions examples/v2/web-integrations/UpdateWebIntegrationAccount.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Update a web integration account returns "OK" response

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

body = DatadogAPIClient::V2::WebIntegrationAccountUpdateRequest.new({
data: DatadogAPIClient::V2::WebIntegrationAccountUpdateRequestData.new({
attributes: DatadogAPIClient::V2::WebIntegrationAccountUpdateRequestAttributes.new({
name: "my-databricks-account",
secrets: DatadogAPIClient::V2::WebIntegrationAccountSecrets.new({}),
settings: DatadogAPIClient::V2::WebIntegrationAccountSettings.new({}),
}),
type: DatadogAPIClient::V2::WebIntegrationAccountType::ACCOUNT,
}),
})
p api_instance.update_web_integration_account("integration_name", "account_id", body)
20 changes: 20 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4628,6 +4628,26 @@
"team_id" => "String",
"body" => "IncidentTeamUpdateRequest",
},
"v2.ListWebIntegrationAccounts" => {
"integration_name" => "String",
},
"v2.CreateWebIntegrationAccount" => {
"integration_name" => "String",
"body" => "WebIntegrationAccountCreateRequest",
},
"v2.DeleteWebIntegrationAccount" => {
"integration_name" => "String",
"account_id" => "String",
},
"v2.GetWebIntegrationAccount" => {
"integration_name" => "String",
"account_id" => "String",
},
"v2.UpdateWebIntegrationAccount" => {
"integration_name" => "String",
"account_id" => "String",
"body" => "WebIntegrationAccountUpdateRequest",
},
"v2.SearchWidgets" => {
"experience_type" => "WidgetExperienceType",
"filter_widget_type" => "WidgetType",
Expand Down
16 changes: 16 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -1570,6 +1570,22 @@
"tag": "Users",
"operationId": "CreateUser"
},
{
"parameters": [
{
"name": "integration_name",
"value": "\"databricks\""
},
{
"name": "body",
"value": "{\n \"data\": {\n \"type\": \"Account\",\n \"attributes\": {\n \"name\": \"{{ unique_lower_alnum }}\",\n \"settings\": {\n \"workspace_url\": \"https://example.azuredatabricks.net\"\n },\n \"secrets\": {\n \"client_secret\": \"fake-client-secret\"\n }\n }\n }\n}"
}
],
"step": "there is a valid \"web_integration_account\" in the system",
"key": "web_integration_account",
"tag": "Web Integrations",
"operationId": "CreateWebIntegrationAccount"
},
{
"parameters": [
{
Expand Down
41 changes: 41 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7146,6 +7146,47 @@
"type": "safe"
}
},
"ListWebIntegrationAccounts": {
"tag": "Web Integrations",
"undo": {
"type": "safe"
}
},
"CreateWebIntegrationAccount": {
"tag": "Web Integrations",
"undo": {
"operationId": "DeleteWebIntegrationAccount",
"parameters": [
{
"name": "integration_name",
"template": "\"{{ integration_name }}\""
},
{
"name": "account_id",
"source": "data.id"
}
],
"type": "unsafe"
}
},
"DeleteWebIntegrationAccount": {
"tag": "Web Integrations",
"undo": {
"type": "idempotent"
}
},
"GetWebIntegrationAccount": {
"tag": "Web Integrations",
"undo": {
"type": "safe"
}
},
"UpdateWebIntegrationAccount": {
"tag": "Web Integrations",
"undo": {
"type": "idempotent"
}
},
"SearchWidgets": {
"tag": "Widgets",
"undo": {
Expand Down
164 changes: 164 additions & 0 deletions features/v2/web_integrations.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
@endpoint(web-integrations) @endpoint(web-integrations-v2)
Feature: Web Integrations
Manage web integration accounts programmatically through the Datadog API.
See the [Web Integrations page](https://app.datadoghq.com/integrations)
for more information.

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

@generated @skip @team:DataDog/saas-integrations
Scenario: Create a web integration account returns "Bad Request" response
Given operation "CreateWebIntegrationAccount" enabled
And new "CreateWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Create a web integration account returns "CREATED" response
Given operation "CreateWebIntegrationAccount" enabled
And new "CreateWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:DataDog/saas-integrations
Scenario: Create a web integration account returns "Not Found" response
Given operation "CreateWebIntegrationAccount" enabled
And new "CreateWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: Create a web integration account returns "The server cannot process the request because it contains invalid data." response
Given operation "CreateWebIntegrationAccount" enabled
And new "CreateWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}}
When the request is sent
Then the response status is 422 The server cannot process the request because it contains invalid data.

@generated @skip @team:DataDog/saas-integrations
Scenario: Delete a web integration account returns "Bad Request" response
Given operation "DeleteWebIntegrationAccount" enabled
And new "DeleteWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Delete a web integration account returns "Not Found" response
Given operation "DeleteWebIntegrationAccount" enabled
And new "DeleteWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: Delete a web integration account returns "OK" response
Given operation "DeleteWebIntegrationAccount" enabled
And new "DeleteWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 OK

@generated @skip @team:DataDog/saas-integrations
Scenario: Get a web integration account returns "Bad Request" response
Given operation "GetWebIntegrationAccount" enabled
And new "GetWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Get a web integration account returns "Not Found" response
Given operation "GetWebIntegrationAccount" enabled
And new "GetWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: Get a web integration account returns "OK" response
Given operation "GetWebIntegrationAccount" enabled
And new "GetWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/saas-integrations
Scenario: List web integration accounts returns "Bad Request" response
Given operation "ListWebIntegrationAccounts" enabled
And new "ListWebIntegrationAccounts" request
And request contains "integration_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: List web integration accounts returns "Not Found" response
Given operation "ListWebIntegrationAccounts" enabled
And new "ListWebIntegrationAccounts" request
And request contains "integration_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: List web integration accounts returns "OK" response
Given operation "ListWebIntegrationAccounts" enabled
And new "ListWebIntegrationAccounts" request
And request contains "integration_name" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/saas-integrations
Scenario: Update a web integration account returns "Bad Request" response
Given operation "UpdateWebIntegrationAccount" enabled
And new "UpdateWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/saas-integrations
Scenario: Update a web integration account returns "Not Found" response
Given operation "UpdateWebIntegrationAccount" enabled
And new "UpdateWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/saas-integrations
Scenario: Update a web integration account returns "OK" response
Given operation "UpdateWebIntegrationAccount" enabled
And new "UpdateWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/saas-integrations
Scenario: Update a web integration account returns "The server cannot process the request because it contains invalid data." response
Given operation "UpdateWebIntegrationAccount" enabled
And new "UpdateWebIntegrationAccount" request
And request contains "integration_name" parameter from "REPLACE.ME"
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "my-databricks-account", "secrets": {"client_secret": "my-client-secret"}, "settings": {"workspace_url": "https://example.azuredatabricks.net"}}, "type": "Account"}}
When the request is sent
Then the response status is 422 The server cannot process the request because it contains invalid data.
5 changes: 5 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@ def initialize
"v2.get_incident_team": false,
"v2.list_incident_teams": false,
"v2.update_incident_team": false,
"v2.create_web_integration_account": false,
"v2.delete_web_integration_account": false,
"v2.get_web_integration_account": false,
"v2.list_web_integration_accounts": false,
"v2.update_web_integration_account": false,
}
@server_variables[:site] = ENV['DD_SITE'] if ENV.key? 'DD_SITE'
@api_key['apiKeyAuth'] = ENV['DD_API_KEY'] if ENV.key? 'DD_API_KEY'
Expand Down
12 changes: 12 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6311,6 +6311,17 @@ def overrides
"v2.watcher_data" => "WatcherData",
"v2.watcher_data_attributes" => "WatcherDataAttributes",
"v2.watcher_data_type" => "WatcherDataType",
"v2.web_integration_account_create_request" => "WebIntegrationAccountCreateRequest",
"v2.web_integration_account_create_request_attributes" => "WebIntegrationAccountCreateRequestAttributes",
"v2.web_integration_account_create_request_data" => "WebIntegrationAccountCreateRequestData",
"v2.web_integration_account_response" => "WebIntegrationAccountResponse",
"v2.web_integration_account_response_attributes" => "WebIntegrationAccountResponseAttributes",
"v2.web_integration_account_response_data" => "WebIntegrationAccountResponseData",
"v2.web_integration_accounts_response" => "WebIntegrationAccountsResponse",
"v2.web_integration_account_type" => "WebIntegrationAccountType",
"v2.web_integration_account_update_request" => "WebIntegrationAccountUpdateRequest",
"v2.web_integration_account_update_request_attributes" => "WebIntegrationAccountUpdateRequestAttributes",
"v2.web_integration_account_update_request_data" => "WebIntegrationAccountUpdateRequestData",
"v2.weekday" => "Weekday",
"v2.widget_attributes" => "WidgetAttributes",
"v2.widget_data" => "WidgetData",
Expand Down Expand Up @@ -6494,6 +6505,7 @@ def overrides
"v2.test_optimization_api" => "TestOptimizationAPI",
"v2.usage_metering_api" => "UsageMeteringAPI",
"v2.users_api" => "UsersAPI",
"v2.web_integrations_api" => "WebIntegrationsAPI",
"v2.widgets_api" => "WidgetsAPI",
"v2.workflow_automation_api" => "WorkflowAutomationAPI"
}
Expand Down
Loading
Loading