Skip to content

Commit

Permalink
Regenerate client from commit 6a94e484 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Oct 22, 2024
1 parent 56f96c2 commit b5a6c99
Show file tree
Hide file tree
Showing 15 changed files with 642 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-21 20:59:46.944958",
"spec_repo_commit": "9ac9609b"
"regenerated": "2024-10-22 16:26:30.629876",
"spec_repo_commit": "6a94e484"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-21 20:59:46.962979",
"spec_repo_commit": "9ac9609b"
"regenerated": "2024-10-22 16:26:30.648865",
"spec_repo_commit": "6a94e484"
}
}
}
131 changes: 131 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,73 @@ components:
- storage_account
- storage_container
type: object
BillingDimensionsMappingBody:
description: Billing dimensions mapping data.
items:
$ref: '#/components/schemas/BillingDimensionsMappingBodyItem'
type: array
BillingDimensionsMappingBodyItem:
description: The definition of `BillingDimensionsMappingBodyItem` object.
properties:
attributes:
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributes'
id:
description: ID of the billing dimension.
type: string
type:
$ref: '#/components/schemas/ActiveBillingDimensionsType'
type: object
BillingDimensionsMappingBodyItemAttributes:
description: Mapping of billing dimensions to endpoint keys.
properties:
endpoints:
description: List of supported endpoints with their keys mapped to the billing_dimension.
items:
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItems'
type: array
in_app_label:
description: Label used for the billing dimension in the Plan & Usage charts.
example: APM Hosts
type: string
timestamp:
description: 'Month in ISO-8601 format, UTC, precise to second: `[YYYY-MM-DDThh:mm:ss]`.'
format: date-time
type: string
type: object
BillingDimensionsMappingBodyItemAttributesEndpointsItems:
description: An endpoint's keys mapped to the billing_dimension.
properties:
id:
description: The URL for the endpoint.
example: api/v1/usage/billable-summary
type: string
keys:
description: The billing dimension.
example:
- apm_host_top99p
- apm_host_sum
items:
example: apm_host_top99p
type: string
type: array
status:
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus'
type: object
BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus:
description: Denotes whether or not mapping keys were available for this endpoint.
enum:
- OK
- NOT_FOUND
type: string
x-enum-varnames:
- OK
- NOT_FOUND
BillingDimensionsMappingResponse:
description: Billing dimensions mapping response.
properties:
data:
$ref: '#/components/schemas/BillingDimensionsMappingBody'
type: object
BulkMuteFindingsRequest:
description: The new bulk mute finding request.
properties:
Expand Down Expand Up @@ -40066,6 +40133,70 @@ paths:
operator: OR
permissions:
- usage_read
/api/v2/usage/billing_dimension_mapping:
get:
description: 'Get a mapping of billing dimensions to the corresponding keys
for the supported usage metering public API endpoints.

Mapping data is updated on a monthly cadence.


This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
operationId: GetBillingDimensionMapping
parameters:
- description: Datetime in ISO-8601 format, UTC, for mappings beginning this
month. Defaults to the current month.
in: query
name: filter[month]
required: false
schema:
format: date-time
type: string
- description: String to specify whether to retrieve active billing dimension
mappings for the contract or all available mappings. Allowed views are `active`
and `all`. Defaults to `active`.
in: query
name: filter[view]
required: false
schema:
default: active
type: string
responses:
'200':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/BillingDimensionsMappingResponse'
description: OK
'400':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'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 billing dimension mapping for usage endpoints
tags:
- Usage Metering
x-unstable: '**Note**: This endpoint is in Preview.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/usage/cost_by_org:
get:
deprecated: true
Expand Down
18 changes: 18 additions & 0 deletions examples/v2/usage-metering/GetBillingDimensionMapping.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Get billing dimension mapping for usage endpoints returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getBillingDimensionMapping"] = true;
const apiInstance = new v2.UsageMeteringApi(configuration);

apiInstance
.getBillingDimensionMapping()
.then((data: v2.BillingDimensionsMappingResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
11 changes: 11 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3183,6 +3183,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "UsageApplicationSecurityMonitoringResponse",
},
"v2.GetBillingDimensionMapping": {
"filterMonth": {
"type": "Date",
"format": "date-time",
},
"filterView": {
"type": "string",
"format": "",
},
"operationResponseType": "BillingDimensionsMappingResponse",
},
"v2.GetCostByOrg": {
"startMonth": {
"type": "Date",
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2408,6 +2408,12 @@
"type": "safe"
}
},
"GetBillingDimensionMapping": {
"tag": "Usage Metering",
"undo": {
"type": "safe"
}
},
"GetCostByOrg": {
"tag": "Usage Metering",
"undo": {
Expand Down
14 changes: 14 additions & 0 deletions features/v2/usage_metering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ Feature: Usage Metering
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/revenue-query
Scenario: Get billing dimension mapping for usage endpoints returns "Bad Request" response
Given operation "GetBillingDimensionMapping" enabled
And new "GetBillingDimensionMapping" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/revenue-query
Scenario: Get billing dimension mapping for usage endpoints returns "OK" response
Given operation "GetBillingDimensionMapping" enabled
And new "GetBillingDimensionMapping" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/revenue-query
Scenario: Get cost across multi-org account returns "Bad Request" response
Given new "GetCostByOrg" request
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client-common/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export function createConfiguration(
"v2.listAPIs": false,
"v2.updateOpenAPI": false,
"v2.getActiveBillingDimensions": false,
"v2.getBillingDimensionMapping": false,
"v2.getMonthlyCostAttribution": false,
"v2.createDORADeployment": false,
"v2.createDORAIncident": false,
Expand Down
Loading

0 comments on commit b5a6c99

Please sign in to comment.