diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index e4c9496590..5f3344a3f4 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -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: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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). @@ -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: diff --git a/examples/v1/usage-metering/GetIncidentManagement.py b/examples/v1/usage-metering/GetIncidentManagement.py index ed209b5672..189fe16379 100644 --- a/examples/v1/usage-metering/GetIncidentManagement.py +++ b/examples/v1/usage-metering/GetIncidentManagement.py @@ -1,18 +1,17 @@ """ -Get hourly usage for incident management returns "OK" response +Get hourly usage for Incident Management returns "OK" response """ -from datetime import datetime -from dateutil.relativedelta import relativedelta from datadog_api_client import ApiClient, Configuration from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi +from datetime import datetime +from dateutil.tz import tzutc configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = UsageMeteringApi(api_client) response = api_instance.get_incident_management( - start_hr=(datetime.now() + relativedelta(days=-5)), - end_hr=(datetime.now() + relativedelta(days=-3)), + start_hr=datetime(2021, 11, 11, 11, 11, 11, 111000, tzinfo=tzutc()), ) print(response) diff --git a/examples/v1/usage-metering/GetIncidentManagement_3579451115.py b/examples/v1/usage-metering/GetIncidentManagement_3579451115.py new file mode 100644 index 0000000000..ed209b5672 --- /dev/null +++ b/examples/v1/usage-metering/GetIncidentManagement_3579451115.py @@ -0,0 +1,18 @@ +""" +Get hourly usage for incident management returns "OK" response +""" + +from datetime import datetime +from dateutil.relativedelta import relativedelta +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = UsageMeteringApi(api_client) + response = api_instance.get_incident_management( + start_hr=(datetime.now() + relativedelta(days=-5)), + end_hr=(datetime.now() + relativedelta(days=-3)), + ) + + print(response) diff --git a/src/datadog_api_client/v1/api/usage_metering_api.py b/src/datadog_api_client/v1/api/usage_metering_api.py index 3090469381..9c979d9ef3 100644 --- a/src/datadog_api_client/v1/api/usage_metering_api.py +++ b/src/datadog_api_client/v1/api/usage_metering_api.py @@ -1323,9 +1323,9 @@ def get_incident_management( *, end_hr: Union[datetime, UnsetType] = unset, ) -> UsageIncidentManagementResponse: - """Get hourly usage for incident management. **Deprecated**. + """Get hourly usage for Incident Management. **Deprecated**. - 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 `_. Refer to `Migrating from the V1 Hourly Usage APIs to V2 `_ for the associated migration guide. :param start_hr: Datetime in ISO-8601 format, UTC, precise to hour: ``[YYYY-MM-DDThh]`` for usage beginning at this hour. diff --git a/src/datadog_api_client/v1/model/usage_incident_management_hour.py b/src/datadog_api_client/v1/model/usage_incident_management_hour.py index 896851c914..accad38ec2 100644 --- a/src/datadog_api_client/v1/model/usage_incident_management_hour.py +++ b/src/datadog_api_client/v1/model/usage_incident_management_hour.py @@ -41,7 +41,7 @@ def __init__( **kwargs, ): """ - Incident management usage for a given organization for a given hour. + Incident Management usage for a given organization for a given hour. :param hour: The hour for the usage. :type hour: datetime, optional diff --git a/src/datadog_api_client/v1/model/usage_incident_management_response.py b/src/datadog_api_client/v1/model/usage_incident_management_response.py index 63f464f70c..44862fc316 100644 --- a/src/datadog_api_client/v1/model/usage_incident_management_response.py +++ b/src/datadog_api_client/v1/model/usage_incident_management_response.py @@ -32,9 +32,9 @@ def openapi_types(_): def __init__(self_, usage: Union[List[UsageIncidentManagementHour], UnsetType] = unset, **kwargs): """ - 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. - :param usage: Get hourly usage for incident management. + :param usage: Get hourly usage for Incident Management. :type usage: [UsageIncidentManagementHour], optional """ if usage is not unset: diff --git a/src/datadog_api_client/v1/model/usage_summary_date.py b/src/datadog_api_client/v1/model/usage_summary_date.py index 5458184822..972ed29501 100644 --- a/src/datadog_api_client/v1/model/usage_summary_date.py +++ b/src/datadog_api_client/v1/model/usage_summary_date.py @@ -948,7 +948,7 @@ def __init__( :param heroku_host_top99p: Shows the 99th percentile of all Heroku dynos over all hours in the current date for all organizations. :type heroku_host_top99p: int, optional - :param incident_management_monthly_active_users_hwm: Shows the high-water mark of incident management monthly active users over all hours in the current date for all organizations. + :param incident_management_monthly_active_users_hwm: Shows the high-water mark of Incident Management monthly active users over all hours in the current date for all organizations. :type incident_management_monthly_active_users_hwm: int, optional :param incident_management_seats_hwm: Shows the high-water mark of Incident Management seats over all hours on the current date for all organizations. diff --git a/src/datadog_api_client/v1/model/usage_summary_date_org.py b/src/datadog_api_client/v1/model/usage_summary_date_org.py index 3f67c67e06..ee215a8aec 100644 --- a/src/datadog_api_client/v1/model/usage_summary_date_org.py +++ b/src/datadog_api_client/v1/model/usage_summary_date_org.py @@ -971,7 +971,7 @@ def __init__( :param id: The organization id. :type id: str, optional - :param incident_management_monthly_active_users_hwm: Shows the high-water mark of incident management monthly active users over all hours in the current date for the given org. + :param incident_management_monthly_active_users_hwm: Shows the high-water mark of Incident Management monthly active users over all hours in the current date for the given org. :type incident_management_monthly_active_users_hwm: int, optional :param incident_management_seats_hwm: Shows the high-water mark of Incident Management seats over all hours on the current date for the given organization. diff --git a/src/datadog_api_client/v1/model/usage_summary_response.py b/src/datadog_api_client/v1/model/usage_summary_response.py index 2df2975cbc..b7e7de0abd 100644 --- a/src/datadog_api_client/v1/model/usage_summary_response.py +++ b/src/datadog_api_client/v1/model/usage_summary_response.py @@ -992,7 +992,7 @@ def __init__( :param heroku_host_top99p_sum: Shows the 99th percentile of all Heroku dynos over all hours in the current month for all organizations. :type heroku_host_top99p_sum: int, optional - :param incident_management_monthly_active_users_hwm_sum: Shows sum of the high-water marks of incident management monthly active users in the current month for all organizations. + :param incident_management_monthly_active_users_hwm_sum: Shows sum of the high-water marks of Incident Management monthly active users in the current month for all organizations. :type incident_management_monthly_active_users_hwm_sum: int, optional :param incident_management_seats_hwm_sum: Shows the sum of the high-water marks of Incident Management seats over all hours in the current month for all organizations. diff --git a/tests/v1/features/usage_metering.feature b/tests/v1/features/usage_metering.feature index ea9e1ca4b4..db1d3a70be 100644 --- a/tests/v1/features/usage_metering.feature +++ b/tests/v1/features/usage_metering.feature @@ -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