Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,080 changes: 1,062 additions & 18 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Create a deployment returns "CREATED" response
# Create a configuration deployment returns "CREATED" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
Expand Down
23 changes: 23 additions & 0 deletions examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Upgrade hosts returns "CREATED" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_fleet_deployment_upgrade".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new

body = DatadogAPIClient::V2::FleetDeploymentPackageUpgradeCreateRequest.new({
data: DatadogAPIClient::V2::FleetDeploymentPackageUpgradeCreate.new({
attributes: DatadogAPIClient::V2::FleetDeploymentPackageUpgradeAttributes.new({
filter_query: "env:prod AND service:web",
target_packages: [
DatadogAPIClient::V2::FleetDeploymentPackage.new({
name: "datadog-agent",
version: "7.52.0",
}),
],
}),
type: DatadogAPIClient::V2::FleetDeploymentResourceType::DEPLOYMENT,
}),
})
p api_instance.create_fleet_deployment_upgrade(body)
30 changes: 30 additions & 0 deletions examples/v2/fleet-automation/CreateFleetSchedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Create a schedule returns "CREATED" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_fleet_schedule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new

body = DatadogAPIClient::V2::FleetScheduleCreateRequest.new({
data: DatadogAPIClient::V2::FleetScheduleCreate.new({
attributes: DatadogAPIClient::V2::FleetScheduleCreateAttributes.new({
name: "Weekly Production Agent Updates",
query: "env:prod AND service:web",
rule: DatadogAPIClient::V2::FleetScheduleRecurrenceRule.new({
days_of_week: [
"Mon",
"Wed",
"Fri",
],
maintenance_window_duration: 1200,
start_maintenance_window: "02:00",
timezone: "America/New_York",
}),
status: DatadogAPIClient::V2::FleetScheduleStatus::ACTIVE,
version_to_latest: 0,
}),
type: DatadogAPIClient::V2::FleetScheduleResourceType::SCHEDULE,
}),
})
p api_instance.create_fleet_schedule(body)
8 changes: 8 additions & 0 deletions examples/v2/fleet-automation/DeleteFleetSchedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Delete a schedule returns "Schedule successfully deleted." response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.delete_fleet_schedule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
api_instance.delete_fleet_schedule("id")
7 changes: 2 additions & 5 deletions examples/v2/fleet-automation/GetFleetDeployment.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Get a deployment by ID returns "OK" response
# Get a configuration deployment by ID returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_fleet_deployment".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new

# there is a valid "deployment" in the system
DEPLOYMENT_ID = ENV["DEPLOYMENT_ID"]
p api_instance.get_fleet_deployment(DEPLOYMENT_ID)
p api_instance.get_fleet_deployment("deployment_id")
11 changes: 11 additions & 0 deletions examples/v2/fleet-automation/GetFleetDeployment_1482493803.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Get a deployment by ID returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_fleet_deployment".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new

# there is a valid "deployment" in the system
DEPLOYMENT_ID = ENV["DEPLOYMENT_ID"]
p api_instance.get_fleet_deployment(DEPLOYMENT_ID)
8 changes: 8 additions & 0 deletions examples/v2/fleet-automation/GetFleetSchedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a schedule by ID returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_fleet_schedule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
p api_instance.get_fleet_schedule("id")
8 changes: 8 additions & 0 deletions examples/v2/fleet-automation/ListFleetAgentVersions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List all available Agent versions returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_fleet_agent_versions".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
p api_instance.list_fleet_agent_versions()
8 changes: 8 additions & 0 deletions examples/v2/fleet-automation/ListFleetSchedules.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List all schedules returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_fleet_schedules".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
p api_instance.list_fleet_schedules()
8 changes: 8 additions & 0 deletions examples/v2/fleet-automation/TriggerFleetSchedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Trigger a schedule deployment returns "CREATED - Deployment successfully created and started." response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.trigger_fleet_schedule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
p api_instance.trigger_fleet_schedule("id")
30 changes: 30 additions & 0 deletions examples/v2/fleet-automation/UpdateFleetSchedule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Update a schedule returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_fleet_schedule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new

body = DatadogAPIClient::V2::FleetSchedulePatchRequest.new({
data: DatadogAPIClient::V2::FleetSchedulePatch.new({
attributes: DatadogAPIClient::V2::FleetSchedulePatchAttributes.new({
name: "Weekly Production Agent Updates",
query: "env:prod AND service:web",
rule: DatadogAPIClient::V2::FleetScheduleRecurrenceRule.new({
days_of_week: [
"Mon",
"Wed",
"Fri",
],
maintenance_window_duration: 1200,
start_maintenance_window: "02:00",
timezone: "America/New_York",
}),
status: DatadogAPIClient::V2::FleetScheduleStatus::ACTIVE,
version_to_latest: 0,
}),
type: DatadogAPIClient::V2::FleetScheduleResourceType::SCHEDULE,
}),
})
p api_instance.update_fleet_schedule("id", body)
21 changes: 21 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -845,12 +845,33 @@
"v2.CreateFleetDeploymentConfigure" => {
"body" => "FleetDeploymentConfigureCreateRequest",
},
"v2.CreateFleetDeploymentUpgrade" => {
"body" => "FleetDeploymentPackageUpgradeCreateRequest",
},
"v2.GetFleetDeployment" => {
"deployment_id" => "String",
"limit" => "Integer",
"page" => "Integer",
},
"v2.CancelFleetDeployment" => {
"deployment_id" => "String",
},
"v2.CreateFleetSchedule" => {
"body" => "FleetScheduleCreateRequest",
},
"v2.DeleteFleetSchedule" => {
"id" => "String",
},
"v2.GetFleetSchedule" => {
"id" => "String",
},
"v2.UpdateFleetSchedule" => {
"id" => "String",
"body" => "FleetSchedulePatchRequest",
},
"v2.TriggerFleetSchedule" => {
"id" => "String",
},
"v2.CreateDatastore" => {
"body" => "CreateAppsDatastoreRequest",
},
Expand Down
Loading
Loading