Skip to content

Commit 5307aa2

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a45a8aa9 of spec repo
1 parent f498b71 commit 5307aa2

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-10 15:39:59.557937",
8-
"spec_repo_commit": "80dc4248"
7+
"regenerated": "2024-09-10 17:48:03.026954",
8+
"spec_repo_commit": "a45a8aa9"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-10 15:39:59.575646",
13-
"spec_repo_commit": "80dc4248"
12+
"regenerated": "2024-09-10 17:48:03.044838",
13+
"spec_repo_commit": "a45a8aa9"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,73 @@ components:
21172117
- storage_account
21182118
- storage_container
21192119
type: object
2120+
BillingDimensionsMappingBody:
2121+
description: Billing dimensions mapping data.
2122+
items:
2123+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItem'
2124+
type: array
2125+
BillingDimensionsMappingBodyItem:
2126+
description: The definition of `BillingDimensionsMappingBodyItem` object.
2127+
properties:
2128+
attributes:
2129+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributes'
2130+
id:
2131+
description: ID of the billing dimension.
2132+
type: string
2133+
type:
2134+
$ref: '#/components/schemas/ActiveBillingDimensionsType'
2135+
type: object
2136+
BillingDimensionsMappingBodyItemAttributes:
2137+
description: Mapping of billing dimensions to endpoint keys.
2138+
properties:
2139+
endpoints:
2140+
description: List of supported endpoints with their keys mapped to the billing_dimension.
2141+
items:
2142+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItems'
2143+
type: array
2144+
in_app_label:
2145+
description: Label used for the billing dimension in the Plan & Usage charts.
2146+
example: APM Hosts
2147+
type: string
2148+
timestamp:
2149+
description: 'Month in ISO-8601 format, UTC, precise to second: `[YYYY-MM-DDThh:mm:ss]`.'
2150+
format: date-time
2151+
type: string
2152+
type: object
2153+
BillingDimensionsMappingBodyItemAttributesEndpointsItems:
2154+
description: An endpoint's keys mapped to the billing_dimension.
2155+
properties:
2156+
id:
2157+
description: The URL for the endpoint.
2158+
example: api/v1/usage/billable-summary
2159+
type: string
2160+
keys:
2161+
description: The billing dimension.
2162+
example:
2163+
- apm_host_top99p
2164+
- apm_host_sum
2165+
items:
2166+
example: apm_host_top99p
2167+
type: string
2168+
type: array
2169+
status:
2170+
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus'
2171+
type: object
2172+
BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus:
2173+
description: Denotes whether or not mapping keys were available for this endpoint.
2174+
enum:
2175+
- OK
2176+
- NOT_FOUND
2177+
type: string
2178+
x-enum-varnames:
2179+
- OK
2180+
- NOT_FOUND
2181+
BillingDimensionsMappingResponse:
2182+
description: Billing dimensions mapping response.
2183+
properties:
2184+
data:
2185+
$ref: '#/components/schemas/BillingDimensionsMappingBody'
2186+
type: object
21202187
BulkMuteFindingsRequest:
21212188
description: The new bulk mute finding request.
21222189
properties:
@@ -38362,6 +38429,68 @@ paths:
3836238429
summary: Get hourly usage for application security
3836338430
tags:
3836438431
- Usage Metering
38432+
/api/v2/usage/billing_dimension_mapping:
38433+
get:
38434+
description: 'Get a mapping of billing dimensions to the corresponding keys
38435+
for the supported usage metering public API endpoints.
38436+
38437+
38438+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
38439+
operationId: GetBillingDimensionMapping
38440+
parameters:
38441+
- description: Datetime in ISO-8601 format, UTC, for mappings beginning this
38442+
month. Defaults to the current month.
38443+
in: query
38444+
name: filter[month]
38445+
required: false
38446+
schema:
38447+
format: date-time
38448+
type: string
38449+
- description: String to specify whether to retrieve active billing dimension
38450+
mappings or all available mappings. Available views are `active` and `all`.
38451+
Defaults to `active`.
38452+
in: query
38453+
name: filter[view]
38454+
required: false
38455+
schema:
38456+
default: active
38457+
type: string
38458+
responses:
38459+
'200':
38460+
content:
38461+
application/json;datetime-format=rfc3339:
38462+
schema:
38463+
$ref: '#/components/schemas/BillingDimensionsMappingResponse'
38464+
description: OK
38465+
'400':
38466+
content:
38467+
application/json;datetime-format=rfc3339:
38468+
schema:
38469+
$ref: '#/components/schemas/APIErrorResponse'
38470+
description: Bad Request
38471+
'403':
38472+
content:
38473+
application/json;datetime-format=rfc3339:
38474+
schema:
38475+
$ref: '#/components/schemas/APIErrorResponse'
38476+
description: Forbidden - User is not authorized
38477+
'429':
38478+
content:
38479+
application/json;datetime-format=rfc3339:
38480+
schema:
38481+
$ref: '#/components/schemas/APIErrorResponse'
38482+
description: Too many requests
38483+
security:
38484+
- apiKeyAuth: []
38485+
appKeyAuth: []
38486+
- AuthZ:
38487+
- usage_read
38488+
summary: Get billing dimensions mapping for usage endpoints
38489+
tags:
38490+
- Usage Metering
38491+
x-unstable: '**Note**: This endpoint is in public beta.
38492+
38493+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
3836538494
/api/v2/usage/cost_by_org:
3836638495
get:
3836738496
deprecated: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get billing dimensions 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 dimensions 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 dimensions 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
@@ -972,6 +972,11 @@ def overrides
972972
"v2.azure_uc_config_post_request_type" => "AzureUCConfigPostRequestType",
973973
"v2.azure_uc_configs_response" => "AzureUCConfigsResponse",
974974
"v2.bill_config" => "BillConfig",
975+
"v2.billing_dimensions_mapping_body_item" => "BillingDimensionsMappingBodyItem",
976+
"v2.billing_dimensions_mapping_body_item_attributes" => "BillingDimensionsMappingBodyItemAttributes",
977+
"v2.billing_dimensions_mapping_body_item_attributes_endpoints_items" => "BillingDimensionsMappingBodyItemAttributesEndpointsItems",
978+
"v2.billing_dimensions_mapping_body_item_attributes_endpoints_items_status" => "BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus",
979+
"v2.billing_dimensions_mapping_response" => "BillingDimensionsMappingResponse",
975980
"v2.bulk_mute_findings_request" => "BulkMuteFindingsRequest",
976981
"v2.bulk_mute_findings_request_attributes" => "BulkMuteFindingsRequestAttributes",
977982
"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 dimensions 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 dimensions 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 or all available mappings. Available 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)