Skip to content

Commit 45298c5

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c4c9bbbf of spec repo
1 parent 92f15d0 commit 45298c5

14 files changed

+756
-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-09-18 14:45:18.857935",
8-
"spec_repo_commit": "bae57ce1"
7+
"regenerated": "2024-09-18 15:49:52.676059",
8+
"spec_repo_commit": "c4c9bbbf"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-18 14:45:18.876103",
13-
"spec_repo_commit": "bae57ce1"
12+
"regenerated": "2024-09-18 15:49:52.694413",
13+
"spec_repo_commit": "c4c9bbbf"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,6 +2175,73 @@ components:
21752175
- storage_account
21762176
- storage_container
21772177
type: object
2178+
BillingDimensionsMappingBody:
2179+
description: Billing dimensions mapping data.
2180+
items:
2181+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItem'
2182+
type: array
2183+
BillingDimensionsMappingBodyItem:
2184+
description: The definition of `BillingDimensionsMappingBodyItem` object.
2185+
properties:
2186+
attributes:
2187+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributes'
2188+
id:
2189+
description: ID of the billing dimension.
2190+
type: string
2191+
type:
2192+
$ref: '#/components/schemas/ActiveBillingDimensionsType'
2193+
type: object
2194+
BillingDimensionsMappingBodyItemAttributes:
2195+
description: Mapping of billing dimensions to endpoint keys.
2196+
properties:
2197+
endpoints:
2198+
description: List of supported endpoints with their keys mapped to the billing_dimension.
2199+
items:
2200+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItems'
2201+
type: array
2202+
in_app_label:
2203+
description: Label used for the billing dimension in the Plan & Usage charts.
2204+
example: APM Hosts
2205+
type: string
2206+
timestamp:
2207+
description: 'Month in ISO-8601 format, UTC, precise to second: `[YYYY-MM-DDThh:mm:ss]`.'
2208+
format: date-time
2209+
type: string
2210+
type: object
2211+
BillingDimensionsMappingBodyItemAttributesEndpointsItems:
2212+
description: An endpoint's keys mapped to the billing_dimension.
2213+
properties:
2214+
id:
2215+
description: The URL for the endpoint.
2216+
example: api/v1/usage/billable-summary
2217+
type: string
2218+
keys:
2219+
description: The billing dimension.
2220+
example:
2221+
- apm_host_top99p
2222+
- apm_host_sum
2223+
items:
2224+
example: apm_host_top99p
2225+
type: string
2226+
type: array
2227+
status:
2228+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus'
2229+
type: object
2230+
BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus:
2231+
description: Denotes whether or not mapping keys were available for this endpoint.
2232+
enum:
2233+
- OK
2234+
- NOT_FOUND
2235+
type: string
2236+
x-enum-varnames:
2237+
- OK
2238+
- NOT_FOUND
2239+
BillingDimensionsMappingResponse:
2240+
description: Billing dimensions mapping response.
2241+
properties:
2242+
data:
2243+
$ref: '#/components/schemas/BillingDimensionsMappingBody'
2244+
type: object
21782245
BulkMuteFindingsRequest:
21792246
description: The new bulk mute finding request.
21802247
properties:
@@ -38471,6 +38538,68 @@ paths:
3847138538
summary: Get hourly usage for application security
3847238539
tags:
3847338540
- Usage Metering
38541+
/api/v2/usage/billing_dimension_mapping:
38542+
get:
38543+
description: 'Get a mapping of billing dimensions to the corresponding keys
38544+
for the supported usage metering public API endpoints.
38545+
38546+
38547+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
38548+
operationId: GetBillingDimensionMapping
38549+
parameters:
38550+
- description: Datetime in ISO-8601 format, UTC, for mappings beginning this
38551+
month. Defaults to the current month.
38552+
in: query
38553+
name: filter[month]
38554+
required: false
38555+
schema:
38556+
format: date-time
38557+
type: string
38558+
- description: String to specify whether to retrieve active billing dimension
38559+
mappings for the contract or all available mappings. Allowed views are `active`
38560+
and `all`. Defaults to `active`.
38561+
in: query
38562+
name: filter[view]
38563+
required: false
38564+
schema:
38565+
default: active
38566+
type: string
38567+
responses:
38568+
'200':
38569+
content:
38570+
application/json;datetime-format=rfc3339:
38571+
schema:
38572+
$ref: '#/components/schemas/BillingDimensionsMappingResponse'
38573+
description: OK
38574+
'400':
38575+
content:
38576+
application/json;datetime-format=rfc3339:
38577+
schema:
38578+
$ref: '#/components/schemas/APIErrorResponse'
38579+
description: Bad Request
38580+
'403':
38581+
content:
38582+
application/json;datetime-format=rfc3339:
38583+
schema:
38584+
$ref: '#/components/schemas/APIErrorResponse'
38585+
description: Forbidden - User is not authorized
38586+
'429':
38587+
content:
38588+
application/json;datetime-format=rfc3339:
38589+
schema:
38590+
$ref: '#/components/schemas/APIErrorResponse'
38591+
description: Too many requests
38592+
security:
38593+
- apiKeyAuth: []
38594+
appKeyAuth: []
38595+
- AuthZ:
38596+
- usage_read
38597+
summary: Get billing dimension mapping for usage endpoints
38598+
tags:
38599+
- Usage Metering
38600+
x-unstable: '**Note**: This endpoint is in public beta.
38601+
38602+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
3847438603
/api/v2/usage/cost_by_org:
3847538604
get:
3847638605
deprecated: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get billing dimension mapping for usage endpoints returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_billing_dimension_mapping".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new
8+
p api_instance.get_billing_dimension_mapping()

features/scenarios_model_mapping.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,10 @@
11161116
"start_hr" => "Time",
11171117
"end_hr" => "Time",
11181118
},
1119+
"v2.GetBillingDimensionMapping" => {
1120+
"filter_month" => "Time",
1121+
"filter_view" => "String",
1122+
},
11191123
"v2.GetCostByOrg" => {
11201124
"start_month" => "Time",
11211125
"end_month" => "Time",

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,12 @@
23652365
"type": "safe"
23662366
}
23672367
},
2368+
"GetBillingDimensionMapping": {
2369+
"tag": "Usage Metering",
2370+
"undo": {
2371+
"type": "safe"
2372+
}
2373+
},
23682374
"GetCostByOrg": {
23692375
"tag": "Usage Metering",
23702376
"undo": {

features/v2/usage_metering.feature

Lines changed: 14 additions & 0 deletions
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+
@generated @skip @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+
@generated @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

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def initialize
195195
"v2.list_apis": false,
196196
"v2.update_open_api": false,
197197
"v2.get_active_billing_dimensions": false,
198+
"v2.get_billing_dimension_mapping": false,
198199
"v2.get_monthly_cost_attribution": false,
199200
"v2.create_dora_deployment": false,
200201
"v2.create_dora_incident": false,

lib/datadog_api_client/inflector.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,11 @@ def overrides
985985
"v2.azure_uc_config_post_request_type" => "AzureUCConfigPostRequestType",
986986
"v2.azure_uc_configs_response" => "AzureUCConfigsResponse",
987987
"v2.bill_config" => "BillConfig",
988+
"v2.billing_dimensions_mapping_body_item" => "BillingDimensionsMappingBodyItem",
989+
"v2.billing_dimensions_mapping_body_item_attributes" => "BillingDimensionsMappingBodyItemAttributes",
990+
"v2.billing_dimensions_mapping_body_item_attributes_endpoints_items" => "BillingDimensionsMappingBodyItemAttributesEndpointsItems",
991+
"v2.billing_dimensions_mapping_body_item_attributes_endpoints_items_status" => "BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus",
992+
"v2.billing_dimensions_mapping_response" => "BillingDimensionsMappingResponse",
988993
"v2.bulk_mute_findings_request" => "BulkMuteFindingsRequest",
989994
"v2.bulk_mute_findings_request_attributes" => "BulkMuteFindingsRequestAttributes",
990995
"v2.bulk_mute_findings_request_data" => "BulkMuteFindingsRequestData",

lib/datadog_api_client/v2/api/usage_metering_api.rb

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,78 @@ def get_active_billing_dimensions_with_http_info(opts = {})
8989
return data, status_code, headers
9090
end
9191

92+
# Get billing dimension mapping for usage endpoints.
93+
#
94+
# @see #get_billing_dimension_mapping_with_http_info
95+
def get_billing_dimension_mapping(opts = {})
96+
data, _status_code, _headers = get_billing_dimension_mapping_with_http_info(opts)
97+
data
98+
end
99+
100+
# Get billing dimension mapping for usage endpoints.
101+
#
102+
# Get a mapping of billing dimensions to the corresponding keys for the supported usage metering public API endpoints.
103+
#
104+
# This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
105+
#
106+
# @param opts [Hash] the optional parameters
107+
# @option opts [Time] :filter_month Datetime in ISO-8601 format, UTC, for mappings beginning this month. Defaults to the current month.
108+
# @option opts [String] :filter_view 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`.
109+
# @return [Array<(BillingDimensionsMappingResponse, Integer, Hash)>] BillingDimensionsMappingResponse data, response status code and response headers
110+
def get_billing_dimension_mapping_with_http_info(opts = {})
111+
unstable_enabled = @api_client.config.unstable_operations["v2.get_billing_dimension_mapping".to_sym]
112+
if unstable_enabled
113+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_billing_dimension_mapping")
114+
else
115+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_billing_dimension_mapping"))
116+
end
117+
118+
if @api_client.config.debugging
119+
@api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_billing_dimension_mapping ...'
120+
end
121+
# resource path
122+
local_var_path = '/api/v2/usage/billing_dimension_mapping'
123+
124+
# query parameters
125+
query_params = opts[:query_params] || {}
126+
query_params[:'filter[month]'] = opts[:'filter_month'] if !opts[:'filter_month'].nil?
127+
query_params[:'filter[view]'] = opts[:'filter_view'] if !opts[:'filter_view'].nil?
128+
129+
# header parameters
130+
header_params = opts[:header_params] || {}
131+
# HTTP header 'Accept' (if needed)
132+
header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])
133+
134+
# form parameters
135+
form_params = opts[:form_params] || {}
136+
137+
# http body (model)
138+
post_body = opts[:debug_body]
139+
140+
# return_type
141+
return_type = opts[:debug_return_type] || 'BillingDimensionsMappingResponse'
142+
143+
# auth_names
144+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
145+
146+
new_options = opts.merge(
147+
:operation => :get_billing_dimension_mapping,
148+
:header_params => header_params,
149+
:query_params => query_params,
150+
:form_params => form_params,
151+
:body => post_body,
152+
:auth_names => auth_names,
153+
:return_type => return_type,
154+
:api_version => "V2"
155+
)
156+
157+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
158+
if @api_client.config.debugging
159+
@api_client.config.logger.debug "API called: UsageMeteringAPI#get_billing_dimension_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
160+
end
161+
return data, status_code, headers
162+
end
163+
92164
# Get cost across multi-org account.
93165
#
94166
# @see #get_cost_by_org_with_http_info

0 commit comments

Comments
 (0)