Skip to content

Commit 4126514

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit df23174c of spec repo
1 parent 5643561 commit 4126514

File tree

17 files changed

+701
-4
lines changed

17 files changed

+701
-4
lines changed

.apigentools-info

+4-4
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-28 23:07:49.920278",
8-
"spec_repo_commit": "4251a422"
7+
"regenerated": "2024-10-29 15:48:03.177653",
8+
"spec_repo_commit": "df23174c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-28 23:07:49.941724",
13-
"spec_repo_commit": "4251a422"
12+
"regenerated": "2024-10-29 15:48:03.196140",
13+
"spec_repo_commit": "df23174c"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+132
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,74 @@ components:
21792179
- storage_account
21802180
- storage_container
21812181
type: object
2182+
BillingDimensionsMappingBody:
2183+
description: Billing dimensions mapping data.
2184+
items:
2185+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItem'
2186+
type: array
2187+
BillingDimensionsMappingBodyItem:
2188+
description: The mapping data for each billing dimension.
2189+
properties:
2190+
attributes:
2191+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributes'
2192+
id:
2193+
description: ID of the billing dimension.
2194+
type: string
2195+
type:
2196+
$ref: '#/components/schemas/ActiveBillingDimensionsType'
2197+
type: object
2198+
BillingDimensionsMappingBodyItemAttributes:
2199+
description: Mapping of billing dimensions to endpoint keys.
2200+
properties:
2201+
endpoints:
2202+
description: List of supported endpoints with their keys mapped to the billing_dimension.
2203+
items:
2204+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItems'
2205+
type: array
2206+
in_app_label:
2207+
description: Label used for the billing dimension in the Plan & Usage charts.
2208+
example: APM Hosts
2209+
type: string
2210+
timestamp:
2211+
description: 'Month in ISO-8601 format, UTC, and precise to the second:
2212+
`[YYYY-MM-DDThh:mm:ss]`.'
2213+
format: date-time
2214+
type: string
2215+
type: object
2216+
BillingDimensionsMappingBodyItemAttributesEndpointsItems:
2217+
description: An endpoint's keys mapped to the billing_dimension.
2218+
properties:
2219+
id:
2220+
description: The URL for the endpoint.
2221+
example: api/v1/usage/billable-summary
2222+
type: string
2223+
keys:
2224+
description: The billing dimension.
2225+
example:
2226+
- apm_host_top99p
2227+
- apm_host_sum
2228+
items:
2229+
example: apm_host_top99p
2230+
type: string
2231+
type: array
2232+
status:
2233+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus'
2234+
type: object
2235+
BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus:
2236+
description: Denotes whether mapping keys were available for this endpoint.
2237+
enum:
2238+
- OK
2239+
- NOT_FOUND
2240+
type: string
2241+
x-enum-varnames:
2242+
- OK
2243+
- NOT_FOUND
2244+
BillingDimensionsMappingResponse:
2245+
description: Billing dimensions mapping response.
2246+
properties:
2247+
data:
2248+
$ref: '#/components/schemas/BillingDimensionsMappingBody'
2249+
type: object
21822250
BulkMuteFindingsRequest:
21832251
description: The new bulk mute finding request.
21842252
properties:
@@ -40478,6 +40546,70 @@ paths:
4047840546
operator: OR
4047940547
permissions:
4048040548
- usage_read
40549+
/api/v2/usage/billing_dimension_mapping:
40550+
get:
40551+
description: 'Get a mapping of billing dimensions to the corresponding keys
40552+
for the supported usage metering public API endpoints.
40553+
40554+
Mapping data is updated on a monthly cadence.
40555+
40556+
40557+
This endpoint is only accessible to [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
40558+
operationId: GetBillingDimensionMapping
40559+
parameters:
40560+
- description: Datetime in ISO-8601 format, UTC, and for mappings beginning
40561+
this month. Defaults to the current month.
40562+
in: query
40563+
name: filter[month]
40564+
required: false
40565+
schema:
40566+
format: date-time
40567+
type: string
40568+
- description: String to specify whether to retrieve active billing dimension
40569+
mappings for the contract or for all available mappings. Allowed views have
40570+
the string `active` or `all`. Defaults to `active`.
40571+
in: query
40572+
name: filter[view]
40573+
required: false
40574+
schema:
40575+
default: active
40576+
type: string
40577+
responses:
40578+
'200':
40579+
content:
40580+
application/json;datetime-format=rfc3339:
40581+
schema:
40582+
$ref: '#/components/schemas/BillingDimensionsMappingResponse'
40583+
description: OK
40584+
'400':
40585+
content:
40586+
application/json;datetime-format=rfc3339:
40587+
schema:
40588+
$ref: '#/components/schemas/APIErrorResponse'
40589+
description: Bad Request
40590+
'403':
40591+
content:
40592+
application/json;datetime-format=rfc3339:
40593+
schema:
40594+
$ref: '#/components/schemas/APIErrorResponse'
40595+
description: Forbidden - User is not authorized
40596+
'429':
40597+
content:
40598+
application/json;datetime-format=rfc3339:
40599+
schema:
40600+
$ref: '#/components/schemas/APIErrorResponse'
40601+
description: Too many requests
40602+
security:
40603+
- apiKeyAuth: []
40604+
appKeyAuth: []
40605+
- AuthZ:
40606+
- usage_read
40607+
summary: Get billing dimension mapping for usage endpoints
40608+
tags:
40609+
- Usage Metering
40610+
x-unstable: '**Note**: This endpoint is in Preview.
40611+
40612+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
4048140613
/api/v2/usage/cost_by_org:
4048240614
get:
4048340615
deprecated: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-10-28T16:04:40.774Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"log": {
3+
"_recordingName": "Usage Metering/Get billing dimension mapping for usage endpoints returns \"Bad Request\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "49fc3efb4f23bbdeb855c3d4aa87f91c",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json;datetime-format=rfc3339"
22+
}
23+
],
24+
"headersSize": 562,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [],
28+
"url": "https://api.datadoghq.com/api/v2/usage/billing_dimension_mapping"
29+
},
30+
"response": {
31+
"bodySize": 205,
32+
"content": {
33+
"mimeType": "application/vnd.api+json",
34+
"size": 205,
35+
"text": "{\"errors\":[{\"id\":null,\"links\":null,\"status\":\"400\",\"code\":null,\"title\":\"Bad Request\",\"detail\":\"API called with non-parent org keys. Data is only available at the root level org\",\"source\":null,\"meta\":null}]}"
36+
},
37+
"cookies": [],
38+
"headers": [
39+
{
40+
"name": "content-type",
41+
"value": "application/vnd.api+json"
42+
}
43+
],
44+
"headersSize": 358,
45+
"httpVersion": "HTTP/1.1",
46+
"redirectURL": "",
47+
"status": 400,
48+
"statusText": "Bad Request"
49+
},
50+
"startedDateTime": "2024-10-28T16:04:40.783Z",
51+
"time": 526
52+
}
53+
],
54+
"pages": [],
55+
"version": "1.2"
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Get billing dimension mapping for usage endpoints returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getBillingDimensionMapping"] = true;
9+
const apiInstance = new v2.UsageMeteringApi(configuration);
10+
11+
apiInstance
12+
.getBillingDimensionMapping()
13+
.then((data: v2.BillingDimensionsMappingResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

+11
Original file line numberDiff line numberDiff line change
@@ -3183,6 +3183,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
31833183
},
31843184
"operationResponseType": "UsageApplicationSecurityMonitoringResponse",
31853185
},
3186+
"v2.GetBillingDimensionMapping": {
3187+
"filterMonth": {
3188+
"type": "Date",
3189+
"format": "date-time",
3190+
},
3191+
"filterView": {
3192+
"type": "string",
3193+
"format": "",
3194+
},
3195+
"operationResponseType": "BillingDimensionsMappingResponse",
3196+
},
31863197
"v2.GetCostByOrg": {
31873198
"startMonth": {
31883199
"type": "Date",

features/v2/undo.json

+6
Original file line numberDiff line numberDiff line change
@@ -2445,6 +2445,12 @@
24452445
"type": "safe"
24462446
}
24472447
},
2448+
"GetBillingDimensionMapping": {
2449+
"tag": "Usage Metering",
2450+
"undo": {
2451+
"type": "safe"
2452+
}
2453+
},
24482454
"GetCostByOrg": {
24492455
"tag": "Usage Metering",
24502456
"undo": {

features/v2/usage_metering.feature

+14
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ Feature: Usage Metering
4848
When the request is sent
4949
Then the response status is 200 OK
5050

51+
@team:DataDog/revenue-query
52+
Scenario: Get billing dimension mapping for usage endpoints returns "Bad Request" response
53+
Given operation "GetBillingDimensionMapping" enabled
54+
And new "GetBillingDimensionMapping" request
55+
When the request is sent
56+
Then the response status is 400 Bad Request
57+
58+
@skip @team:DataDog/revenue-query
59+
Scenario: Get billing dimension mapping for usage endpoints returns "OK" response
60+
Given operation "GetBillingDimensionMapping" enabled
61+
And new "GetBillingDimensionMapping" request
62+
When the request is sent
63+
Then the response status is 200 OK
64+
5165
@generated @skip @team:DataDog/revenue-query
5266
Scenario: Get cost across multi-org account returns "Bad Request" response
5367
Given new "GetCostByOrg" request

packages/datadog-api-client-common/configuration.ts

+1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export function createConfiguration(
228228
"v2.listAPIs": false,
229229
"v2.updateOpenAPI": false,
230230
"v2.getActiveBillingDimensions": false,
231+
"v2.getBillingDimensionMapping": false,
231232
"v2.getMonthlyCostAttribution": false,
232233
"v2.createDORADeployment": false,
233234
"v2.createDORAIncident": false,

0 commit comments

Comments
 (0)