Struct UsageMeteringAPI

Source
pub struct UsageMeteringAPI { /* private fields */ }
Expand description

The usage metering API allows you to get hourly, daily, and monthly usage across multiple facets of Datadog. This API is available to all Pro and Enterprise customers.

Note: Usage data is delayed by up to 72 hours from when it was incurred. It is retained for 15 months.

You can retrieve up to 24 hours of hourly usage data for multiple organizations, and up to two months of hourly usage data for a single organization in one request. Learn more on the usage details documentation.

Implementations§

Source§

impl UsageMeteringAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v1_usage-metering_GetSpecifiedDailyCustomReports.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = UsageMeteringAPI::with_config(configuration);
9    let resp = api
10        .get_specified_daily_custom_reports("2022-03-20".to_string())
11        .await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
More examples
Hide additional examples
examples/v1_usage-metering_GetSpecifiedMonthlyCustomReports.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = UsageMeteringAPI::with_config(configuration);
9    let resp = api
10        .get_specified_monthly_custom_reports("2021-05-01".to_string())
11        .await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
examples/v1_usage-metering_GetDailyCustomReports.rs (line 9)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = UsageMeteringAPI::with_config(configuration);
10    let resp = api
11        .get_daily_custom_reports(GetDailyCustomReportsOptionalParams::default())
12        .await;
13    if let Ok(value) = resp {
14        println!("{:#?}", value);
15    } else {
16        println!("{:#?}", resp.unwrap_err());
17    }
18}
examples/v1_usage-metering_GetMonthlyCustomReports.rs (line 9)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = UsageMeteringAPI::with_config(configuration);
10    let resp = api
11        .get_monthly_custom_reports(GetMonthlyCustomReportsOptionalParams::default())
12        .await;
13    if let Ok(value) = resp {
14        println!("{:#?}", value);
15    } else {
16        println!("{:#?}", resp.unwrap_err());
17    }
18}
examples/v1_usage-metering_GetUsageBillableSummary.rs (line 9)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = UsageMeteringAPI::with_config(configuration);
10    let resp = api
11        .get_usage_billable_summary(GetUsageBillableSummaryOptionalParams::default())
12        .await;
13    if let Ok(value) = resp {
14        println!("{:#?}", value);
15    } else {
16        println!("{:#?}", resp.unwrap_err());
17    }
18}
examples/v1_usage-metering_GetUsageDBM.rs (line 10)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_dbm(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageDBMOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

pub async fn get_daily_custom_reports( &self, params: GetDailyCustomReportsOptionalParams, ) -> Result<UsageCustomReportsResponse, Error<GetDailyCustomReportsError>>

Get daily custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetDailyCustomReports.rs (line 11)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = UsageMeteringAPI::with_config(configuration);
10    let resp = api
11        .get_daily_custom_reports(GetDailyCustomReportsOptionalParams::default())
12        .await;
13    if let Ok(value) = resp {
14        println!("{:#?}", value);
15    } else {
16        println!("{:#?}", resp.unwrap_err());
17    }
18}
Source

pub async fn get_daily_custom_reports_with_http_info( &self, params: GetDailyCustomReportsOptionalParams, ) -> Result<ResponseContent<UsageCustomReportsResponse>, Error<GetDailyCustomReportsError>>

Get daily custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Source

pub async fn get_hourly_usage_attribution( &self, start_hr: DateTime<Utc>, usage_type: HourlyUsageAttributionUsageType, params: GetHourlyUsageAttributionOptionalParams, ) -> Result<HourlyUsageAttributionResponse, Error<GetHourlyUsageAttributionError>>

Get hourly usage attribution. Multi-region data is available starting March 1, 2023.

This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id is set in the response. If it is, make another request and pass next_record_id as a parameter. Pseudo code example:

response := GetHourlyUsageAttribution(start_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
  sleep(5 seconds)  # Avoid running into rate limit
  response := GetHourlyUsageAttribution(start_month, next_record_id=cursor)
  cursor := response.metadata.pagination.next_record_id
END
Examples found in repository?
examples/v1_usage-metering_GetHourlyUsageAttribution.rs (lines 13-19)
9async fn main() {
10    let configuration = datadog::Configuration::new();
11    let api = UsageMeteringAPI::with_config(configuration);
12    let resp = api
13        .get_hourly_usage_attribution(
14            DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
15                .expect("Failed to parse datetime")
16                .with_timezone(&Utc),
17            HourlyUsageAttributionUsageType::INFRA_HOST_USAGE,
18            GetHourlyUsageAttributionOptionalParams::default(),
19        )
20        .await;
21    if let Ok(value) = resp {
22        println!("{:#?}", value);
23    } else {
24        println!("{:#?}", resp.unwrap_err());
25    }
26}
Source

pub async fn get_hourly_usage_attribution_with_http_info( &self, start_hr: DateTime<Utc>, usage_type: HourlyUsageAttributionUsageType, params: GetHourlyUsageAttributionOptionalParams, ) -> Result<ResponseContent<HourlyUsageAttributionResponse>, Error<GetHourlyUsageAttributionError>>

Get hourly usage attribution. Multi-region data is available starting March 1, 2023.

This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id is set in the response. If it is, make another request and pass next_record_id as a parameter. Pseudo code example:

response := GetHourlyUsageAttribution(start_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
  sleep(5 seconds)  # Avoid running into rate limit
  response := GetHourlyUsageAttribution(start_month, next_record_id=cursor)
  cursor := response.metadata.pagination.next_record_id
END
Source

pub async fn get_incident_management( &self, start_hr: DateTime<Utc>, params: GetIncidentManagementOptionalParams, ) -> Result<UsageIncidentManagementResponse, Error<GetIncidentManagementError>>

Get hourly usage for incident management. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetIncidentManagement.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_incident_management(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetIncidentManagementOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_incident_management_with_http_info( &self, start_hr: DateTime<Utc>, params: GetIncidentManagementOptionalParams, ) -> Result<ResponseContent<UsageIncidentManagementResponse>, Error<GetIncidentManagementError>>

Get hourly usage for incident management. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_ingested_spans( &self, start_hr: DateTime<Utc>, params: GetIngestedSpansOptionalParams, ) -> Result<UsageIngestedSpansResponse, Error<GetIngestedSpansError>>

Get hourly usage for ingested spans. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetIngestedSpans.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_ingested_spans(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetIngestedSpansOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_ingested_spans_with_http_info( &self, start_hr: DateTime<Utc>, params: GetIngestedSpansOptionalParams, ) -> Result<ResponseContent<UsageIngestedSpansResponse>, Error<GetIngestedSpansError>>

Get hourly usage for ingested spans. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_monthly_custom_reports( &self, params: GetMonthlyCustomReportsOptionalParams, ) -> Result<UsageCustomReportsResponse, Error<GetMonthlyCustomReportsError>>

Get monthly custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetMonthlyCustomReports.rs (line 11)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = UsageMeteringAPI::with_config(configuration);
10    let resp = api
11        .get_monthly_custom_reports(GetMonthlyCustomReportsOptionalParams::default())
12        .await;
13    if let Ok(value) = resp {
14        println!("{:#?}", value);
15    } else {
16        println!("{:#?}", resp.unwrap_err());
17    }
18}
Source

pub async fn get_monthly_custom_reports_with_http_info( &self, params: GetMonthlyCustomReportsOptionalParams, ) -> Result<ResponseContent<UsageCustomReportsResponse>, Error<GetMonthlyCustomReportsError>>

Get monthly custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Source

pub async fn get_monthly_usage_attribution( &self, start_month: DateTime<Utc>, fields: MonthlyUsageAttributionSupportedMetrics, params: GetMonthlyUsageAttributionOptionalParams, ) -> Result<MonthlyUsageAttributionResponse, Error<GetMonthlyUsageAttributionError>>

Get monthly usage attribution. Multi-region data is available starting March 1, 2023.

This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id is set in the response. If it is, make another request and pass next_record_id as a parameter. Pseudo code example:

response := GetMonthlyUsageAttribution(start_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
  sleep(5 seconds)  # Avoid running into rate limit
  response := GetMonthlyUsageAttribution(start_month, next_record_id=cursor)
  cursor := response.metadata.pagination.next_record_id
END
Examples found in repository?
examples/v1_usage-metering_GetMonthlyUsageAttribution.rs (lines 13-19)
9async fn main() {
10    let configuration = datadog::Configuration::new();
11    let api = UsageMeteringAPI::with_config(configuration);
12    let resp = api
13        .get_monthly_usage_attribution(
14            DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
15                .expect("Failed to parse datetime")
16                .with_timezone(&Utc),
17            MonthlyUsageAttributionSupportedMetrics::INFRA_HOST_USAGE,
18            GetMonthlyUsageAttributionOptionalParams::default(),
19        )
20        .await;
21    if let Ok(value) = resp {
22        println!("{:#?}", value);
23    } else {
24        println!("{:#?}", resp.unwrap_err());
25    }
26}
More examples
Hide additional examples
examples/v1_usage-metering_GetMonthlyUsageAttribution_3849653599.rs (lines 16-24)
9async fn main() {
10    // there is a valid "monthly_usage_attribution" response
11    let monthly_usage_attribution_metadata_pagination_next_record_id =
12        std::env::var("MONTHLY_USAGE_ATTRIBUTION_METADATA_PAGINATION_NEXT_RECORD_ID").unwrap();
13    let configuration = datadog::Configuration::new();
14    let api = UsageMeteringAPI::with_config(configuration);
15    let resp = api
16        .get_monthly_usage_attribution(
17            DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                .expect("Failed to parse datetime")
19                .with_timezone(&Utc),
20            MonthlyUsageAttributionSupportedMetrics::INFRA_HOST_USAGE,
21            GetMonthlyUsageAttributionOptionalParams::default().next_record_id(
22                monthly_usage_attribution_metadata_pagination_next_record_id.clone(),
23            ),
24        )
25        .await;
26    if let Ok(value) = resp {
27        println!("{:#?}", value);
28    } else {
29        println!("{:#?}", resp.unwrap_err());
30    }
31}
Source

pub async fn get_monthly_usage_attribution_with_http_info( &self, start_month: DateTime<Utc>, fields: MonthlyUsageAttributionSupportedMetrics, params: GetMonthlyUsageAttributionOptionalParams, ) -> Result<ResponseContent<MonthlyUsageAttributionResponse>, Error<GetMonthlyUsageAttributionError>>

Get monthly usage attribution. Multi-region data is available starting March 1, 2023.

This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id is set in the response. If it is, make another request and pass next_record_id as a parameter. Pseudo code example:

response := GetMonthlyUsageAttribution(start_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
  sleep(5 seconds)  # Avoid running into rate limit
  response := GetMonthlyUsageAttribution(start_month, next_record_id=cursor)
  cursor := response.metadata.pagination.next_record_id
END
Source

pub async fn get_specified_daily_custom_reports( &self, report_id: String, ) -> Result<UsageSpecifiedCustomReportsResponse, Error<GetSpecifiedDailyCustomReportsError>>

Get specified daily custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetSpecifiedDailyCustomReports.rs (line 10)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = UsageMeteringAPI::with_config(configuration);
9    let resp = api
10        .get_specified_daily_custom_reports("2022-03-20".to_string())
11        .await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
Source

pub async fn get_specified_daily_custom_reports_with_http_info( &self, report_id: String, ) -> Result<ResponseContent<UsageSpecifiedCustomReportsResponse>, Error<GetSpecifiedDailyCustomReportsError>>

Get specified daily custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Source

pub async fn get_specified_monthly_custom_reports( &self, report_id: String, ) -> Result<UsageSpecifiedCustomReportsResponse, Error<GetSpecifiedMonthlyCustomReportsError>>

Get specified monthly custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetSpecifiedMonthlyCustomReports.rs (line 10)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = UsageMeteringAPI::with_config(configuration);
9    let resp = api
10        .get_specified_monthly_custom_reports("2021-05-01".to_string())
11        .await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
Source

pub async fn get_specified_monthly_custom_reports_with_http_info( &self, report_id: String, ) -> Result<ResponseContent<UsageSpecifiedCustomReportsResponse>, Error<GetSpecifiedMonthlyCustomReportsError>>

Get specified monthly custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Source

pub async fn get_usage_analyzed_logs( &self, start_hr: DateTime<Utc>, params: GetUsageAnalyzedLogsOptionalParams, ) -> Result<UsageAnalyzedLogsResponse, Error<GetUsageAnalyzedLogsError>>

Get hourly usage for analyzed logs (Security Monitoring). Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageAnalyzedLogs.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_analyzed_logs(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageAnalyzedLogsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_analyzed_logs_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageAnalyzedLogsOptionalParams, ) -> Result<ResponseContent<UsageAnalyzedLogsResponse>, Error<GetUsageAnalyzedLogsError>>

Get hourly usage for analyzed logs (Security Monitoring). Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_audit_logs( &self, start_hr: DateTime<Utc>, params: GetUsageAuditLogsOptionalParams, ) -> Result<UsageAuditLogsResponse, Error<GetUsageAuditLogsError>>

Get hourly usage for audit logs. Note: This endpoint has been deprecated.

Examples found in repository?
examples/v1_usage-metering_GetUsageAuditLogs.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_audit_logs(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageAuditLogsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_audit_logs_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageAuditLogsOptionalParams, ) -> Result<ResponseContent<UsageAuditLogsResponse>, Error<GetUsageAuditLogsError>>

Get hourly usage for audit logs. Note: This endpoint has been deprecated.

Source

pub async fn get_usage_billable_summary( &self, params: GetUsageBillableSummaryOptionalParams, ) -> Result<UsageBillableSummaryResponse, Error<GetUsageBillableSummaryError>>

Get billable usage across your account.

This endpoint is only accessible for parent-level organizations.

Examples found in repository?
examples/v1_usage-metering_GetUsageBillableSummary.rs (line 11)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = UsageMeteringAPI::with_config(configuration);
10    let resp = api
11        .get_usage_billable_summary(GetUsageBillableSummaryOptionalParams::default())
12        .await;
13    if let Ok(value) = resp {
14        println!("{:#?}", value);
15    } else {
16        println!("{:#?}", resp.unwrap_err());
17    }
18}
Source

pub async fn get_usage_billable_summary_with_http_info( &self, params: GetUsageBillableSummaryOptionalParams, ) -> Result<ResponseContent<UsageBillableSummaryResponse>, Error<GetUsageBillableSummaryError>>

Get billable usage across your account.

This endpoint is only accessible for parent-level organizations.

Source

pub async fn get_usage_ci_app( &self, start_hr: DateTime<Utc>, params: GetUsageCIAppOptionalParams, ) -> Result<UsageCIVisibilityResponse, Error<GetUsageCIAppError>>

Get hourly usage for CI visibility (tests, pipeline, and spans). Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageCIApp.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_ci_app(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageCIAppOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_ci_app_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageCIAppOptionalParams, ) -> Result<ResponseContent<UsageCIVisibilityResponse>, Error<GetUsageCIAppError>>

Get hourly usage for CI visibility (tests, pipeline, and spans). Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_cws( &self, start_hr: DateTime<Utc>, params: GetUsageCWSOptionalParams, ) -> Result<UsageCWSResponse, Error<GetUsageCWSError>>

Get hourly usage for cloud workload security. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageCWS.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_cws(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageCWSOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_cws_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageCWSOptionalParams, ) -> Result<ResponseContent<UsageCWSResponse>, Error<GetUsageCWSError>>

Get hourly usage for cloud workload security. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_cloud_security_posture_management( &self, start_hr: DateTime<Utc>, params: GetUsageCloudSecurityPostureManagementOptionalParams, ) -> Result<UsageCloudSecurityPostureManagementResponse, Error<GetUsageCloudSecurityPostureManagementError>>

Get hourly usage for cloud security management (CSM) pro. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageCloudSecurityPostureManagement.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_cloud_security_posture_management(
13            DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageCloudSecurityPostureManagementOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
Source

pub async fn get_usage_cloud_security_posture_management_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageCloudSecurityPostureManagementOptionalParams, ) -> Result<ResponseContent<UsageCloudSecurityPostureManagementResponse>, Error<GetUsageCloudSecurityPostureManagementError>>

Get hourly usage for cloud security management (CSM) pro. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_dbm( &self, start_hr: DateTime<Utc>, params: GetUsageDBMOptionalParams, ) -> Result<UsageDBMResponse, Error<GetUsageDBMError>>

Get hourly usage for database monitoring Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageDBM.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_dbm(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageDBMOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageDBM_3446806203.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_dbm(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageDBMOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_dbm_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageDBMOptionalParams, ) -> Result<ResponseContent<UsageDBMResponse>, Error<GetUsageDBMError>>

Get hourly usage for database monitoring Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_fargate( &self, start_hr: DateTime<Utc>, params: GetUsageFargateOptionalParams, ) -> Result<UsageFargateResponse, Error<GetUsageFargateError>>

Get hourly usage for Fargate. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageFargate.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_fargate(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageFargateOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_fargate_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageFargateOptionalParams, ) -> Result<ResponseContent<UsageFargateResponse>, Error<GetUsageFargateError>>

Get hourly usage for Fargate. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_hosts( &self, start_hr: DateTime<Utc>, params: GetUsageHostsOptionalParams, ) -> Result<UsageHostsResponse, Error<GetUsageHostsError>>

Get hourly usage for hosts and containers. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageHosts.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_hosts(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageHostsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_hosts_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageHostsOptionalParams, ) -> Result<ResponseContent<UsageHostsResponse>, Error<GetUsageHostsError>>

Get hourly usage for hosts and containers. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_indexed_spans( &self, start_hr: DateTime<Utc>, params: GetUsageIndexedSpansOptionalParams, ) -> Result<UsageIndexedSpansResponse, Error<GetUsageIndexedSpansError>>

Get hourly usage for indexed spans. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageIndexedSpans.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_indexed_spans(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageIndexedSpansOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_indexed_spans_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageIndexedSpansOptionalParams, ) -> Result<ResponseContent<UsageIndexedSpansResponse>, Error<GetUsageIndexedSpansError>>

Get hourly usage for indexed spans. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_internet_of_things( &self, start_hr: DateTime<Utc>, params: GetUsageInternetOfThingsOptionalParams, ) -> Result<UsageIoTResponse, Error<GetUsageInternetOfThingsError>>

Get hourly usage for IoT. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageInternetOfThings.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_internet_of_things(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageInternetOfThingsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_internet_of_things_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageInternetOfThingsOptionalParams, ) -> Result<ResponseContent<UsageIoTResponse>, Error<GetUsageInternetOfThingsError>>

Get hourly usage for IoT. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_lambda( &self, start_hr: DateTime<Utc>, params: GetUsageLambdaOptionalParams, ) -> Result<UsageLambdaResponse, Error<GetUsageLambdaError>>

Get hourly usage for Lambda. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageLambda.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_lambda(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageLambdaOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_lambda_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageLambdaOptionalParams, ) -> Result<ResponseContent<UsageLambdaResponse>, Error<GetUsageLambdaError>>

Get hourly usage for Lambda. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_logs( &self, start_hr: DateTime<Utc>, params: GetUsageLogsOptionalParams, ) -> Result<UsageLogsResponse, Error<GetUsageLogsError>>

Get hourly usage for logs. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageLogs.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_logs(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageLogsOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageLogs_2562396405.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_logs(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageLogsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_logs_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageLogsOptionalParams, ) -> Result<ResponseContent<UsageLogsResponse>, Error<GetUsageLogsError>>

Get hourly usage for logs. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_logs_by_index( &self, start_hr: DateTime<Utc>, params: GetUsageLogsByIndexOptionalParams, ) -> Result<UsageLogsByIndexResponse, Error<GetUsageLogsByIndexError>>

Get hourly usage for logs by index.

Examples found in repository?
examples/v1_usage-metering_GetUsageLogsByIndex.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_logs_by_index(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageLogsByIndexOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageLogsByIndex_1025184776.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_logs_by_index(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageLogsByIndexOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_logs_by_index_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageLogsByIndexOptionalParams, ) -> Result<ResponseContent<UsageLogsByIndexResponse>, Error<GetUsageLogsByIndexError>>

Get hourly usage for logs by index.

Source

pub async fn get_usage_logs_by_retention( &self, start_hr: DateTime<Utc>, params: GetUsageLogsByRetentionOptionalParams, ) -> Result<UsageLogsByRetentionResponse, Error<GetUsageLogsByRetentionError>>

Get hourly usage for indexed logs by retention period. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageLogsByRetention.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_logs_by_retention(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageLogsByRetentionOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_logs_by_retention_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageLogsByRetentionOptionalParams, ) -> Result<ResponseContent<UsageLogsByRetentionResponse>, Error<GetUsageLogsByRetentionError>>

Get hourly usage for indexed logs by retention period. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_network_flows( &self, start_hr: DateTime<Utc>, params: GetUsageNetworkFlowsOptionalParams, ) -> Result<UsageNetworkFlowsResponse, Error<GetUsageNetworkFlowsError>>

Get hourly usage for network flows. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageNetworkFlows.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_network_flows(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageNetworkFlowsOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageNetworkFlows_1239422069.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_network_flows(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageNetworkFlowsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_network_flows_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageNetworkFlowsOptionalParams, ) -> Result<ResponseContent<UsageNetworkFlowsResponse>, Error<GetUsageNetworkFlowsError>>

Get hourly usage for network flows. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_network_hosts( &self, start_hr: DateTime<Utc>, params: GetUsageNetworkHostsOptionalParams, ) -> Result<UsageNetworkHostsResponse, Error<GetUsageNetworkHostsError>>

Get hourly usage for network hosts. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageNetworkHosts.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_network_hosts(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageNetworkHostsOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageNetworkHosts_1249907835.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_network_hosts(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageNetworkHostsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_network_hosts_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageNetworkHostsOptionalParams, ) -> Result<ResponseContent<UsageNetworkHostsResponse>, Error<GetUsageNetworkHostsError>>

Get hourly usage for network hosts. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_online_archive( &self, start_hr: DateTime<Utc>, params: GetUsageOnlineArchiveOptionalParams, ) -> Result<UsageOnlineArchiveResponse, Error<GetUsageOnlineArchiveError>>

Get hourly usage for online archive. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageOnlineArchive.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_online_archive(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageOnlineArchiveOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageOnlineArchive_1501172903.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_online_archive(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageOnlineArchiveOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_online_archive_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageOnlineArchiveOptionalParams, ) -> Result<ResponseContent<UsageOnlineArchiveResponse>, Error<GetUsageOnlineArchiveError>>

Get hourly usage for online archive. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_profiling( &self, start_hr: DateTime<Utc>, params: GetUsageProfilingOptionalParams, ) -> Result<UsageProfilingResponse, Error<GetUsageProfilingError>>

Get hourly usage for profiled hosts. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageProfiling.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_profiling(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageProfilingOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_profiling_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageProfilingOptionalParams, ) -> Result<ResponseContent<UsageProfilingResponse>, Error<GetUsageProfilingError>>

Get hourly usage for profiled hosts. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_rum_sessions( &self, start_hr: DateTime<Utc>, params: GetUsageRumSessionsOptionalParams, ) -> Result<UsageRumSessionsResponse, Error<GetUsageRumSessionsError>>

Get hourly usage for RUM Sessions. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageRumSessions.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_rum_sessions(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageRumSessionsOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageRumSessions_714937291.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_rum_sessions(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageRumSessionsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
examples/v1_usage-metering_GetUsageRumSessions_3271366243.rs (lines 12-23)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_rum_sessions(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageRumSessionsOptionalParams::default()
17                .end_hr(
18                    DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
19                        .expect("Failed to parse datetime")
20                        .with_timezone(&Utc),
21                )
22                .type_("mobile".to_string()),
23        )
24        .await;
25    if let Ok(value) = resp {
26        println!("{:#?}", value);
27    } else {
28        println!("{:#?}", resp.unwrap_err());
29    }
30}
Source

pub async fn get_usage_rum_sessions_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageRumSessionsOptionalParams, ) -> Result<ResponseContent<UsageRumSessionsResponse>, Error<GetUsageRumSessionsError>>

Get hourly usage for RUM Sessions. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_rum_units( &self, start_hr: DateTime<Utc>, params: GetUsageRumUnitsOptionalParams, ) -> Result<UsageRumUnitsResponse, Error<GetUsageRumUnitsError>>

Get hourly usage for RUM Units. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageRumUnits.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_rum_units(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageRumUnitsOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageRumUnits_3959755399.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_rum_units(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageRumUnitsOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_rum_units_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageRumUnitsOptionalParams, ) -> Result<ResponseContent<UsageRumUnitsResponse>, Error<GetUsageRumUnitsError>>

Get hourly usage for RUM Units. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_sds( &self, start_hr: DateTime<Utc>, params: GetUsageSDSOptionalParams, ) -> Result<UsageSDSResponse, Error<GetUsageSDSError>>

Get hourly usage for sensitive data scanner. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageSDS.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_sds(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSDSOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageSDS_271128478.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_sds(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSDSOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_sds_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageSDSOptionalParams, ) -> Result<ResponseContent<UsageSDSResponse>, Error<GetUsageSDSError>>

Get hourly usage for sensitive data scanner. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_snmp( &self, start_hr: DateTime<Utc>, params: GetUsageSNMPOptionalParams, ) -> Result<UsageSNMPResponse, Error<GetUsageSNMPError>>

Get hourly usage for SNMP devices. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageSNMP.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_snmp(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSNMPOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_snmp_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageSNMPOptionalParams, ) -> Result<ResponseContent<UsageSNMPResponse>, Error<GetUsageSNMPError>>

Get hourly usage for SNMP devices. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_summary( &self, start_month: DateTime<Utc>, params: GetUsageSummaryOptionalParams, ) -> Result<UsageSummaryResponse, Error<GetUsageSummaryError>>

Get all usage across your account.

This endpoint is only accessible for parent-level organizations.

Examples found in repository?
examples/v1_usage-metering_GetUsageSummary.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_summary(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSummaryOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
Source

pub async fn get_usage_summary_with_http_info( &self, start_month: DateTime<Utc>, params: GetUsageSummaryOptionalParams, ) -> Result<ResponseContent<UsageSummaryResponse>, Error<GetUsageSummaryError>>

Get all usage across your account.

This endpoint is only accessible for parent-level organizations.

Source

pub async fn get_usage_synthetics( &self, start_hr: DateTime<Utc>, params: GetUsageSyntheticsOptionalParams, ) -> Result<UsageSyntheticsResponse, Error<GetUsageSyntheticsError>>

Get hourly usage for synthetics checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageSynthetics.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_synthetics(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSyntheticsOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
Source

pub async fn get_usage_synthetics_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageSyntheticsOptionalParams, ) -> Result<ResponseContent<UsageSyntheticsResponse>, Error<GetUsageSyntheticsError>>

Get hourly usage for synthetics checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_synthetics_api( &self, start_hr: DateTime<Utc>, params: GetUsageSyntheticsAPIOptionalParams, ) -> Result<UsageSyntheticsAPIResponse, Error<GetUsageSyntheticsAPIError>>

Get hourly usage for synthetics API checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageSyntheticsAPI.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_synthetics_api(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSyntheticsAPIOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageSyntheticsAPI_4048033529.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_synthetics_api(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSyntheticsAPIOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_synthetics_api_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageSyntheticsAPIOptionalParams, ) -> Result<ResponseContent<UsageSyntheticsAPIResponse>, Error<GetUsageSyntheticsAPIError>>

Get hourly usage for synthetics API checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_synthetics_browser( &self, start_hr: DateTime<Utc>, params: GetUsageSyntheticsBrowserOptionalParams, ) -> Result<UsageSyntheticsBrowserResponse, Error<GetUsageSyntheticsBrowserError>>

Get hourly usage for synthetics browser checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageSyntheticsBrowser.rs (lines 12-17)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_synthetics_browser(
13            DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSyntheticsBrowserOptionalParams::default(),
17        )
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v1_usage-metering_GetUsageSyntheticsBrowser_1704663299.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_synthetics_browser(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageSyntheticsBrowserOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_synthetics_browser_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageSyntheticsBrowserOptionalParams, ) -> Result<ResponseContent<UsageSyntheticsBrowserResponse>, Error<GetUsageSyntheticsBrowserError>>

Get hourly usage for synthetics browser checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_timeseries( &self, start_hr: DateTime<Utc>, params: GetUsageTimeseriesOptionalParams, ) -> Result<UsageTimeseriesResponse, Error<GetUsageTimeseriesError>>

Get hourly usage for custom metrics. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Examples found in repository?
examples/v1_usage-metering_GetUsageTimeseries.rs (lines 12-21)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_timeseries(
13            DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
14                .expect("Failed to parse datetime")
15                .with_timezone(&Utc),
16            GetUsageTimeseriesOptionalParams::default().end_hr(
17                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
18                    .expect("Failed to parse datetime")
19                    .with_timezone(&Utc),
20            ),
21        )
22        .await;
23    if let Ok(value) = resp {
24        println!("{:#?}", value);
25    } else {
26        println!("{:#?}", resp.unwrap_err());
27    }
28}
Source

pub async fn get_usage_timeseries_with_http_info( &self, start_hr: DateTime<Utc>, params: GetUsageTimeseriesOptionalParams, ) -> Result<ResponseContent<UsageTimeseriesResponse>, Error<GetUsageTimeseriesError>>

Get hourly usage for custom metrics. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Source

pub async fn get_usage_top_avg_metrics( &self, params: GetUsageTopAvgMetricsOptionalParams, ) -> Result<UsageTopAvgMetricsResponse, Error<GetUsageTopAvgMetricsError>>

Get all custom metrics by hourly average. Use the month parameter to get a month-to-date data resolution or use the day parameter to get a daily resolution. One of the two is required, and only one of the two is allowed.

Examples found in repository?
examples/v1_usage-metering_GetUsageTopAvgMetrics.rs (lines 12-18)
8async fn main() {
9    let configuration = datadog::Configuration::new();
10    let api = UsageMeteringAPI::with_config(configuration);
11    let resp = api
12        .get_usage_top_avg_metrics(
13            GetUsageTopAvgMetricsOptionalParams::default().day(
14                DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
15                    .expect("Failed to parse datetime")
16                    .with_timezone(&Utc),
17            ),
18        )
19        .await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}
Source

pub async fn get_usage_top_avg_metrics_with_http_info( &self, params: GetUsageTopAvgMetricsOptionalParams, ) -> Result<ResponseContent<UsageTopAvgMetricsResponse>, Error<GetUsageTopAvgMetricsError>>

Get all custom metrics by hourly average. Use the month parameter to get a month-to-date data resolution or use the day parameter to get a daily resolution. One of the two is required, and only one of the two is allowed.

Trait Implementations§

Source§

impl Clone for UsageMeteringAPI

Source§

fn clone(&self) -> UsageMeteringAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UsageMeteringAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UsageMeteringAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,