-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit d7fae3ec of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Mar 26, 2024
1 parent
fe83698
commit ed41f92
Showing
33 changed files
with
2,030 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
examples/v2_service-level-objectives_create_slo_report_job.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Create a new SLO report returns "OK" response | ||
use datadog_api_client::datadog::configuration::Configuration; | ||
use datadog_api_client::datadogV2::api::api_service_level_objectives::ServiceLevelObjectivesAPI; | ||
use datadog_api_client::datadogV2::model::SLOReportInterval; | ||
use datadog_api_client::datadogV2::model::SLOReportPostRequest; | ||
use datadog_api_client::datadogV2::model::SLOReportPostRequestData; | ||
use datadog_api_client::datadogV2::model::SloReportPostRequestAttributes; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let body = SLOReportPostRequest::new(SLOReportPostRequestData::new( | ||
SloReportPostRequestAttributes::new( | ||
1690901870, | ||
r#"slo_type:metric "SLO Reporting Test""#.to_string(), | ||
1706803070, | ||
) | ||
.interval(SLOReportInterval::MONTHLY) | ||
.timezone("America/New_York".to_string()), | ||
)); | ||
let mut configuration = Configuration::new(); | ||
configuration.set_unstable_operation_enabled("v2.CreateSLOReportJob", true); | ||
let api = ServiceLevelObjectivesAPI::with_config(configuration); | ||
let resp = api.create_slo_report_job(body).await; | ||
if let Ok(value) = resp { | ||
println!("{:#?}", value); | ||
} else { | ||
println!("{:#?}", resp.unwrap_err()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Get SLO report returns "OK" response | ||
use datadog_api_client::datadog::configuration::Configuration; | ||
use datadog_api_client::datadogV2::api::api_service_level_objectives::ServiceLevelObjectivesAPI; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let mut configuration = Configuration::new(); | ||
configuration.set_unstable_operation_enabled("v2.GetSLOReport", true); | ||
let api = ServiceLevelObjectivesAPI::with_config(configuration); | ||
let resp = api | ||
.get_slo_report("9fb2dc2a-ead0-11ee-a174-9fe3a9d7627f".to_string()) | ||
.await; | ||
if let Ok(value) = resp { | ||
println!("{:#?}", value); | ||
} else { | ||
println!("{:#?}", resp.unwrap_err()); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
examples/v2_service-level-objectives_get_slo_report_job_status.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Get SLO report status returns "OK" response | ||
use datadog_api_client::datadog::configuration::Configuration; | ||
use datadog_api_client::datadogV2::api::api_service_level_objectives::ServiceLevelObjectivesAPI; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
// there is a valid "report" in the system | ||
let report_data_id = std::env::var("REPORT_DATA_ID").unwrap(); | ||
let mut configuration = Configuration::new(); | ||
configuration.set_unstable_operation_enabled("v2.GetSLOReportJobStatus", true); | ||
let api = ServiceLevelObjectivesAPI::with_config(configuration); | ||
let resp = api.get_slo_report_job_status(report_data_id.clone()).await; | ||
if let Ok(value) = resp { | ||
println!("{:#?}", value); | ||
} else { | ||
println!("{:#?}", resp.unwrap_err()); | ||
} | ||
} |
Oops, something went wrong.