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
422 changes: 422 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions examples/v2_fleet-automation_CancelFleetDeployment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Cancel a deployment returns "Deployment successfully canceled." response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CancelFleetDeployment", true);
let api = FleetAutomationAPI::with_config(configuration);
let resp = api
.cancel_fleet_deployment("deployment_id".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
36 changes: 36 additions & 0 deletions examples/v2_fleet-automation_CreateFleetDeploymentConfigure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Create a deployment returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
use datadog_api_client::datadogV2::model::FleetDeploymentConfigureAttributes;
use datadog_api_client::datadogV2::model::FleetDeploymentConfigureCreate;
use datadog_api_client::datadogV2::model::FleetDeploymentConfigureCreateRequest;
use datadog_api_client::datadogV2::model::FleetDeploymentFileOp;
use datadog_api_client::datadogV2::model::FleetDeploymentOperation;
use datadog_api_client::datadogV2::model::FleetDeploymentResourceType;
use serde_json::Value;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
let body = FleetDeploymentConfigureCreateRequest::new(FleetDeploymentConfigureCreate::new(
FleetDeploymentConfigureAttributes::new(vec![FleetDeploymentOperation::new(
FleetDeploymentFileOp::MERGE_PATCH,
"/datadog.yaml".to_string(),
)
.patch(BTreeMap::from([
("log_level".to_string(), Value::from("debug")),
("logs_enabled".to_string(), Value::from("True")),
]))])
.filter_query("env:prod AND service:web".to_string()),
FleetDeploymentResourceType::DEPLOYMENT,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateFleetDeploymentConfigure", true);
let api = FleetAutomationAPI::with_config(configuration);
let resp = api.create_fleet_deployment_configure(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
18 changes: 18 additions & 0 deletions examples/v2_fleet-automation_GetFleetDeployment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Get a deployment by ID returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;

#[tokio::main]
async fn main() {
// there is a valid "deployment" in the system
let deployment_id = std::env::var("DEPLOYMENT_ID").unwrap();
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetFleetDeployment", true);
let api = FleetAutomationAPI::with_config(configuration);
let resp = api.get_fleet_deployment(deployment_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
19 changes: 19 additions & 0 deletions examples/v2_fleet-automation_ListFleetDeployments.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// List all deployments returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;
use datadog_api_client::datadogV2::api_fleet_automation::ListFleetDeploymentsOptionalParams;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListFleetDeployments", true);
let api = FleetAutomationAPI::with_config(configuration);
let resp = api
.list_fleet_deployments(ListFleetDeploymentsOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
4 changes: 4 additions & 0 deletions src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ impl Configuration {
impl Default for Configuration {
fn default() -> Self {
let unstable_operations = HashMap::from([
("v2.cancel_fleet_deployment".to_owned(), false),
("v2.create_fleet_deployment_configure".to_owned(), false),
("v2.get_fleet_deployment".to_owned(), false),
("v2.list_fleet_deployments".to_owned(), false),
("v2.create_open_api".to_owned(), false),
("v2.delete_open_api".to_owned(), false),
("v2.get_open_api".to_owned(), false),
Expand Down
Loading