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 lib/datadog_api_client/v1/api/usage_metering_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2342,11 +2342,12 @@ def get_usage_summary(start_month, opts = {})
#
# 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 lib/datadog_api_client/v1/models/usage_summary_date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
module DatadogAPIClient::V1
# 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.
class UsageSummaryDate
include BaseGenericModel

Expand Down
9 changes: 5 additions & 4 deletions lib/datadog_api_client/v1/models/usage_summary_date_org.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
module DatadogAPIClient::V1
# 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.
class UsageSummaryDateOrg
include BaseGenericModel

Expand Down
9 changes: 5 additions & 4 deletions lib/datadog_api_client/v1/models/usage_summary_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ module DatadogAPIClient::V1
# 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.
class UsageSummaryResponse
include BaseGenericModel

Expand Down
31 changes: 31 additions & 0 deletions lib/datadog_api_client/v2/api/usage_metering_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,37 @@ def get_usage_summary_available_fields(opts = {})
#
# 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))
# }
# }
# }
# }
# ```
#
# @param opts [Hash] the optional parameters
# @return [Array<(UsageSummaryAvailableFieldsResponse, Integer, Hash)>] UsageSummaryAvailableFieldsResponse data, response status code and response headers
def get_usage_summary_available_fields_with_http_info(opts = {})
Expand Down
Loading