usage_summary_available_fields
Creates, updates, deletes, gets or lists a usage_summary_available_fields resource.
Overview
| Name | usage_summary_available_fields |
| Type | Resource |
| Id | datadog.organization.usage_summary_available_fields |
Fields
The following fields are returned by SELECT queries:
- get_usage_summary_available_fields
OK.
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier for the discovery scope. Always "all". (example: all) |
attributes | object | 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. |
type | string | Type of available-fields data. (usage_summary_available_fields) (default: usage_summary_available_fields) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_usage_summary_available_fields | select | List the field names returned by GET /api/v1/usage/summary at each of its<br />three response levels. Each list contains every key the data endpoint<br />emits—both typed fields declared in the OpenAPI spec and untyped keys<br />exposed through additionalProperties (the latter used for billing<br />dimensions and usage types added after the v1 schema freeze).<br /><br />This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).<br /><br />Go example:<br /><br />go<br />fields, _, err := api.GetUsageSummaryAvailableFields(ctx)<br />attr := fields.Data.GetAttributes()<br /><br />// resp is the *UsageSummaryResponse returned by api.GetUsageSummary(ctx, ...)<br />// Layer 1: UsageSummaryResponse<br />for _, key := range attr.GetResponseFields() {<br /> if val, ok := resp.AdditionalProperties[key]; ok {<br /> fmt.Println(key, val.(json.Number))<br /> }<br />}<br />// Layer 2: UsageSummaryDate (per month)<br />for _, date := range resp.GetUsage() {<br /> for _, key := range attr.GetDateFields() {<br /> if val, ok := date.AdditionalProperties[key]; ok {<br /> fmt.Println(key, val.(json.Number))<br /> }<br /> }<br /> // Layer 3: UsageSummaryDateOrg (per org per month)<br /> for _, org := range date.GetOrgs() {<br /> for _, key := range attr.GetDateOrgFields() {<br /> if val, ok := org.AdditionalProperties[key]; ok {<br /> fmt.Println(key, val.(json.Number))<br /> }<br /> }<br /> }<br />}<br /> |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
SELECT examples
- get_usage_summary_available_fields
List the field names returned by GET /api/v1/usage/summary at each of its<br />three response levels. Each list contains every key the data endpoint<br />emits—both typed fields declared in the OpenAPI spec and untyped keys<br />exposed through additionalProperties (the latter used for billing<br />dimensions and usage types added after the v1 schema freeze).<br /><br />This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).<br /><br />Go example:<br /><br />go<br />fields, _, err := api.GetUsageSummaryAvailableFields(ctx)<br />attr := fields.Data.GetAttributes()<br /><br />// resp is the *UsageSummaryResponse returned by api.GetUsageSummary(ctx, ...)<br />// Layer 1: UsageSummaryResponse<br />for _, key := range attr.GetResponseFields() {<br /> if val, ok := resp.AdditionalProperties[key]; ok {<br /> fmt.Println(key, val.(json.Number))<br /> }<br />}<br />// Layer 2: UsageSummaryDate (per month)<br />for _, date := range resp.GetUsage() {<br /> for _, key := range attr.GetDateFields() {<br /> if val, ok := date.AdditionalProperties[key]; ok {<br /> fmt.Println(key, val.(json.Number))<br /> }<br /> }<br /> // Layer 3: UsageSummaryDateOrg (per org per month)<br /> for _, org := range date.GetOrgs() {<br /> for _, key := range attr.GetDateOrgFields() {<br /> if val, ok := org.AdditionalProperties[key]; ok {<br /> fmt.Println(key, val.(json.Number))<br /> }<br /> }<br /> }<br />}<br />
SELECT
id,
attributes,
type
FROM datadog.organization.usage_summary_available_fields
;