Skip to content

Commit debc7d5

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI specs for reporting schedule endpoints (#1751)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 005375e commit debc7d5

31 files changed

Lines changed: 4316 additions & 80 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 794 additions & 3 deletions
Large diffs are not rendered by default.

examples/v2_report-schedules_CreateReportSchedule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async fn main() {
2727
r#"DTSTART;TZID=America/New_York:20260601T090000
2828
RRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0"#.to_string(),
2929
vec![ReportScheduleTemplateVariable::new("env".to_string(), vec!["prod".to_string()])],
30-
"calendar_month".to_string(),
30+
"1w".to_string(),
3131
"America/New_York".to_string(),
3232
"Weekly Infrastructure Report".to_string(),
3333
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Delete a report schedule returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_report_schedules::ReportSchedulesAPI;
4+
use uuid::Uuid;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = ReportSchedulesAPI::with_config(configuration);
10+
let resp = api
11+
.delete_report_schedule(
12+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
13+
)
14+
.await;
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Get a report schedule returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_report_schedules::ReportSchedulesAPI;
4+
use uuid::Uuid;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = ReportSchedulesAPI::with_config(configuration);
10+
let resp = api
11+
.get_report_schedule(
12+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
13+
)
14+
.await;
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Get report schedules for a resource returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_report_schedules::ReportSchedulesAPI;
4+
use datadog_api_client::datadogV2::model::ReportScheduleResourceType;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = ReportSchedulesAPI::with_config(configuration);
10+
let resp = api
11+
.get_report_schedules_for_resource(
12+
ReportScheduleResourceType::DASHBOARD,
13+
"resource_id".to_string(),
14+
)
15+
.await;
16+
if let Ok(value) = resp {
17+
println!("{:#?}", value);
18+
} else {
19+
println!("{:#?}", resp.unwrap_err());
20+
}
21+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// List report schedules returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_report_schedules::ListReportSchedulesOptionalParams;
4+
use datadog_api_client::datadogV2::api_report_schedules::ReportSchedulesAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = ReportSchedulesAPI::with_config(configuration);
10+
let resp = api
11+
.list_report_schedules(ListReportSchedulesOptionalParams::default())
12+
.await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}

examples/v2_report-schedules_PatchReportSchedule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async fn main() {
2424
r#"DTSTART;TZID=America/New_York:20260601T090000
2525
RRULE:FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0"#.to_string(),
2626
vec![ReportScheduleTemplateVariable::new("env".to_string(), vec!["prod".to_string()])],
27-
"calendar_month".to_string(),
27+
"1w".to_string(),
2828
"America/New_York".to_string(),
2929
"Weekly Infrastructure Report".to_string(),
3030
)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Toggle a report schedule returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_report_schedules::ReportSchedulesAPI;
4+
use datadog_api_client::datadogV2::model::ReportScheduleStatus;
5+
use datadog_api_client::datadogV2::model::ReportScheduleToggleRequest;
6+
use datadog_api_client::datadogV2::model::ReportScheduleToggleRequestAttributes;
7+
use datadog_api_client::datadogV2::model::ReportScheduleToggleRequestData;
8+
use datadog_api_client::datadogV2::model::ReportScheduleType;
9+
use uuid::Uuid;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
let body = ReportScheduleToggleRequest::new(ReportScheduleToggleRequestData::new(
14+
ReportScheduleToggleRequestAttributes::new(ReportScheduleStatus::ACTIVE),
15+
ReportScheduleType::SCHEDULE,
16+
));
17+
let configuration = datadog::Configuration::new();
18+
let api = ReportSchedulesAPI::with_config(configuration);
19+
let resp = api
20+
.toggle_report_schedule(
21+
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
22+
body,
23+
)
24+
.await;
25+
if let Ok(value) = resp {
26+
println!("{:#?}", value);
27+
} else {
28+
println!("{:#?}", resp.unwrap_err());
29+
}
30+
}

0 commit comments

Comments
 (0)