Skip to content

Commit 87dea61

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[FA] Add fleet deployments/upgrade endpoint (#2758)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent fc92cfa commit 87dea61

File tree

49 files changed

+5501
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5501
-49
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 1062 additions & 18 deletions
Large diffs are not rendered by default.

examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Create a deployment returns "CREATED" response
1+
# Create a configuration deployment returns "CREATED" response
22

33
require "datadog_api_client"
44
DatadogAPIClient.configure do |config|
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Upgrade hosts returns "CREATED" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_fleet_deployment_upgrade".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
9+
body = DatadogAPIClient::V2::FleetDeploymentPackageUpgradeCreateRequest.new({
10+
data: DatadogAPIClient::V2::FleetDeploymentPackageUpgradeCreate.new({
11+
attributes: DatadogAPIClient::V2::FleetDeploymentPackageUpgradeAttributes.new({
12+
filter_query: "env:prod AND service:web",
13+
target_packages: [
14+
DatadogAPIClient::V2::FleetDeploymentPackage.new({
15+
name: "datadog-agent",
16+
version: "7.52.0",
17+
}),
18+
],
19+
}),
20+
type: DatadogAPIClient::V2::FleetDeploymentResourceType::DEPLOYMENT,
21+
}),
22+
})
23+
p api_instance.create_fleet_deployment_upgrade(body)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Create a schedule returns "CREATED" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_fleet_schedule".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
9+
body = DatadogAPIClient::V2::FleetScheduleCreateRequest.new({
10+
data: DatadogAPIClient::V2::FleetScheduleCreate.new({
11+
attributes: DatadogAPIClient::V2::FleetScheduleCreateAttributes.new({
12+
name: "Weekly Production Agent Updates",
13+
query: "env:prod AND service:web",
14+
rule: DatadogAPIClient::V2::FleetScheduleRecurrenceRule.new({
15+
days_of_week: [
16+
"Mon",
17+
"Wed",
18+
"Fri",
19+
],
20+
maintenance_window_duration: 1200,
21+
start_maintenance_window: "02:00",
22+
timezone: "America/New_York",
23+
}),
24+
status: DatadogAPIClient::V2::FleetScheduleStatus::ACTIVE,
25+
version_to_latest: 0,
26+
}),
27+
type: DatadogAPIClient::V2::FleetScheduleResourceType::SCHEDULE,
28+
}),
29+
})
30+
p api_instance.create_fleet_schedule(body)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Delete a schedule returns "Schedule successfully deleted." response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.delete_fleet_schedule".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
api_instance.delete_fleet_schedule("id")
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# Get a deployment by ID returns "OK" response
1+
# Get a configuration deployment by ID returns "OK" response
22

33
require "datadog_api_client"
44
DatadogAPIClient.configure do |config|
55
config.unstable_operations["v2.get_fleet_deployment".to_sym] = true
66
end
77
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)
8+
p api_instance.get_fleet_deployment("deployment_id")
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+
# Get a schedule by ID returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_fleet_schedule".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
p api_instance.get_fleet_schedule("id")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List all available Agent versions returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_fleet_agent_versions".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
p api_instance.list_fleet_agent_versions()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List all schedules returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_fleet_schedules".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
p api_instance.list_fleet_schedules()

0 commit comments

Comments
 (0)