Skip to content

Commit f5eee85

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6c9eaa8 of spec repo
1 parent a1d9aa6 commit f5eee85

23 files changed

+2146
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 387 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Cancel an update config returns "NO CONTENT" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.cancel_update_config".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
api_instance.cancel_update_config("update_config_id")
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Create an update config returns "CREATED" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_update_config".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
9+
body = DatadogAPIClient::V2::UpdateConfigCreateRequest.new({
10+
data: DatadogAPIClient::V2::UpdateConfigCreate.new({
11+
attributes: DatadogAPIClient::V2::UpdateConfigAttributes.new({
12+
config_operations: [
13+
DatadogAPIClient::V2::UpdateConfigOperation.new({
14+
file_op: DatadogAPIClient::V2::UpdateConfigFileOp::MERGE_PATCH,
15+
file_path: "/etc/datadog-agent/datadog.yaml",
16+
patch: {
17+
"apm_config": "{'enabled': True}", "log_level": "debug", "logs_enabled": "True",
18+
},
19+
}),
20+
],
21+
filter_query: "env:prod AND service:web",
22+
}),
23+
type: DatadogAPIClient::V2::UpdateConfigResourceType::UPDATE_CONFIG,
24+
}),
25+
})
26+
p api_instance.create_update_config(body)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Get an update config returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_update_config".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
9+
# there is a valid "update_config" in the system
10+
UPDATE_CONFIG_ID = ENV["UPDATE_CONFIG_ID"]
11+
p api_instance.get_update_config(UPDATE_CONFIG_ID)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get all update configs returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_update_configs".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
p api_instance.list_update_configs()

features/scenarios_model_mapping.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,19 @@
838838
"user_handle" => "String",
839839
"body" => "User",
840840
},
841+
"v2.ListUpdateConfigs" => {
842+
"page_size" => "Integer",
843+
"page_offset" => "Integer",
844+
},
845+
"v2.CreateUpdateConfig" => {
846+
"body" => "UpdateConfigCreateRequest",
847+
},
848+
"v2.CancelUpdateConfig" => {
849+
"update_config_id" => "String",
850+
},
851+
"v2.GetUpdateConfig" => {
852+
"update_config_id" => "String",
853+
},
841854
"v2.CreateDatastore" => {
842855
"body" => "CreateAppsDatastoreRequest",
843856
},
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
@endpoint(fleet-automation) @endpoint(fleet-automation-v2)
2+
Feature: Fleet Automation
3+
Manage fleet automation update configurations for remote config products.
4+
5+
Background:
6+
Given a valid "apiKeyAuth" key in the system
7+
And a valid "appKeyAuth" key in the system
8+
And an instance of "FleetAutomation" API
9+
10+
@generated @skip @team:DataDog/fleet-automation
11+
Scenario: Cancel an update config returns "Bad Request" response
12+
Given operation "CancelUpdateConfig" enabled
13+
And new "CancelUpdateConfig" request
14+
And request contains "update_config_id" parameter from "REPLACE.ME"
15+
When the request is sent
16+
Then the response status is 400 Bad Request
17+
18+
@generated @skip @team:DataDog/fleet-automation
19+
Scenario: Cancel an update config returns "NO CONTENT" response
20+
Given operation "CancelUpdateConfig" enabled
21+
And new "CancelUpdateConfig" request
22+
And request contains "update_config_id" parameter from "REPLACE.ME"
23+
When the request is sent
24+
Then the response status is 204 NO CONTENT
25+
26+
@generated @skip @team:DataDog/fleet-automation
27+
Scenario: Cancel an update config returns "Not Found" response
28+
Given operation "CancelUpdateConfig" enabled
29+
And new "CancelUpdateConfig" request
30+
And request contains "update_config_id" parameter from "REPLACE.ME"
31+
When the request is sent
32+
Then the response status is 404 Not Found
33+
34+
@generated @skip @team:DataDog/fleet-automation
35+
Scenario: Create an update config returns "Bad Request" response
36+
Given operation "CreateUpdateConfig" enabled
37+
And new "CreateUpdateConfig" request
38+
And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/etc/datadog-agent/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "update_config"}}
39+
When the request is sent
40+
Then the response status is 400 Bad Request
41+
42+
@skip @team:DataDog/fleet-automation
43+
Scenario: Create an update config returns "CREATED" response
44+
Given operation "CreateUpdateConfig" enabled
45+
And new "CreateUpdateConfig" request
46+
And body with value {"data": {"id": "abcdefg", "attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/etc/datadog-agent/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "update_config"}}
47+
When the request is sent
48+
Then the response status is 201 CREATED
49+
50+
@generated @skip @team:DataDog/fleet-automation
51+
Scenario: Get all update configs returns "Bad Request" response
52+
Given operation "ListUpdateConfigs" enabled
53+
And new "ListUpdateConfigs" request
54+
When the request is sent
55+
Then the response status is 400 Bad Request
56+
57+
@generated @skip @team:DataDog/fleet-automation
58+
Scenario: Get all update configs returns "OK" response
59+
Given operation "ListUpdateConfigs" enabled
60+
And new "ListUpdateConfigs" request
61+
When the request is sent
62+
Then the response status is 200 OK
63+
64+
@generated @skip @team:DataDog/fleet-automation
65+
Scenario: Get an update config returns "Bad Request" response
66+
Given operation "GetUpdateConfig" enabled
67+
And new "GetUpdateConfig" request
68+
And request contains "update_config_id" parameter from "REPLACE.ME"
69+
When the request is sent
70+
Then the response status is 400 Bad Request
71+
72+
@generated @skip @team:DataDog/fleet-automation
73+
Scenario: Get an update config returns "Not Found" response
74+
Given operation "GetUpdateConfig" enabled
75+
And new "GetUpdateConfig" request
76+
And request contains "update_config_id" parameter from "REPLACE.ME"
77+
When the request is sent
78+
Then the response status is 404 Not Found
79+
80+
@skip @team:DataDog/fleet-automation
81+
Scenario: Get an update config returns "OK" response
82+
Given operation "GetUpdateConfig" enabled
83+
And new "GetUpdateConfig" request
84+
And there is a valid "update_config" in the system
85+
And request contains "update_config_id" parameter from "update_config.id"
86+
When the request is sent
87+
Then the response status is 200 OK

features/v2/given.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
[
2+
{
3+
"parameters": [
4+
{
5+
"name": "body",
6+
"value": "{\n \"data\": {\n \"type\": \"update_config\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"config_operations\": [\n {\n \"file_op\": \"merge-patch\",\n \"file_path\": \"/etc/datadog-agent/datadog.yaml\",\n \"patch\": {\n \"log_level\": \"info\"\n }\n }\n ]\n }\n }\n}"
7+
}
8+
],
9+
"source": "data",
10+
"step": "there is a valid \"update_config\" in the system",
11+
"key": "update_config",
12+
"tag": "Fleet Automation",
13+
"operationId": "CreateUpdateConfig"
14+
},
215
{
316
"parameters": [
417
{

features/v2/undo.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
11
{
2+
"ListUpdateConfigs": {
3+
"tag": "Fleet Automation",
4+
"undo": {
5+
"type": "safe"
6+
}
7+
},
8+
"CreateUpdateConfig": {
9+
"tag": "Fleet Automation",
10+
"undo": {
11+
"operationId": "CancelUpdateConfig",
12+
"parameters": [
13+
{
14+
"name": "update_config_id",
15+
"source": "data.id"
16+
}
17+
],
18+
"type": "unsafe"
19+
}
20+
},
21+
"CancelUpdateConfig": {
22+
"tag": "Fleet Automation",
23+
"undo": {
24+
"type": "idempotent"
25+
}
26+
},
27+
"GetUpdateConfig": {
28+
"tag": "Fleet Automation",
29+
"undo": {
30+
"type": "safe"
31+
}
32+
},
233
"ListDatastores": {
334
"tag": "Actions Datastores",
435
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ def initialize
189189
@http_proxypass = nil
190190
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
191191
@unstable_operations = {
192+
"v2.cancel_update_config": false,
193+
"v2.create_update_config": false,
194+
"v2.get_update_config": false,
195+
"v2.list_update_configs": false,
192196
"v2.create_open_api": false,
193197
"v2.delete_open_api": false,
194198
"v2.get_open_api": false,

0 commit comments

Comments
 (0)