Skip to content
Merged
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
13 changes: 10 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44106,6 +44106,10 @@ paths:

**Note**: All `estimated_*` usage types will be deprecated on February 1, 2027.

Each request returns usage for the month specified by `start_month`. If `end_month` is omitted
or differs from `start_month`, it is treated as equal to `start_month`.
To retrieve multiple months, make a separate request for each month.

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:
Expand All @@ -44122,15 +44126,18 @@ paths:
operationId: GetMonthlyUsageAttribution
parameters:
- description: |-
Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month.
Maximum of 15 months ago.
Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for the month to retrieve.
Maximum of 15 months ago. Only one month is supported per request.
in: query
name: start_month
required: true
schema:
format: date-time
type: string
- description: "Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month."
- description: |-
Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`.
If omitted or different from `start_month`, it is treated as equal to `start_month`.
Only usage for `start_month` is returned; this parameter does not extend the requested range.
in: query
name: end_month
required: false
Expand Down
12 changes: 9 additions & 3 deletions src/datadog_api_client/v1/api/usage_metering_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,10 @@ def get_monthly_usage_attribution(

**Note** : All ``estimated_*`` usage types will be deprecated on February 1, 2027.

Each request returns usage for the month specified by ``start_month``. If ``end_month`` is omitted
or differs from ``start_month`` , it is treated as equal to ``start_month``.
To retrieve multiple months, make a separate request for each month.

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:
Expand All @@ -1447,16 +1451,18 @@ def get_monthly_usage_attribution(
cursor := response.metadata.pagination.next_record_id
END

:param start_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for usage beginning in this month.
Maximum of 15 months ago.
:param start_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for the month to retrieve.
Maximum of 15 months ago. Only one month is supported per request.
:type start_month: datetime
:param fields: Comma-separated list of usage types to return, or ``*`` for all usage types.
Usage types are in the format ``<usage_type>_usage`` and ``<usage_type>_percentage``.
Example: ``infra_host_usage,infra_host_percentage``
To obtain the complete list of usage attribution types that can be used to replace
``<usage_type>`` in the field names, make a request to the `Get usage attribution types API <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types>`_.
:type fields: MonthlyUsageAttributionSupportedMetrics
:param end_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for usage ending this month.
:param end_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]``.
If omitted or different from ``start_month`` , it is treated as equal to ``start_month``.
Only usage for ``start_month`` is returned; this parameter does not extend the requested range.
:type end_month: datetime, optional
:param sort_direction: The direction to sort by: ``[desc, asc]``.
:type sort_direction: UsageSortDirection, optional
Expand Down
Loading