Skip to content

Commit c487d5c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e118b2e of spec repo
1 parent c222047 commit c487d5c

24 files changed

+2337
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 422 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 a deployment returns "Deployment successfully canceled." response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.cancel_fleet_deployment".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
api_instance.cancel_fleet_deployment("deployment_id")
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Create a deployment returns "CREATED" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_fleet_deployment_configure".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
9+
body = DatadogAPIClient::V2::FleetDeploymentConfigureCreateRequest.new({
10+
data: DatadogAPIClient::V2::FleetDeploymentConfigureCreate.new({
11+
attributes: DatadogAPIClient::V2::FleetDeploymentConfigureAttributes.new({
12+
config_operations: [
13+
DatadogAPIClient::V2::FleetDeploymentOperation.new({
14+
file_op: DatadogAPIClient::V2::FleetDeploymentFileOp::MERGE_PATCH,
15+
file_path: "/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::FleetDeploymentResourceType::DEPLOYMENT,
24+
}),
25+
})
26+
p api_instance.create_fleet_deployment_configure(body)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Get a deployment by ID returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_fleet_deployment".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
9+
# there is a valid "deployment" in the system
10+
DEPLOYMENT_ID = ENV["DEPLOYMENT_ID"]
11+
p api_instance.get_fleet_deployment(DEPLOYMENT_ID)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List all deployments returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_fleet_deployments".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
p api_instance.list_fleet_deployments()

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.ListFleetDeployments" => {
842+
"page_size" => "Integer",
843+
"page_offset" => "Integer",
844+
},
845+
"v2.CreateFleetDeploymentConfigure" => {
846+
"body" => "FleetDeploymentConfigureCreateRequest",
847+
},
848+
"v2.GetFleetDeployment" => {
849+
"deployment_id" => "String",
850+
},
851+
"v2.CancelFleetDeployment" => {
852+
"deployment_id" => "String",
853+
},
841854
"v2.CreateDatastore" => {
842855
"body" => "CreateAppsDatastoreRequest",
843856
},
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
@endpoint(fleet-automation) @endpoint(fleet-automation-v2)
2+
Feature: Fleet Automation
3+
Manage automated deployments across your fleet of hosts. Use these
4+
endpoints to create, retrieve, and cancel deployments that apply
5+
configuration changes to multiple hosts at once.
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 a deployment returns "Bad Request" response
14+
Given operation "CancelFleetDeployment" enabled
15+
And new "CancelFleetDeployment" request
16+
And request contains "deployment_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 a deployment returns "Deployment successfully canceled." response
22+
Given operation "CancelFleetDeployment" enabled
23+
And new "CancelFleetDeployment" request
24+
And request contains "deployment_id" parameter from "REPLACE.ME"
25+
When the request is sent
26+
Then the response status is 204 Deployment successfully canceled.
27+
28+
@generated @skip @team:DataDog/fleet-automation
29+
Scenario: Cancel a deployment returns "Not Found" response
30+
Given operation "CancelFleetDeployment" enabled
31+
And new "CancelFleetDeployment" request
32+
And request contains "deployment_id" parameter from "REPLACE.ME"
33+
When the request is sent
34+
Then the response status is 404 Not Found
35+
36+
@generated @skip @team:DataDog/fleet-automation
37+
Scenario: Create a deployment returns "Bad Request" response
38+
Given operation "CreateFleetDeploymentConfigure" enabled
39+
And new "CreateFleetDeploymentConfigure" request
40+
And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "deployment"}}
41+
When the request is sent
42+
Then the response status is 400 Bad Request
43+
44+
@generated @skip @team:DataDog/fleet-automation
45+
Scenario: Create a deployment returns "CREATED" response
46+
Given operation "CreateFleetDeploymentConfigure" enabled
47+
And new "CreateFleetDeploymentConfigure" request
48+
And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "deployment"}}
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 a deployment by ID returns "Bad Request" response
54+
Given operation "GetFleetDeployment" enabled
55+
And new "GetFleetDeployment" request
56+
And request contains "deployment_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 a deployment by ID returns "Not Found" response
62+
Given operation "GetFleetDeployment" enabled
63+
And new "GetFleetDeployment" request
64+
And request contains "deployment_id" parameter from "REPLACE.ME"
65+
When the request is sent
66+
Then the response status is 404 Not Found
67+
68+
@skip @team:DataDog/fleet-automation
69+
Scenario: Get a deployment by ID returns "OK" response
70+
Given operation "GetFleetDeployment" enabled
71+
And there is a valid "deployment" in the system
72+
And new "GetFleetDeployment" request
73+
And request contains "deployment_id" parameter from "deployment.id"
74+
When the request is sent
75+
Then the response status is 200 OK
76+
77+
@generated @skip @team:DataDog/fleet-automation
78+
Scenario: List all deployments returns "Bad Request" response
79+
Given operation "ListFleetDeployments" enabled
80+
And new "ListFleetDeployments" request
81+
When the request is sent
82+
Then the response status is 400 Bad Request
83+
84+
@generated @skip @team:DataDog/fleet-automation
85+
Scenario: List all deployments returns "OK" response
86+
Given operation "ListFleetDeployments" enabled
87+
And new "ListFleetDeployments" request
88+
When the request is sent
89+
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\": \"deployment\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"config_operations\": [\n {\n \"file_op\": \"merge-patch\",\n \"file_path\": \"/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 \"deployment\" in the system",
11+
"key": "deployment",
12+
"tag": "Fleet Automation",
13+
"operationId": "CreateFleetDeploymentConfigure"
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+
"ListFleetDeployments": {
3+
"tag": "Fleet Automation",
4+
"undo": {
5+
"type": "safe"
6+
}
7+
},
8+
"CreateFleetDeploymentConfigure": {
9+
"tag": "Fleet Automation",
10+
"undo": {
11+
"operationId": "CancelFleetDeployment",
12+
"parameters": [
13+
{
14+
"name": "deployment_id",
15+
"source": "data.id"
16+
}
17+
],
18+
"type": "unsafe"
19+
}
20+
},
21+
"GetFleetDeployment": {
22+
"tag": "Fleet Automation",
23+
"undo": {
24+
"type": "safe"
25+
}
26+
},
27+
"CancelFleetDeployment": {
28+
"tag": "Fleet Automation",
29+
"undo": {
30+
"type": "idempotent"
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_fleet_deployment": false,
193+
"v2.create_fleet_deployment_configure": false,
194+
"v2.get_fleet_deployment": false,
195+
"v2.list_fleet_deployments": false,
192196
"v2.create_open_api": false,
193197
"v2.delete_open_api": false,
194198
"v2.get_open_api": false,

0 commit comments

Comments
 (0)