pub struct ServiceLevelObjectivesAPI { /* private fields */ }
Expand description
Service Level Objectives (SLOs) are a key part of the site reliability engineering toolkit. SLOs provide a framework for defining clear targets around application performance, which ultimately help teams provide a consistent customer experience, balance feature development with platform stability, and improve communication with internal and external users.
Implementations§
Source§impl ServiceLevelObjectivesAPI
impl ServiceLevelObjectivesAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
6async fn main() {
7 let mut configuration = datadog::Configuration::new();
8 configuration.set_unstable_operation_enabled("v2.GetSLOReport", true);
9 let api = ServiceLevelObjectivesAPI::with_config(configuration);
10 let resp = api
11 .get_slo_report("9fb2dc2a-ead0-11ee-a174-9fe3a9d7627f".to_string())
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
More examples
6async fn main() {
7 // there is a valid "report" in the system
8 let report_data_id = std::env::var("REPORT_DATA_ID").unwrap();
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.GetSLOReportJobStatus", true);
11 let api = ServiceLevelObjectivesAPI::with_config(configuration);
12 let resp = api.get_slo_report_job_status(report_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
10async fn main() {
11 let body = SloReportCreateRequest::new(SloReportCreateRequestData::new(
12 SloReportCreateRequestAttributes::new(
13 1633173071,
14 r#"slo_type:metric "SLO Reporting Test""#.to_string(),
15 1636629071,
16 )
17 .interval(SLOReportInterval::MONTHLY)
18 .timezone("America/New_York".to_string()),
19 ));
20 let mut configuration = datadog::Configuration::new();
21 configuration.set_unstable_operation_enabled("v2.CreateSLOReportJob", true);
22 let api = ServiceLevelObjectivesAPI::with_config(configuration);
23 let resp = api.create_slo_report_job(body).await;
24 if let Ok(value) = resp {
25 println!("{:#?}", value);
26 } else {
27 println!("{:#?}", resp.unwrap_err());
28 }
29}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_slo_report_job(
&self,
body: SloReportCreateRequest,
) -> Result<SLOReportPostResponse, Error<CreateSLOReportJobError>>
pub async fn create_slo_report_job( &self, body: SloReportCreateRequest, ) -> Result<SLOReportPostResponse, Error<CreateSLOReportJobError>>
Create a job to generate an SLO report. The report job is processed asynchronously and eventually results in a CSV report being available for download.
Check the status of the job and download the CSV report using the returned report_id
.
Examples found in repository?
10async fn main() {
11 let body = SloReportCreateRequest::new(SloReportCreateRequestData::new(
12 SloReportCreateRequestAttributes::new(
13 1633173071,
14 r#"slo_type:metric "SLO Reporting Test""#.to_string(),
15 1636629071,
16 )
17 .interval(SLOReportInterval::MONTHLY)
18 .timezone("America/New_York".to_string()),
19 ));
20 let mut configuration = datadog::Configuration::new();
21 configuration.set_unstable_operation_enabled("v2.CreateSLOReportJob", true);
22 let api = ServiceLevelObjectivesAPI::with_config(configuration);
23 let resp = api.create_slo_report_job(body).await;
24 if let Ok(value) = resp {
25 println!("{:#?}", value);
26 } else {
27 println!("{:#?}", resp.unwrap_err());
28 }
29}
Sourcepub async fn create_slo_report_job_with_http_info(
&self,
body: SloReportCreateRequest,
) -> Result<ResponseContent<SLOReportPostResponse>, Error<CreateSLOReportJobError>>
pub async fn create_slo_report_job_with_http_info( &self, body: SloReportCreateRequest, ) -> Result<ResponseContent<SLOReportPostResponse>, Error<CreateSLOReportJobError>>
Create a job to generate an SLO report. The report job is processed asynchronously and eventually results in a CSV report being available for download.
Check the status of the job and download the CSV report using the returned report_id
.
Sourcepub async fn get_slo_report(
&self,
report_id: String,
) -> Result<String, Error<GetSLOReportError>>
pub async fn get_slo_report( &self, report_id: String, ) -> Result<String, Error<GetSLOReportError>>
Download an SLO report. This can only be performed after the report job has completed.
Reports are not guaranteed to exist indefinitely. Datadog recommends that you download the report as soon as it is available.
Examples found in repository?
6async fn main() {
7 let mut configuration = datadog::Configuration::new();
8 configuration.set_unstable_operation_enabled("v2.GetSLOReport", true);
9 let api = ServiceLevelObjectivesAPI::with_config(configuration);
10 let resp = api
11 .get_slo_report("9fb2dc2a-ead0-11ee-a174-9fe3a9d7627f".to_string())
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn get_slo_report_with_http_info(
&self,
report_id: String,
) -> Result<ResponseContent<String>, Error<GetSLOReportError>>
pub async fn get_slo_report_with_http_info( &self, report_id: String, ) -> Result<ResponseContent<String>, Error<GetSLOReportError>>
Download an SLO report. This can only be performed after the report job has completed.
Reports are not guaranteed to exist indefinitely. Datadog recommends that you download the report as soon as it is available.
Sourcepub async fn get_slo_report_job_status(
&self,
report_id: String,
) -> Result<SLOReportStatusGetResponse, Error<GetSLOReportJobStatusError>>
pub async fn get_slo_report_job_status( &self, report_id: String, ) -> Result<SLOReportStatusGetResponse, Error<GetSLOReportJobStatusError>>
Get the status of the SLO report job.
Examples found in repository?
6async fn main() {
7 // there is a valid "report" in the system
8 let report_data_id = std::env::var("REPORT_DATA_ID").unwrap();
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.GetSLOReportJobStatus", true);
11 let api = ServiceLevelObjectivesAPI::with_config(configuration);
12 let resp = api.get_slo_report_job_status(report_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn get_slo_report_job_status_with_http_info(
&self,
report_id: String,
) -> Result<ResponseContent<SLOReportStatusGetResponse>, Error<GetSLOReportJobStatusError>>
pub async fn get_slo_report_job_status_with_http_info( &self, report_id: String, ) -> Result<ResponseContent<SLOReportStatusGetResponse>, Error<GetSLOReportJobStatusError>>
Get the status of the SLO report job.
Trait Implementations§
Source§impl Clone for ServiceLevelObjectivesAPI
impl Clone for ServiceLevelObjectivesAPI
Source§fn clone(&self) -> ServiceLevelObjectivesAPI
fn clone(&self) -> ServiceLevelObjectivesAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more