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
631 changes: 628 additions & 3 deletions .generator/schemas/v1/openapi.yaml

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96978,6 +96978,67 @@ components:
$ref: "#/components/schemas/UsageDataObject"
type: array
type: object
UsageSummaryAvailableFieldsAttributes:
description: |-
The lists of field names returned by `GET /api/v1/usage/summary` at each
of its three response levels. Each list contains every key the data endpoint
emits—both typed fields declared in the OpenAPI spec and untyped keys
exposed through `additionalProperties`.
properties:
date_fields:
description: |-
Sorted list of every key returned inside each `UsageSummaryDate`
entry of `usage[]` (typed fields and `additionalProperties` keys
combined).
items:
type: string
type: array
date_org_fields:
description: |-
Sorted list of every key returned inside each `UsageSummaryDateOrg`
entry of `usage[].orgs[]` (typed fields and `additionalProperties`
keys combined).
items:
type: string
type: array
response_fields:
description: |-
Sorted list of every key returned as a direct property of
`UsageSummaryResponse` (typed fields and `additionalProperties`
keys combined).
items:
type: string
type: array
type: object
UsageSummaryAvailableFieldsBody:
description: Available-fields data.
properties:
attributes:
$ref: "#/components/schemas/UsageSummaryAvailableFieldsAttributes"
id:
description: The identifier for the discovery scope. Always `"all"`.
example: all
type: string
type:
$ref: "#/components/schemas/UsageSummaryAvailableFieldsType"
type: object
UsageSummaryAvailableFieldsResponse:
description: |-
Response listing every field name returned by `GET /api/v1/usage/summary`
at each of its three response levels. Includes both typed fields and untyped
`additionalProperties` keys.
properties:
data:
$ref: "#/components/schemas/UsageSummaryAvailableFieldsBody"
type: object
UsageSummaryAvailableFieldsType:
default: usage_summary_available_fields
description: Type of available-fields data.
enum:
- usage_summary_available_fields
type: string
x-enum-varnames:
- USAGE_SUMMARY_AVAILABLE_FIELDS
UsageTimeSeriesObject:
description: Usage timeseries data.
properties:
Expand Down Expand Up @@ -174018,6 +174079,67 @@ paths:
permissions:
- usage_read
- billing_read
/api/v2/usage/summary/available_fields:
get:
description: |-
List the field names returned by `GET /api/v1/usage/summary` at each of its
three response levels. Each list contains every key the data endpoint
emits—both typed fields declared in the OpenAPI spec and untyped keys
exposed through `additionalProperties` (the latter used for billing
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/).
operationId: GetUsageSummaryAvailableFields
responses:
"200":
content:
application/json;datetime-format=rfc3339:
examples:
default:
value:
data:
attributes:
date_fields:
- agent_host_top99p
- aws_host_top99p
- ccm_anthropic_spend_last
date_org_fields:
- agent_host_top99p
- aws_host_top99p
- ccm_anthropic_spend_last
response_fields:
- agent_host_top99p_sum
- aws_host_top99p_sum
- ccm_anthropic_spend_last_sum
id: all
type: usage_summary_available_fields
schema:
$ref: "#/components/schemas/UsageSummaryAvailableFieldsResponse"
description: OK.
"403":
content:
application/json;datetime-format=rfc3339:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Forbidden - User is not authorized.
"429":
content:
application/json;datetime-format=rfc3339:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Too many requests.
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- usage_read
summary: Get available fields for usage summary
tags:
- Usage Metering
"x-permission":
operator: OR
permissions:
- usage_read
/api/v2/usage/usage-attribution-types:
get:
description: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-06-02T19:26:31.725Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions examples/v2/usage-metering/GetUsageSummaryAvailableFields.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get available fields for usage summary returns "OK." response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
p api_instance.get_usage_summary_available_fields()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get available fields for usage summary returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
p api_instance.get_usage_summary_available_fields()
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8562,6 +8562,12 @@
"type": "safe"
}
},
"GetUsageSummaryAvailableFields": {
"tag": "Usage Metering",
"undo": {
"type": "safe"
}
},
"GetUsageAttributionTypes": {
"tag": "Usage Metering",
"undo": {
Expand Down
23 changes: 23 additions & 0 deletions features/v2/usage_metering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,29 @@ Feature: Usage Metering
When the request is sent
Then the response status is 200 OK

@team:DataDog/billing-hub
Scenario: Get available fields for usage summary returns "Bad Request" response
Given new "GetUsageSummaryAvailableFields" request
When the request is sent
Then the response status is 400 Bad Request

@skip @team:DataDog/billing-hub
Scenario: Get available fields for usage summary returns "OK" response
Given new "GetUsageSummaryAvailableFields" request
When the request is sent
Then the response status is 200 OK
And the response "data.id" is equal to "all"
And the response "data.type" is equal to "usage_summary_available_fields"
And the response "data.attributes" has field "response_fields"
And the response "data.attributes" has field "date_fields"
And the response "data.attributes" has field "date_org_fields"

@generated @skip @team:DataDog/billing-hub
Scenario: Get available fields for usage summary returns "OK." response
Given new "GetUsageSummaryAvailableFields" request
When the request is sent
Then the response status is 200 OK.

@team:DataDog/billing-hub
Scenario: Get billing dimension mapping for usage endpoints returns "Bad Request" response
Given new "GetBillingDimensionMapping" request
Expand Down
4 changes: 4 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7102,6 +7102,10 @@ def overrides
"v2.usage_data_object" => "UsageDataObject",
"v2.usage_lambda_traced_invocations_response" => "UsageLambdaTracedInvocationsResponse",
"v2.usage_observability_pipelines_response" => "UsageObservabilityPipelinesResponse",
"v2.usage_summary_available_fields_attributes" => "UsageSummaryAvailableFieldsAttributes",
"v2.usage_summary_available_fields_body" => "UsageSummaryAvailableFieldsBody",
"v2.usage_summary_available_fields_response" => "UsageSummaryAvailableFieldsResponse",
"v2.usage_summary_available_fields_type" => "UsageSummaryAvailableFieldsType",
"v2.usage_time_series_object" => "UsageTimeSeriesObject",
"v2.usage_time_series_type" => "UsageTimeSeriesType",
"v2.user" => "User",
Expand Down
6 changes: 6 additions & 0 deletions lib/datadog_api_client/v1/api/usage_metering_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +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.
#
# This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
#
# @param start_month [Time] Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago.
Expand Down
Loading
Loading