v1_service_level_objectives_GetSLOHistory/
v1_service-level-objectives_GetSLOHistory.rs

1// Get an SLO's history returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV1::api_service_level_objectives::GetSLOHistoryOptionalParams;
4use datadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI;
5
6#[tokio::main]
7async fn main() {
8    // there is a valid "slo" in the system
9    let slo_data_0_id = std::env::var("SLO_DATA_0_ID").unwrap();
10    let configuration = datadog::Configuration::new();
11    let api = ServiceLevelObjectivesAPI::with_config(configuration);
12    let resp = api
13        .get_slo_history(
14            slo_data_0_id.clone(),
15            1636542671,
16            1636629071,
17            GetSLOHistoryOptionalParams::default(),
18        )
19        .await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}