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
31 changes: 28 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22716,7 +22716,13 @@ components:
$ref: "#/components/schemas/UsageSpecifiedCustomReportsMeta"
type: object
UsageSummaryDate:
description: Response with hourly report of all data billed by Datadog all organizations.
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.
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 @@ -23739,7 +23745,13 @@ components:
type: integer
type: object
UsageSummaryDateOrg:
description: Global hourly report of all data billed by Datadog for a given organization.
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.
properties:
account_name:
description: The account name.
Expand Down Expand Up @@ -24780,7 +24792,14 @@ components:
type: integer
type: object
UsageSummaryResponse:
description: Response summarizing all usage aggregated across the months in the request for all organizations, and broken down by month and by organization.
description: |-
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.
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 @@ -42260,6 +42279,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.

This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
operationId: GetUsageSummary
parameters:
Expand Down
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
24 changes: 24 additions & 0 deletions examples/v2/usage-metering/GetUsageSummaryAvailableFields.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Get available fields for usage summary returns "OK." response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.UsageMeteringApi;
import com.datadog.api.client.v2.model.UsageSummaryAvailableFieldsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
UsageMeteringApi apiInstance = new UsageMeteringApi(defaultClient);

try {
UsageSummaryAvailableFieldsResponse result = apiInstance.getUsageSummaryAvailableFields();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsageMeteringApi#getUsageSummaryAvailableFields");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Get available fields for usage summary returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.UsageMeteringApi;
import com.datadog.api.client.v2.model.UsageSummaryAvailableFieldsResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
UsageMeteringApi apiInstance = new UsageMeteringApi(defaultClient);

try {
UsageSummaryAvailableFieldsResponse result = apiInstance.getUsageSummaryAvailableFields();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsageMeteringApi#getUsageSummaryAvailableFields");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7231,6 +7231,12 @@ public CompletableFuture<UsageSummaryResponse> getUsageSummaryAsync(
/**
* Get all usage across your account.
*
* <p>Newly added billing dimensions and usage types appear as untyped keys on the <code>
* additionalProperties</code> map of <code>UsageSummaryResponse</code>, <code>UsageSummaryDate
* </code>, and <code>UsageSummaryDateOrg</code> instead of as typed fields. Call <code>
* GET /api/v2/usage/summary/available_fields</code> to enumerate every key returned at each
* response level—both typed fields and <code>additionalProperties</code> keys.
*
* <p>This endpoint is only accessible for <a
* href="https://docs.datadoghq.com/account_management/multi_organization/">parent-level
* organizations</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
import java.util.Map;
import java.util.Objects;

/** Response with hourly report of all data billed by Datadog all organizations. */
/**
* Response with hourly report of all data billed by Datadog for all organizations.
*
* <p>Newly added billing dimensions and usage types appear as untyped keys on the <code>
* additionalProperties</code> map instead of as typed fields. Call <code>
* GET /api/v2/usage/summary/available_fields</code> to enumerate every key returned at this
* response level—both typed fields and <code>additionalProperties</code> keys.
*/
@JsonPropertyOrder({
UsageSummaryDate.JSON_PROPERTY_AGENT_HOST_TOP99P,
UsageSummaryDate.JSON_PROPERTY_APM_AZURE_APP_SERVICE_HOST_TOP99P,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
import java.util.Map;
import java.util.Objects;

/** Global hourly report of all data billed by Datadog for a given organization. */
/**
* Global hourly report of all data billed by Datadog for a given organization.
*
* <p>Newly added billing dimensions and usage types appear as untyped keys on the <code>
* additionalProperties</code> map instead of as typed fields. Call <code>
* GET /api/v2/usage/summary/available_fields</code> to enumerate every key returned at this
* response level—both typed fields and <code>additionalProperties</code> keys.
*/
@JsonPropertyOrder({
UsageSummaryDateOrg.JSON_PROPERTY_ACCOUNT_NAME,
UsageSummaryDateOrg.JSON_PROPERTY_ACCOUNT_PUBLIC_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
/**
* Response summarizing all usage aggregated across the months in the request for all organizations,
* and broken down by month and by organization.
*
* <p>Newly added billing dimensions and usage types appear as untyped keys on the <code>
* additionalProperties</code> map instead of as typed fields. Call <code>
* GET /api/v2/usage/summary/available_fields</code> to enumerate every key returned at this
* response level—both typed fields and <code>additionalProperties</code> keys.
*/
@JsonPropertyOrder({
UsageSummaryResponse.JSON_PROPERTY_AGENT_HOST_TOP99P_SUM,
Expand Down
Loading
Loading