Skip to content

Commit 50312ac

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bf5a1a8 of spec repo
1 parent a1d9aa6 commit 50312ac

25 files changed

+2371
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 440 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 "configuration update successfully canceled." 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::UpdateConfigCreateAttributes.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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get an update config by ID 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+
p api_instance.get_update_config("update_config_id")
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+
# List 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: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
@endpoint(fleet-automation) @endpoint(fleet-automation-v2)
2+
Feature: Fleet Automation
3+
Manage automated configuration updates across your fleet of hosts. Use
4+
these endpoints to create, retrieve, and cancel configuration updates that
5+
apply configuration changes to multiple hosts simultaneously.
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 "FleetAutomation" API
11+
12+
@generated @skip @team:DataDog/fleet-automation
13+
Scenario: Cancel an update config returns "Bad Request" response
14+
Given operation "CancelUpdateConfig" enabled
15+
And new "CancelUpdateConfig" request
16+
And request contains "update_config_id" parameter from "REPLACE.ME"
17+
When the request is sent
18+
Then the response status is 400 Bad Request
19+
20+
@generated @skip @team:DataDog/fleet-automation
21+
Scenario: Cancel an update config returns "Not Found" response
22+
Given operation "CancelUpdateConfig" enabled
23+
And new "CancelUpdateConfig" request
24+
And request contains "update_config_id" parameter from "REPLACE.ME"
25+
When the request is sent
26+
Then the response status is 404 Not Found
27+
28+
@generated @skip @team:DataDog/fleet-automation
29+
Scenario: Cancel an update config returns "configuration update successfully canceled." response
30+
Given operation "CancelUpdateConfig" enabled
31+
And new "CancelUpdateConfig" request
32+
And request contains "update_config_id" parameter from "REPLACE.ME"
33+
When the request is sent
34+
Then the response status is 204 configuration update successfully canceled.
35+
36+
@generated @skip @team:DataDog/fleet-automation
37+
Scenario: Create an update config returns "Bad Request" response
38+
Given operation "CreateUpdateConfig" enabled
39+
And new "CreateUpdateConfig" request
40+
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"}}
41+
When the request is sent
42+
Then the response status is 400 Bad Request
43+
44+
@skip @team:DataDog/fleet-automation
45+
Scenario: Create an update config returns "CREATED" response
46+
Given operation "CreateUpdateConfig" enabled
47+
And new "CreateUpdateConfig" request
48+
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"}}
49+
When the request is sent
50+
Then the response status is 201 CREATED
51+
52+
@generated @skip @team:DataDog/fleet-automation
53+
Scenario: Get an update config by ID returns "Bad Request" response
54+
Given operation "GetUpdateConfig" enabled
55+
And new "GetUpdateConfig" request
56+
And request contains "update_config_id" parameter from "REPLACE.ME"
57+
When the request is sent
58+
Then the response status is 400 Bad Request
59+
60+
@generated @skip @team:DataDog/fleet-automation
61+
Scenario: Get an update config by ID returns "Not Found" response
62+
Given operation "GetUpdateConfig" enabled
63+
And new "GetUpdateConfig" request
64+
And request contains "update_config_id" parameter from "REPLACE.ME"
65+
When the request is sent
66+
Then the response status is 404 Not Found
67+
68+
@generated @skip @team:DataDog/fleet-automation
69+
Scenario: Get an update config by ID returns "OK" response
70+
Given operation "GetUpdateConfig" enabled
71+
And new "GetUpdateConfig" request
72+
And request contains "update_config_id" parameter from "REPLACE.ME"
73+
When the request is sent
74+
Then the response status is 200 OK
75+
76+
@skip @team:DataDog/fleet-automation
77+
Scenario: Get an update config returns "OK" response
78+
Given operation "GetUpdateConfig" enabled
79+
And new "GetUpdateConfig" request
80+
And there is a valid "update_config" in the system
81+
And request contains "update_config_id" parameter from "update_config.id"
82+
When the request is sent
83+
Then the response status is 200 OK
84+
85+
@generated @skip @team:DataDog/fleet-automation
86+
Scenario: List all update configs returns "Bad Request" response
87+
Given operation "ListUpdateConfigs" enabled
88+
And new "ListUpdateConfigs" request
89+
When the request is sent
90+
Then the response status is 400 Bad Request
91+
92+
@generated @skip @team:DataDog/fleet-automation
93+
Scenario: List all update configs returns "OK" response
94+
Given operation "ListUpdateConfigs" enabled
95+
And new "ListUpdateConfigs" request
96+
When the request is sent
97+
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": {

0 commit comments

Comments
 (0)