Skip to content

Commit fca6add

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Documentation for beta /v2/usage/billing_dimension_mapping (#2470)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 09b23cc commit fca6add

14 files changed

+1274
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-10-31 15:33:00.389365",
8-
"spec_repo_commit": "a7602fa1"
7+
"regenerated": "2024-10-31 16:03:59.333672",
8+
"spec_repo_commit": "a11da7b5"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-31 15:33:00.408035",
13-
"spec_repo_commit": "a7602fa1"
12+
"regenerated": "2024-10-31 16:03:59.352181",
13+
"spec_repo_commit": "a11da7b5"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,6 +2186,74 @@ components:
21862186
- storage_account
21872187
- storage_container
21882188
type: object
2189+
BillingDimensionsMappingBody:
2190+
description: Billing dimensions mapping data.
2191+
items:
2192+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItem'
2193+
type: array
2194+
BillingDimensionsMappingBodyItem:
2195+
description: The mapping data for each billing dimension.
2196+
properties:
2197+
attributes:
2198+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributes'
2199+
id:
2200+
description: ID of the billing dimension.
2201+
type: string
2202+
type:
2203+
$ref: '#/components/schemas/ActiveBillingDimensionsType'
2204+
type: object
2205+
BillingDimensionsMappingBodyItemAttributes:
2206+
description: Mapping of billing dimensions to endpoint keys.
2207+
properties:
2208+
endpoints:
2209+
description: List of supported endpoints with their keys mapped to the billing_dimension.
2210+
items:
2211+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItems'
2212+
type: array
2213+
in_app_label:
2214+
description: Label used for the billing dimension in the Plan & Usage charts.
2215+
example: APM Hosts
2216+
type: string
2217+
timestamp:
2218+
description: 'Month in ISO-8601 format, UTC, and precise to the second:
2219+
`[YYYY-MM-DDThh:mm:ss]`.'
2220+
format: date-time
2221+
type: string
2222+
type: object
2223+
BillingDimensionsMappingBodyItemAttributesEndpointsItems:
2224+
description: An endpoint's keys mapped to the billing_dimension.
2225+
properties:
2226+
id:
2227+
description: The URL for the endpoint.
2228+
example: api/v1/usage/billable-summary
2229+
type: string
2230+
keys:
2231+
description: The billing dimension.
2232+
example:
2233+
- apm_host_top99p
2234+
- apm_host_sum
2235+
items:
2236+
example: apm_host_top99p
2237+
type: string
2238+
type: array
2239+
status:
2240+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus'
2241+
type: object
2242+
BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus:
2243+
description: Denotes whether mapping keys were available for this endpoint.
2244+
enum:
2245+
- OK
2246+
- NOT_FOUND
2247+
type: string
2248+
x-enum-varnames:
2249+
- OK
2250+
- NOT_FOUND
2251+
BillingDimensionsMappingResponse:
2252+
description: Billing dimensions mapping response.
2253+
properties:
2254+
data:
2255+
$ref: '#/components/schemas/BillingDimensionsMappingBody'
2256+
type: object
21892257
BulkMuteFindingsRequest:
21902258
description: The new bulk mute finding request.
21912259
properties:
@@ -41037,6 +41105,70 @@ paths:
4103741105
operator: OR
4103841106
permissions:
4103941107
- usage_read
41108+
/api/v2/usage/billing_dimension_mapping:
41109+
get:
41110+
description: 'Get a mapping of billing dimensions to the corresponding keys
41111+
for the supported usage metering public API endpoints.
41112+
41113+
Mapping data is updated on a monthly cadence.
41114+
41115+
41116+
This endpoint is only accessible to [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
41117+
operationId: GetBillingDimensionMapping
41118+
parameters:
41119+
- description: Datetime in ISO-8601 format, UTC, and for mappings beginning
41120+
this month. Defaults to the current month.
41121+
in: query
41122+
name: filter[month]
41123+
required: false
41124+
schema:
41125+
format: date-time
41126+
type: string
41127+
- description: String to specify whether to retrieve active billing dimension
41128+
mappings for the contract or for all available mappings. Allowed views have
41129+
the string `active` or `all`. Defaults to `active`.
41130+
in: query
41131+
name: filter[view]
41132+
required: false
41133+
schema:
41134+
default: active
41135+
type: string
41136+
responses:
41137+
'200':
41138+
content:
41139+
application/json;datetime-format=rfc3339:
41140+
schema:
41141+
$ref: '#/components/schemas/BillingDimensionsMappingResponse'
41142+
description: OK
41143+
'400':
41144+
content:
41145+
application/json;datetime-format=rfc3339:
41146+
schema:
41147+
$ref: '#/components/schemas/APIErrorResponse'
41148+
description: Bad Request
41149+
'403':
41150+
content:
41151+
application/json;datetime-format=rfc3339:
41152+
schema:
41153+
$ref: '#/components/schemas/APIErrorResponse'
41154+
description: Forbidden - User is not authorized
41155+
'429':
41156+
content:
41157+
application/json;datetime-format=rfc3339:
41158+
schema:
41159+
$ref: '#/components/schemas/APIErrorResponse'
41160+
description: Too many requests
41161+
security:
41162+
- apiKeyAuth: []
41163+
appKeyAuth: []
41164+
- AuthZ:
41165+
- usage_read
41166+
summary: Get billing dimension mapping for usage endpoints
41167+
tags:
41168+
- Usage Metering
41169+
x-unstable: '**Note**: This endpoint is in Preview.
41170+
41171+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
4104041172
/api/v2/usage/cost_by_org:
4104141173
get:
4104241174
deprecated: true
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get billing dimension mapping for usage endpoints returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.UsageMeteringApi;
6+
import com.datadog.api.client.v2.model.BillingDimensionsMappingResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getBillingDimensionMapping", true);
12+
UsageMeteringApi apiInstance = new UsageMeteringApi(defaultClient);
13+
14+
try {
15+
BillingDimensionsMappingResponse result = apiInstance.getBillingDimensionMapping();
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling UsageMeteringApi#getBillingDimensionMapping");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ public class ApiClient {
373373
put("v2.listAPIs", false);
374374
put("v2.updateOpenAPI", false);
375375
put("v2.getActiveBillingDimensions", false);
376+
put("v2.getBillingDimensionMapping", false);
376377
put("v2.getMonthlyCostAttribution", false);
377378
put("v2.createDORADeployment", false);
378379
put("v2.createDORAIncident", false);

0 commit comments

Comments
 (0)