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
38 changes: 21 additions & 17 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22813,10 +22813,11 @@ components:
description: |-
Response with hourly report of all data billed by Datadog for all organizations.

Newly added billing dimensions and usage types appear as untyped keys on the
`additionalProperties` map instead of as typed fields. Call
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
at this response level—both typed fields and `additionalProperties` keys.
For SDK users only: all fields at this response level are accessible through the
`additionalProperties` map. Existing typed-field getters are unchanged. New billing
dimensions will not have typed-field getters. Use
[Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
to enumerate every available key.
properties:
agent_host_top99p:
description: Shows the 99th percentile of all agent hosts over all hours in the current date for all organizations.
Expand Down Expand Up @@ -24115,10 +24116,11 @@ components:
description: |-
Global hourly report of all data billed by Datadog for a given organization.

Newly added billing dimensions and usage types appear as untyped keys on the
`additionalProperties` map instead of as typed fields. Call
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
at this response level—both typed fields and `additionalProperties` keys.
For SDK users only: all fields at this response level are accessible through the
`additionalProperties` map. Existing typed-field getters are unchanged. New billing
dimensions will not have typed-field getters. Use
[Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
to enumerate every available key.
properties:
account_name:
description: The account name.
Expand Down Expand Up @@ -25436,10 +25438,11 @@ components:
Response summarizing all usage aggregated across the months in the request for
all organizations, and broken down by month and by organization.

Newly added billing dimensions and usage types appear as untyped keys on the
`additionalProperties` map instead of as typed fields. Call
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
at this response level—both typed fields and `additionalProperties` keys.
For SDK users only: all fields at this response level are accessible through the
`additionalProperties` map. Existing typed-field getters are unchanged. New billing
dimensions will not have typed-field getters. Use
[Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
to enumerate every available key.
properties:
agent_host_top99p_sum:
description: Shows the 99th percentile of all agent hosts over all hours in the current month for all organizations.
Expand Down Expand Up @@ -43215,11 +43218,12 @@ paths:
description: |-
Get all usage across your account.

Newly added billing dimensions and usage types appear as untyped keys on the
`additionalProperties` map of `UsageSummaryResponse`, `UsageSummaryDate`, and
`UsageSummaryDateOrg` instead of as typed fields. Call
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
at each response level—both typed fields and `additionalProperties` keys.
For SDK users only: all fields on `UsageSummaryResponse`, `UsageSummaryDate`, and
`UsageSummaryDateOrg` are accessible through each object's `additionalProperties` map.
Existing typed-field getters are unchanged. New billing dimensions will not have
typed-field getters. Use
[Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
to enumerate every available key at each response level.

This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
operationId: GetUsageSummary
Expand Down
31 changes: 31 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187306,6 +187306,37 @@ paths:
dimensions and usage types added after the v1 schema freeze).

This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).

Go example:

```go
fields, _, err := api.GetUsageSummaryAvailableFields(ctx)
attr := fields.Data.GetAttributes()

// resp is the *UsageSummaryResponse returned by api.GetUsageSummary(ctx, ...)
// Layer 1: UsageSummaryResponse
for _, key := range attr.GetResponseFields() {
if val, ok := resp.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
// Layer 2: UsageSummaryDate (per month)
for _, date := range resp.GetUsage() {
for _, key := range attr.GetDateFields() {
if val, ok := date.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
// Layer 3: UsageSummaryDateOrg (per org per month)
for _, org := range date.GetOrgs() {
for _, key := range attr.GetDateOrgFields() {
if val, ok := org.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
}
}
```
operationId: GetUsageSummaryAvailableFields
responses:
"200":
Expand Down
11 changes: 6 additions & 5 deletions src/datadog_api_client/v1/api/usage_metering_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2170,11 +2170,12 @@ def get_usage_summary(

Get all usage across your account.

Newly added billing dimensions and usage types appear as untyped keys on the
``additionalProperties`` map of ``UsageSummaryResponse`` , ``UsageSummaryDate`` , and
``UsageSummaryDateOrg`` instead of as typed fields. Call
``GET /api/v2/usage/summary/available_fields`` to enumerate every key returned
at each response level—both typed fields and ``additionalProperties`` keys.
For SDK users only: all fields on ``UsageSummaryResponse`` , ``UsageSummaryDate`` , and
``UsageSummaryDateOrg`` are accessible through each object's ``additionalProperties`` map.
Existing typed-field getters are unchanged. New billing dimensions will not have
typed-field getters. Use
`Get available fields for usage summary <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields>`_
to enumerate every available key at each response level.

This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.

Expand Down
9 changes: 5 additions & 4 deletions src/datadog_api_client/v1/model/usage_summary_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,10 +943,11 @@ def __init__(
"""
Response with hourly report of all data billed by Datadog for all organizations.

Newly added billing dimensions and usage types appear as untyped keys on the
``additionalProperties`` map instead of as typed fields. Call
``GET /api/v2/usage/summary/available_fields`` to enumerate every key returned
at this response level—both typed fields and ``additionalProperties`` keys.
For SDK users only: all fields at this response level are accessible through the
``additionalProperties`` map. Existing typed-field getters are unchanged. New billing
dimensions will not have typed-field getters. Use
`Get available fields for usage summary <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields>`_
to enumerate every available key.

:param agent_host_top99p: Shows the 99th percentile of all agent hosts over all hours in the current date for all organizations.
:type agent_host_top99p: int, optional
Expand Down
9 changes: 5 additions & 4 deletions src/datadog_api_client/v1/model/usage_summary_date_org.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,10 +954,11 @@ def __init__(
"""
Global hourly report of all data billed by Datadog for a given organization.

Newly added billing dimensions and usage types appear as untyped keys on the
``additionalProperties`` map instead of as typed fields. Call
``GET /api/v2/usage/summary/available_fields`` to enumerate every key returned
at this response level—both typed fields and ``additionalProperties`` keys.
For SDK users only: all fields at this response level are accessible through the
``additionalProperties`` map. Existing typed-field getters are unchanged. New billing
dimensions will not have typed-field getters. Use
`Get available fields for usage summary <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields>`_
to enumerate every available key.

:param account_name: The account name.
:type account_name: str, optional
Expand Down
9 changes: 5 additions & 4 deletions src/datadog_api_client/v1/model/usage_summary_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,11 @@ def __init__(
Response summarizing all usage aggregated across the months in the request for
all organizations, and broken down by month and by organization.

Newly added billing dimensions and usage types appear as untyped keys on the
``additionalProperties`` map instead of as typed fields. Call
``GET /api/v2/usage/summary/available_fields`` to enumerate every key returned
at this response level—both typed fields and ``additionalProperties`` keys.
For SDK users only: all fields at this response level are accessible through the
``additionalProperties`` map. Existing typed-field getters are unchanged. New billing
dimensions will not have typed-field getters. Use
`Get available fields for usage summary <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields>`_
to enumerate every available key.

:param agent_host_top99p_sum: Shows the 99th percentile of all agent hosts over all hours in the current month for all organizations.
:type agent_host_top99p_sum: int, optional
Expand Down
31 changes: 31 additions & 0 deletions src/datadog_api_client/v2/api/usage_metering_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,37 @@ def get_usage_summary_available_fields(

This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.

Go example:

.. code-block:: go

fields, _, err := api.GetUsageSummaryAvailableFields(ctx)
attr := fields.Data.GetAttributes()

// resp is the *UsageSummaryResponse returned by api.GetUsageSummary(ctx, ...)
// Layer 1: UsageSummaryResponse
for _, key := range attr.GetResponseFields() {
if val, ok := resp.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
// Layer 2: UsageSummaryDate (per month)
for _, date := range resp.GetUsage() {
for _, key := range attr.GetDateFields() {
if val, ok := date.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
// Layer 3: UsageSummaryDateOrg (per org per month)
for _, org := range date.GetOrgs() {
for _, key := range attr.GetDateOrgFields() {
if val, ok := org.AdditionalProperties[key]; ok {
fmt.Println(key, val.(json.Number))
}
}
}
}

:rtype: UsageSummaryAvailableFieldsResponse
"""
kwargs: Dict[str, Any] = {}
Expand Down
Loading