Skip to content

Commit cdc8313

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 36383f9 of spec repo
1 parent 22d4e4f commit cdc8313

File tree

44 files changed

+5697
-93
lines changed

Some content is hidden

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

44 files changed

+5697
-93
lines changed

.generator/schemas/v2/openapi.yaml

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

examples/v2_fleet-automation_CreateFleetDeploymentConfigure.rs

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
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
44
use datadog_api_client::datadogV2::model::FleetDeploymentConfigureAttributes;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Create a package upgrade deployment returns "CREATED" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
4+
use datadog_api_client::datadogV2::model::FleetDeploymentPackage;
5+
use datadog_api_client::datadogV2::model::FleetDeploymentPackageUpgradeAttributes;
6+
use datadog_api_client::datadogV2::model::FleetDeploymentPackageUpgradeCreate;
7+
use datadog_api_client::datadogV2::model::FleetDeploymentPackageUpgradeCreateRequest;
8+
use datadog_api_client::datadogV2::model::FleetDeploymentResourceType;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
let body =
13+
FleetDeploymentPackageUpgradeCreateRequest::new(FleetDeploymentPackageUpgradeCreate::new(
14+
FleetDeploymentPackageUpgradeAttributes::new(vec![FleetDeploymentPackage::new(
15+
"datadog-agent".to_string(),
16+
"7.52.0".to_string(),
17+
)])
18+
.filter_query("env:prod AND service:web".to_string()),
19+
FleetDeploymentResourceType::DEPLOYMENT,
20+
));
21+
let mut configuration = datadog::Configuration::new();
22+
configuration.set_unstable_operation_enabled("v2.CreateFleetDeploymentUpgrade", true);
23+
let api = FleetAutomationAPI::with_config(configuration);
24+
let resp = api.create_fleet_deployment_upgrade(body).await;
25+
if let Ok(value) = resp {
26+
println!("{:#?}", value);
27+
} else {
28+
println!("{:#?}", resp.unwrap_err());
29+
}
30+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Create a schedule returns "CREATED" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
4+
use datadog_api_client::datadogV2::model::FleetScheduleCreate;
5+
use datadog_api_client::datadogV2::model::FleetScheduleCreateAttributes;
6+
use datadog_api_client::datadogV2::model::FleetScheduleCreateRequest;
7+
use datadog_api_client::datadogV2::model::FleetScheduleRecurrenceRule;
8+
use datadog_api_client::datadogV2::model::FleetScheduleResourceType;
9+
use datadog_api_client::datadogV2::model::FleetScheduleStatus;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
let body = FleetScheduleCreateRequest::new(FleetScheduleCreate::new(
14+
FleetScheduleCreateAttributes::new(
15+
"Weekly Production Agent Updates".to_string(),
16+
"env:prod AND service:web".to_string(),
17+
FleetScheduleRecurrenceRule::new(
18+
vec!["Mon".to_string(), "Wed".to_string(), "Fri".to_string()],
19+
1200,
20+
"02:00".to_string(),
21+
"America/New_York".to_string(),
22+
),
23+
)
24+
.status(FleetScheduleStatus::ACTIVE)
25+
.version_to_latest(0),
26+
FleetScheduleResourceType::SCHEDULE,
27+
));
28+
let mut configuration = datadog::Configuration::new();
29+
configuration.set_unstable_operation_enabled("v2.CreateFleetSchedule", true);
30+
let api = FleetAutomationAPI::with_config(configuration);
31+
let resp = api.create_fleet_schedule(body).await;
32+
if let Ok(value) = resp {
33+
println!("{:#?}", value);
34+
} else {
35+
println!("{:#?}", resp.unwrap_err());
36+
}
37+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Delete a schedule returns "Schedule successfully deleted." response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.DeleteFleetSchedule", true);
9+
let api = FleetAutomationAPI::with_config(configuration);
10+
let resp = api.delete_fleet_schedule("id".to_string()).await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}

examples/v2_fleet-automation_GetFleetDeployment.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
// Get a deployment by ID returns "OK" response
1+
// Get a configuration deployment by ID returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
4+
use datadog_api_client::datadogV2::api_fleet_automation::GetFleetDeploymentOptionalParams;
45

56
#[tokio::main]
67
async fn main() {
7-
// there is a valid "deployment" in the system
8-
let deployment_id = std::env::var("DEPLOYMENT_ID").unwrap();
98
let mut configuration = datadog::Configuration::new();
109
configuration.set_unstable_operation_enabled("v2.GetFleetDeployment", true);
1110
let api = FleetAutomationAPI::with_config(configuration);
12-
let resp = api.get_fleet_deployment(deployment_id.clone()).await;
11+
let resp = api
12+
.get_fleet_deployment(
13+
"deployment_id".to_string(),
14+
GetFleetDeploymentOptionalParams::default(),
15+
)
16+
.await;
1317
if let Ok(value) = resp {
1418
println!("{:#?}", value);
1519
} else {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Get a deployment by ID returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
4+
use datadog_api_client::datadogV2::api_fleet_automation::GetFleetDeploymentOptionalParams;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
// there is a valid "deployment" in the system
9+
let deployment_id = std::env::var("DEPLOYMENT_ID").unwrap();
10+
let mut configuration = datadog::Configuration::new();
11+
configuration.set_unstable_operation_enabled("v2.GetFleetDeployment", true);
12+
let api = FleetAutomationAPI::with_config(configuration);
13+
let resp = api
14+
.get_fleet_deployment(
15+
deployment_id.clone(),
16+
GetFleetDeploymentOptionalParams::default(),
17+
)
18+
.await;
19+
if let Ok(value) = resp {
20+
println!("{:#?}", value);
21+
} else {
22+
println!("{:#?}", resp.unwrap_err());
23+
}
24+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Get a schedule by ID returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.GetFleetSchedule", true);
9+
let api = FleetAutomationAPI::with_config(configuration);
10+
let resp = api.get_fleet_schedule("id".to_string()).await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// List all schedules returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.ListFleetSchedules", true);
9+
let api = FleetAutomationAPI::with_config(configuration);
10+
let resp = api.list_fleet_schedules().await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Trigger a schedule deployment returns "CREATED - Deployment successfully
2+
// created and started." response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let mut configuration = datadog::Configuration::new();
9+
configuration.set_unstable_operation_enabled("v2.TriggerFleetSchedule", true);
10+
let api = FleetAutomationAPI::with_config(configuration);
11+
let resp = api.trigger_fleet_schedule("id".to_string()).await;
12+
if let Ok(value) = resp {
13+
println!("{:#?}", value);
14+
} else {
15+
println!("{:#?}", resp.unwrap_err());
16+
}
17+
}

0 commit comments

Comments
 (0)