Skip to content

Commit 8c512d1

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Web Integrations API spec for AMS generic SaaS integration accounts (DataDog#3297)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent e1079d7 commit 8c512d1

24 files changed

Lines changed: 2495 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 403 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Create a web integration account returns "CREATED" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_web_integration_account".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new
8+
9+
body = DatadogAPIClient::V2::WebIntegrationAccountCreateRequest.new({
10+
data: DatadogAPIClient::V2::WebIntegrationAccountCreateRequestData.new({
11+
attributes: DatadogAPIClient::V2::WebIntegrationAccountCreateRequestAttributes.new({
12+
name: "my-databricks-account",
13+
secrets: DatadogAPIClient::V2::WebIntegrationAccountSecrets.new({}),
14+
settings: DatadogAPIClient::V2::WebIntegrationAccountSettings.new({}),
15+
}),
16+
type: DatadogAPIClient::V2::WebIntegrationAccountType::ACCOUNT,
17+
}),
18+
})
19+
p api_instance.create_web_integration_account("integration_name", body)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Delete a web integration account returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.delete_web_integration_account".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new
8+
api_instance.delete_web_integration_account("integration_name", "account_id")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get a web integration account returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_web_integration_account".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new
8+
p api_instance.get_web_integration_account("integration_name", "account_id")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List web integration accounts returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_web_integration_accounts".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new
8+
p api_instance.list_web_integration_accounts("integration_name")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Update a web integration account returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.update_web_integration_account".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::WebIntegrationsAPI.new
8+
9+
body = DatadogAPIClient::V2::WebIntegrationAccountUpdateRequest.new({
10+
data: DatadogAPIClient::V2::WebIntegrationAccountUpdateRequestData.new({
11+
attributes: DatadogAPIClient::V2::WebIntegrationAccountUpdateRequestAttributes.new({
12+
name: "my-databricks-account",
13+
secrets: DatadogAPIClient::V2::WebIntegrationAccountSecrets.new({}),
14+
settings: DatadogAPIClient::V2::WebIntegrationAccountSettings.new({}),
15+
}),
16+
type: DatadogAPIClient::V2::WebIntegrationAccountType::ACCOUNT,
17+
}),
18+
})
19+
p api_instance.update_web_integration_account("integration_name", "account_id", body)

features/scenarios_model_mapping.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4608,6 +4608,26 @@
46084608
"v2.GetUserMemberships" => {
46094609
"user_uuid" => "String",
46104610
},
4611+
"v2.ListWebIntegrationAccounts" => {
4612+
"integration_name" => "String",
4613+
},
4614+
"v2.CreateWebIntegrationAccount" => {
4615+
"integration_name" => "String",
4616+
"body" => "WebIntegrationAccountCreateRequest",
4617+
},
4618+
"v2.DeleteWebIntegrationAccount" => {
4619+
"integration_name" => "String",
4620+
"account_id" => "String",
4621+
},
4622+
"v2.GetWebIntegrationAccount" => {
4623+
"integration_name" => "String",
4624+
"account_id" => "String",
4625+
},
4626+
"v2.UpdateWebIntegrationAccount" => {
4627+
"integration_name" => "String",
4628+
"account_id" => "String",
4629+
"body" => "WebIntegrationAccountUpdateRequest",
4630+
},
46114631
"v2.SearchWidgets" => {
46124632
"experience_type" => "WidgetExperienceType",
46134633
"filter_widget_type" => "WidgetType",

features/v2/given.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,22 @@
15581558
"tag": "Users",
15591559
"operationId": "CreateUser"
15601560
},
1561+
{
1562+
"parameters": [
1563+
{
1564+
"name": "integration_name",
1565+
"value": "\"databricks\""
1566+
},
1567+
{
1568+
"name": "body",
1569+
"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}"
1570+
}
1571+
],
1572+
"step": "there is a valid \"web_integration_account\" in the system",
1573+
"key": "web_integration_account",
1574+
"tag": "Web Integrations",
1575+
"operationId": "CreateWebIntegrationAccount"
1576+
},
15611577
{
15621578
"parameters": [
15631579
{

features/v2/undo.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7109,6 +7109,47 @@
71097109
"type": "safe"
71107110
}
71117111
},
7112+
"ListWebIntegrationAccounts": {
7113+
"tag": "Web Integrations",
7114+
"undo": {
7115+
"type": "safe"
7116+
}
7117+
},
7118+
"CreateWebIntegrationAccount": {
7119+
"tag": "Web Integrations",
7120+
"undo": {
7121+
"operationId": "DeleteWebIntegrationAccount",
7122+
"parameters": [
7123+
{
7124+
"name": "integration_name",
7125+
"template": "\"{{ integration_name }}\""
7126+
},
7127+
{
7128+
"name": "account_id",
7129+
"source": "data.id"
7130+
}
7131+
],
7132+
"type": "unsafe"
7133+
}
7134+
},
7135+
"DeleteWebIntegrationAccount": {
7136+
"tag": "Web Integrations",
7137+
"undo": {
7138+
"type": "idempotent"
7139+
}
7140+
},
7141+
"GetWebIntegrationAccount": {
7142+
"tag": "Web Integrations",
7143+
"undo": {
7144+
"type": "safe"
7145+
}
7146+
},
7147+
"UpdateWebIntegrationAccount": {
7148+
"tag": "Web Integrations",
7149+
"undo": {
7150+
"type": "idempotent"
7151+
}
7152+
},
71127153
"SearchWidgets": {
71137154
"tag": "Widgets",
71147155
"undo": {
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
@endpoint(web-integrations) @endpoint(web-integrations-v2)
2+
Feature: Web Integrations
3+
Manage web integration accounts programmatically through the Datadog API.
4+
See the [Web Integrations page](https://app.datadoghq.com/integrations)
5+
for more information.
6+
7+
Background:
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "WebIntegrations" API
11+
12+
@generated @skip @team:DataDog/saas-integrations
13+
Scenario: Create a web integration account returns "Bad Request" response
14+
Given operation "CreateWebIntegrationAccount" enabled
15+
And new "CreateWebIntegrationAccount" request
16+
And request contains "integration_name" parameter from "REPLACE.ME"
17+
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"}}
18+
When the request is sent
19+
Then the response status is 400 Bad Request
20+
21+
@generated @skip @team:DataDog/saas-integrations
22+
Scenario: Create a web integration account returns "CREATED" response
23+
Given operation "CreateWebIntegrationAccount" enabled
24+
And new "CreateWebIntegrationAccount" request
25+
And request contains "integration_name" parameter from "REPLACE.ME"
26+
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"}}
27+
When the request is sent
28+
Then the response status is 201 CREATED
29+
30+
@generated @skip @team:DataDog/saas-integrations
31+
Scenario: Create a web integration account returns "Not Found" response
32+
Given operation "CreateWebIntegrationAccount" enabled
33+
And new "CreateWebIntegrationAccount" request
34+
And request contains "integration_name" parameter from "REPLACE.ME"
35+
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"}}
36+
When the request is sent
37+
Then the response status is 404 Not Found
38+
39+
@generated @skip @team:DataDog/saas-integrations
40+
Scenario: Create a web integration account returns "The server cannot process the request because it contains invalid data." response
41+
Given operation "CreateWebIntegrationAccount" enabled
42+
And new "CreateWebIntegrationAccount" request
43+
And request contains "integration_name" parameter from "REPLACE.ME"
44+
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"}}
45+
When the request is sent
46+
Then the response status is 422 The server cannot process the request because it contains invalid data.
47+
48+
@generated @skip @team:DataDog/saas-integrations
49+
Scenario: Delete a web integration account returns "Bad Request" response
50+
Given operation "DeleteWebIntegrationAccount" enabled
51+
And new "DeleteWebIntegrationAccount" request
52+
And request contains "integration_name" parameter from "REPLACE.ME"
53+
And request contains "account_id" parameter from "REPLACE.ME"
54+
When the request is sent
55+
Then the response status is 400 Bad Request
56+
57+
@generated @skip @team:DataDog/saas-integrations
58+
Scenario: Delete a web integration account returns "Not Found" response
59+
Given operation "DeleteWebIntegrationAccount" enabled
60+
And new "DeleteWebIntegrationAccount" request
61+
And request contains "integration_name" parameter from "REPLACE.ME"
62+
And request contains "account_id" parameter from "REPLACE.ME"
63+
When the request is sent
64+
Then the response status is 404 Not Found
65+
66+
@generated @skip @team:DataDog/saas-integrations
67+
Scenario: Delete a web integration account returns "OK" response
68+
Given operation "DeleteWebIntegrationAccount" enabled
69+
And new "DeleteWebIntegrationAccount" request
70+
And request contains "integration_name" parameter from "REPLACE.ME"
71+
And request contains "account_id" parameter from "REPLACE.ME"
72+
When the request is sent
73+
Then the response status is 204 OK
74+
75+
@generated @skip @team:DataDog/saas-integrations
76+
Scenario: Get a web integration account returns "Bad Request" response
77+
Given operation "GetWebIntegrationAccount" enabled
78+
And new "GetWebIntegrationAccount" request
79+
And request contains "integration_name" parameter from "REPLACE.ME"
80+
And request contains "account_id" parameter from "REPLACE.ME"
81+
When the request is sent
82+
Then the response status is 400 Bad Request
83+
84+
@generated @skip @team:DataDog/saas-integrations
85+
Scenario: Get a web integration account returns "Not Found" response
86+
Given operation "GetWebIntegrationAccount" enabled
87+
And new "GetWebIntegrationAccount" request
88+
And request contains "integration_name" parameter from "REPLACE.ME"
89+
And request contains "account_id" parameter from "REPLACE.ME"
90+
When the request is sent
91+
Then the response status is 404 Not Found
92+
93+
@generated @skip @team:DataDog/saas-integrations
94+
Scenario: Get a web integration account returns "OK" response
95+
Given operation "GetWebIntegrationAccount" enabled
96+
And new "GetWebIntegrationAccount" request
97+
And request contains "integration_name" parameter from "REPLACE.ME"
98+
And request contains "account_id" parameter from "REPLACE.ME"
99+
When the request is sent
100+
Then the response status is 200 OK
101+
102+
@generated @skip @team:DataDog/saas-integrations
103+
Scenario: List web integration accounts returns "Bad Request" response
104+
Given operation "ListWebIntegrationAccounts" enabled
105+
And new "ListWebIntegrationAccounts" request
106+
And request contains "integration_name" parameter from "REPLACE.ME"
107+
When the request is sent
108+
Then the response status is 400 Bad Request
109+
110+
@generated @skip @team:DataDog/saas-integrations
111+
Scenario: List web integration accounts returns "Not Found" response
112+
Given operation "ListWebIntegrationAccounts" enabled
113+
And new "ListWebIntegrationAccounts" request
114+
And request contains "integration_name" parameter from "REPLACE.ME"
115+
When the request is sent
116+
Then the response status is 404 Not Found
117+
118+
@generated @skip @team:DataDog/saas-integrations
119+
Scenario: List web integration accounts returns "OK" response
120+
Given operation "ListWebIntegrationAccounts" enabled
121+
And new "ListWebIntegrationAccounts" request
122+
And request contains "integration_name" parameter from "REPLACE.ME"
123+
When the request is sent
124+
Then the response status is 200 OK
125+
126+
@generated @skip @team:DataDog/saas-integrations
127+
Scenario: Update a web integration account returns "Bad Request" response
128+
Given operation "UpdateWebIntegrationAccount" enabled
129+
And new "UpdateWebIntegrationAccount" request
130+
And request contains "integration_name" parameter from "REPLACE.ME"
131+
And request contains "account_id" parameter from "REPLACE.ME"
132+
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"}}
133+
When the request is sent
134+
Then the response status is 400 Bad Request
135+
136+
@generated @skip @team:DataDog/saas-integrations
137+
Scenario: Update a web integration account returns "Not Found" response
138+
Given operation "UpdateWebIntegrationAccount" enabled
139+
And new "UpdateWebIntegrationAccount" request
140+
And request contains "integration_name" parameter from "REPLACE.ME"
141+
And request contains "account_id" parameter from "REPLACE.ME"
142+
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"}}
143+
When the request is sent
144+
Then the response status is 404 Not Found
145+
146+
@generated @skip @team:DataDog/saas-integrations
147+
Scenario: Update a web integration account returns "OK" response
148+
Given operation "UpdateWebIntegrationAccount" enabled
149+
And new "UpdateWebIntegrationAccount" request
150+
And request contains "integration_name" parameter from "REPLACE.ME"
151+
And request contains "account_id" parameter from "REPLACE.ME"
152+
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"}}
153+
When the request is sent
154+
Then the response status is 200 OK
155+
156+
@generated @skip @team:DataDog/saas-integrations
157+
Scenario: Update a web integration account returns "The server cannot process the request because it contains invalid data." response
158+
Given operation "UpdateWebIntegrationAccount" enabled
159+
And new "UpdateWebIntegrationAccount" request
160+
And request contains "integration_name" parameter from "REPLACE.ME"
161+
And request contains "account_id" parameter from "REPLACE.ME"
162+
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"}}
163+
When the request is sent
164+
Then the response status is 422 The server cannot process the request because it contains invalid data.

0 commit comments

Comments
 (0)