Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19961,7 +19961,7 @@ components:
type: array
type: object
UsageIncidentManagementHour:
description: Incident management usage for a given organization for a given
description: Incident Management usage for a given organization for a given
hour.
properties:
hour:
Expand All @@ -19982,11 +19982,11 @@ components:
type: string
type: object
UsageIncidentManagementResponse:
description: Response containing the incident management usage for each hour
description: Response containing the Incident Management usage for each hour
for a given organization.
properties:
usage:
description: Get hourly usage for incident management.
description: Get hourly usage for Incident Management.
items:
$ref: '#/components/schemas/UsageIncidentManagementHour'
type: array
Expand Down Expand Up @@ -21192,7 +21192,7 @@ components:
format: int64
type: integer
incident_management_monthly_active_users_hwm:
description: Shows the high-water mark of incident management monthly active
description: Shows the high-water mark of Incident Management monthly active
users over all hours in the current date for all organizations.
format: int64
type: integer
Expand Down Expand Up @@ -22313,7 +22313,7 @@ components:
description: The organization id.
type: string
incident_management_monthly_active_users_hwm:
description: Shows the high-water mark of incident management monthly active
description: Shows the high-water mark of Incident Management monthly active
users over all hours in the current date for the given org.
format: int64
type: integer
Expand Down Expand Up @@ -23435,7 +23435,7 @@ components:
format: int64
type: integer
incident_management_monthly_active_users_hwm_sum:
description: Shows sum of the high-water marks of incident management monthly
description: Shows sum of the high-water marks of Incident Management monthly
active users in the current month for all organizations.
format: int64
type: integer
Expand Down Expand Up @@ -36523,7 +36523,7 @@ paths:
/api/v1/usage/incident-management:
get:
deprecated: true
description: 'Get hourly usage for incident management.
description: '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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family).
Expand Down Expand Up @@ -36579,7 +36579,7 @@ paths:
appKeyAuth: []
- AuthZ:
- usage_read
summary: Get hourly usage for incident management
summary: Get hourly usage for Incident Management
tags:
- Usage Metering
x-permission:
Expand Down
10 changes: 3 additions & 7 deletions examples/v1_usage-metering_GetIncidentManagement.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Get hourly usage for incident management returns "OK" response
// Get hourly usage for Incident Management returns "OK" response
use chrono::{DateTime, Utc};
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_usage_metering::GetIncidentManagementOptionalParams;
Expand All @@ -10,14 +10,10 @@ async fn main() {
let api = UsageMeteringAPI::with_config(configuration);
let resp = api
.get_incident_management(
DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
DateTime::parse_from_rfc3339("2021-11-11T11:11:11.111000+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
GetIncidentManagementOptionalParams::default().end_hr(
DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
),
GetIncidentManagementOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
Expand Down
28 changes: 28 additions & 0 deletions examples/v1_usage-metering_GetIncidentManagement_3579451115.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Get hourly usage for incident management returns "OK" response
use chrono::{DateTime, Utc};
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_usage_metering::GetIncidentManagementOptionalParams;
use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = UsageMeteringAPI::with_config(configuration);
let resp = api
.get_incident_management(
DateTime::parse_from_rfc3339("2021-11-06T11:11:11+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
GetIncidentManagementOptionalParams::default().end_hr(
DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00")
.expect("Failed to parse datetime")
.with_timezone(&Utc),
),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
4 changes: 2 additions & 2 deletions src/datadogV1/api/api_usage_metering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ impl UsageMeteringAPI {
}
}

/// Get hourly usage for incident management.
/// 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](<https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family>). Refer to [Migrating from the V1 Hourly Usage APIs to V2](<https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/>) for the associated migration guide.
pub async fn get_incident_management(
&self,
Expand All @@ -1484,7 +1484,7 @@ impl UsageMeteringAPI {
}
}

/// Get hourly usage for incident management.
/// 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](<https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family>). Refer to [Migrating from the V1 Hourly Usage APIs to V2](<https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/>) for the associated migration guide.
pub async fn get_incident_management_with_http_info(
&self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::fmt::{self, Formatter};

/// Incident management usage for a given organization for a given hour.
/// Incident Management usage for a given organization for a given hour.
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::fmt::{self, Formatter};

/// Response containing the incident management usage for each hour for a given organization.
/// Response containing the Incident Management usage for each hour for a given organization.
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct UsageIncidentManagementResponse {
/// Get hourly usage for incident management.
/// Get hourly usage for Incident Management.
#[serde(rename = "usage")]
pub usage: Option<Vec<crate::datadogV1::model::UsageIncidentManagementHour>>,
#[serde(flatten)]
Expand Down
2 changes: 1 addition & 1 deletion src/datadogV1/model/model_usage_summary_date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ pub struct UsageSummaryDate {
/// Shows the 99th percentile of all Heroku dynos over all hours in the current date for all organizations.
#[serde(rename = "heroku_host_top99p")]
pub heroku_host_top99p: Option<i64>,
/// Shows the high-water mark of incident management monthly active users over all hours in the current date for all organizations.
/// Shows the high-water mark of Incident Management monthly active users over all hours in the current date for all organizations.
#[serde(rename = "incident_management_monthly_active_users_hwm")]
pub incident_management_monthly_active_users_hwm: Option<i64>,
/// Shows the high-water mark of Incident Management seats over all hours on the current date for all organizations.
Expand Down
2 changes: 1 addition & 1 deletion src/datadogV1/model/model_usage_summary_date_org.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ pub struct UsageSummaryDateOrg {
/// The organization id.
#[serde(rename = "id")]
pub id: Option<String>,
/// Shows the high-water mark of incident management monthly active users over all hours in the current date for the given org.
/// Shows the high-water mark of Incident Management monthly active users over all hours in the current date for the given org.
#[serde(rename = "incident_management_monthly_active_users_hwm")]
pub incident_management_monthly_active_users_hwm: Option<i64>,
/// Shows the high-water mark of Incident Management seats over all hours on the current date for the given organization.
Expand Down
2 changes: 1 addition & 1 deletion src/datadogV1/model/model_usage_summary_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ pub struct UsageSummaryResponse {
/// Shows the 99th percentile of all Heroku dynos over all hours in the current month for all organizations.
#[serde(rename = "heroku_host_top99p_sum")]
pub heroku_host_top99p_sum: Option<i64>,
/// Shows sum of the high-water marks of incident management monthly active users in the current month for all organizations.
/// Shows sum of the high-water marks of Incident Management monthly active users in the current month for all organizations.
#[serde(rename = "incident_management_monthly_active_users_hwm_sum")]
pub incident_management_monthly_active_users_hwm_sum: Option<i64>,
/// Shows the sum of the high-water marks of Incident Management seats over all hours in the current month for all organizations.
Expand Down
14 changes: 14 additions & 0 deletions tests/scenarios/features/v1/usage_metering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,20 @@ Feature: Usage Metering
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/revenue-query
Scenario: Get hourly usage for Incident Management returns "Bad Request" response
Given new "GetIncidentManagement" request
And request contains "start_hr" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/revenue-query
Scenario: Get hourly usage for Incident Management returns "OK" response
Given new "GetIncidentManagement" request
And request contains "start_hr" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@skip @team:DataDog/revenue-query
Scenario: Get hourly usage for IoT returns "Bad Request" response
Given new "GetUsageInternetOfThings" request
Expand Down