Skip to content

Commit 2b492f9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 001e689d of spec repo
1 parent aea88d5 commit 2b492f9

13 files changed

+730
-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-06 21:00:12.124581",
8-
"spec_repo_commit": "3dff532a"
7+
"regenerated": "2024-09-10 15:27:25.922985",
8+
"spec_repo_commit": "001e689d"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-06 21:00:12.142757",
13-
"spec_repo_commit": "3dff532a"
12+
"regenerated": "2024-09-10 15:27:25.941015",
13+
"spec_repo_commit": "001e689d"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 111 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:
@@ -38360,6 +38427,50 @@ paths:
3836038427
summary: Get hourly usage for application security
3836138428
tags:
3836238429
- Usage Metering
38430+
/api/v2/usage/billing_dimension_mapping:
38431+
get:
38432+
description: 'Get a mapping of billing dimensions to the corresponding keys
38433+
for the supported usage metering public API endpoints.
38434+
38435+
38436+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
38437+
operationId: GetBillingDimensionMapping
38438+
responses:
38439+
'200':
38440+
content:
38441+
application/json;datetime-format=rfc3339:
38442+
schema:
38443+
$ref: '#/components/schemas/BillingDimensionsMappingResponse'
38444+
description: OK
38445+
'400':
38446+
content:
38447+
application/json;datetime-format=rfc3339:
38448+
schema:
38449+
$ref: '#/components/schemas/APIErrorResponse'
38450+
description: Bad Request
38451+
'403':
38452+
content:
38453+
application/json;datetime-format=rfc3339:
38454+
schema:
38455+
$ref: '#/components/schemas/APIErrorResponse'
38456+
description: Forbidden - User is not authorized
38457+
'429':
38458+
content:
38459+
application/json;datetime-format=rfc3339:
38460+
schema:
38461+
$ref: '#/components/schemas/APIErrorResponse'
38462+
description: Too many requests
38463+
security:
38464+
- apiKeyAuth: []
38465+
appKeyAuth: []
38466+
- AuthZ:
38467+
- usage_read
38468+
summary: Get billing dimensions mapping for usage endpoints
38469+
tags:
38470+
- Usage Metering
38471+
x-unstable: '**Note**: This endpoint is in public beta.
38472+
38473+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
3836338474
/api/v2/usage/cost_by_org:
3836438475
get:
3836538476
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/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: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,74 @@ 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+
# @return [Array<(BillingDimensionsMappingResponse, Integer, Hash)>] BillingDimensionsMappingResponse data, response status code and response headers
108+
def get_billing_dimension_mapping_with_http_info(opts = {})
109+
unstable_enabled = @api_client.config.unstable_operations["v2.get_billing_dimension_mapping".to_sym]
110+
if unstable_enabled
111+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_billing_dimension_mapping")
112+
else
113+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_billing_dimension_mapping"))
114+
end
115+
116+
if @api_client.config.debugging
117+
@api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_billing_dimension_mapping ...'
118+
end
119+
# resource path
120+
local_var_path = '/api/v2/usage/billing_dimension_mapping'
121+
122+
# query parameters
123+
query_params = opts[:query_params] || {}
124+
125+
# header parameters
126+
header_params = opts[:header_params] || {}
127+
# HTTP header 'Accept' (if needed)
128+
header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])
129+
130+
# form parameters
131+
form_params = opts[:form_params] || {}
132+
133+
# http body (model)
134+
post_body = opts[:debug_body]
135+
136+
# return_type
137+
return_type = opts[:debug_return_type] || 'BillingDimensionsMappingResponse'
138+
139+
# auth_names
140+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
141+
142+
new_options = opts.merge(
143+
:operation => :get_billing_dimension_mapping,
144+
:header_params => header_params,
145+
:query_params => query_params,
146+
:form_params => form_params,
147+
:body => post_body,
148+
:auth_names => auth_names,
149+
:return_type => return_type,
150+
:api_version => "V2"
151+
)
152+
153+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
154+
if @api_client.config.debugging
155+
@api_client.config.logger.debug "API called: UsageMeteringAPI#get_billing_dimension_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156+
end
157+
return data, status_code, headers
158+
end
159+
92160
# Get cost across multi-org account.
93161
#
94162
# @see #get_cost_by_org_with_http_info

0 commit comments

Comments
 (0)