Skip to content

Commit 8272a68

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Regenerate client from commit b5bc30a4 of spec repo (#780)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 931a96c commit 8272a68

16 files changed

+599
-7
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.2",
7-
"regenerated": "2022-03-09 10:47:04.862600",
8-
"spec_repo_commit": "1124bbef"
7+
"regenerated": "2022-03-09 11:38:32.619758",
8+
"spec_repo_commit": "b5bc30a4"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-03-09 10:47:04.884613",
13-
"spec_repo_commit": "1124bbef"
12+
"regenerated": "2022-03-09 11:38:32.643014",
13+
"spec_repo_commit": "b5bc30a4"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14060,6 +14060,32 @@ components:
1406014060
$ref: '#/components/schemas/UsageNetworkHostsHour'
1406114061
type: array
1406214062
type: object
14063+
UsageOnlineArchiveHour:
14064+
description: Online Archive usage in a given hour.
14065+
properties:
14066+
hour:
14067+
description: The hour for the usage.
14068+
format: date-time
14069+
type: string
14070+
online_archive_events_count:
14071+
description: Total count of online archived events within the hour.
14072+
type: integer
14073+
org_name:
14074+
description: The organization name.
14075+
type: string
14076+
public_id:
14077+
description: The organization public ID.
14078+
type: string
14079+
type: object
14080+
UsageOnlineArchiveResponse:
14081+
description: Online Archive usage response.
14082+
properties:
14083+
usage:
14084+
description: Response containing Online Archive usage.
14085+
items:
14086+
$ref: '#/components/schemas/UsageOnlineArchiveHour'
14087+
type: array
14088+
type: object
1406314089
UsageProfilingHour:
1406414090
description: The number of profiled hosts for each hour for a given organization.
1406514091
properties:
@@ -14565,6 +14591,11 @@ components:
1456514591
all hours in the current date for all organizations.
1456614592
format: int64
1456714593
type: integer
14594+
online_archive_events_count_sum:
14595+
description: Sum of all online archived events over all hours in the current
14596+
date for all organizations.
14597+
format: int64
14598+
type: integer
1456814599
opentelemetry_host_top99p:
1456914600
description: Shows the 99th percentile of all hosts reported by the Datadog
1457014601
exporter for the OpenTelemetry Collector over all hours in the current
@@ -14877,6 +14908,11 @@ components:
1487714908
all hours in the current date for the given org.
1487814909
format: int64
1487914910
type: integer
14911+
online_archive_events_count_sum:
14912+
description: Sum of all online archived events over all hours in the current
14913+
date for the given org.
14914+
format: int64
14915+
type: integer
1488014916
opentelemetry_host_top99p:
1488114917
description: Shows the 99th percentile of all hosts reported by the Datadog
1488214918
exporter for the OpenTelemetry Collector over all hours in the current
@@ -15213,6 +15249,11 @@ components:
1521315249
all hours in the current months for all organizations.
1521415250
format: int64
1521515251
type: integer
15252+
online_archive_events_count_agg_sum:
15253+
description: Sum of all online archived events over all hours in the current
15254+
months for all organizations.
15255+
format: int64
15256+
type: integer
1521615257
opentelemetry_host_top99p_sum:
1521715258
description: Shows the 99th percentile of all hosts reported by the Datadog
1521815259
exporter for the OpenTelemetry Collector over all hours in the current
@@ -26780,6 +26821,65 @@ paths:
2678026821
x-menu-order: 14
2678126822
x-undo:
2678226823
type: safe
26824+
/api/v1/usage/online-archive:
26825+
get:
26826+
description: Get hourly usage for Online Archive.
26827+
operationId: GetUsageOnlineArchive
26828+
parameters:
26829+
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
26830+
for usage beginning at this hour.'
26831+
in: query
26832+
name: start_hr
26833+
required: true
26834+
schema:
26835+
format: date-time
26836+
type: string
26837+
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
26838+
for usage ending
26839+
26840+
**before** this hour.'
26841+
in: query
26842+
name: end_hr
26843+
required: false
26844+
schema:
26845+
format: date-time
26846+
type: string
26847+
responses:
26848+
'200':
26849+
content:
26850+
application/json;datetime-format=rfc3339:
26851+
schema:
26852+
$ref: '#/components/schemas/UsageOnlineArchiveResponse'
26853+
description: OK
26854+
'400':
26855+
content:
26856+
application/json;datetime-format=rfc3339:
26857+
schema:
26858+
$ref: '#/components/schemas/APIErrorResponse'
26859+
description: Bad Request
26860+
'403':
26861+
content:
26862+
application/json;datetime-format=rfc3339:
26863+
schema:
26864+
$ref: '#/components/schemas/APIErrorResponse'
26865+
description: Forbidden - User is not authorized
26866+
'429':
26867+
content:
26868+
application/json;datetime-format=rfc3339:
26869+
schema:
26870+
$ref: '#/components/schemas/APIErrorResponse'
26871+
description: Too many requests
26872+
security:
26873+
- apiKeyAuth: []
26874+
appKeyAuth: []
26875+
- AuthZ:
26876+
- usage_read
26877+
summary: Get hourly usage for Online Archive
26878+
tags:
26879+
- Usage Metering
26880+
x-menu-order: 38
26881+
x-undo:
26882+
type: safe
2678326883
/api/v1/usage/profiling:
2678426884
get:
2678526885
description: Get hourly usage for profiled hosts.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-03-08T15:58:31.986Z

cassettes/features/v1/usage_metering/Get-hourly-usage-for-Online-Archive-returns-Bad-Request-response.yml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-03-08T15:58:32.586Z

cassettes/features/v1/usage_metering/Get-hourly-usage-for-Online-Archive-returns-OK-response.yml

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get hourly usage for Online Archive returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
5+
opts = {
6+
end_hr: (Time.now + -3 * 86400),
7+
}
8+
p api_instance.get_usage_online_archive((Time.now + -5 * 86400), opts)

features/v1/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,12 @@
12961296
"type": "safe"
12971297
}
12981298
},
1299+
"GetUsageOnlineArchive": {
1300+
"tag": "Usage Metering",
1301+
"undo": {
1302+
"type": "safe"
1303+
}
1304+
},
12991305
"GetUsageProfiling": {
13001306
"tag": "Usage Metering",
13011307
"undo": {

features/v1/usage_metering.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,22 @@ Feature: Usage Metering
238238
When the request is sent
239239
Then the response status is 200 OK
240240

241+
@team:DataDog/red-zone-revenue-query
242+
Scenario: Get hourly usage for Online Archive returns "Bad Request" response
243+
Given new "GetUsageOnlineArchive" request
244+
And request contains "start_hr" parameter with value "{{ timeISO('now - 3d') }}"
245+
And request contains "end_hr" parameter with value "{{ timeISO('now - 5d') }}"
246+
When the request is sent
247+
Then the response status is 400 Bad Request
248+
249+
@team:DataDog/red-zone-revenue-query
250+
Scenario: Get hourly usage for Online Archive returns "OK" response
251+
Given new "GetUsageOnlineArchive" request
252+
And request contains "start_hr" parameter with value "{{ timeISO('now - 5d') }}"
253+
And request contains "end_hr" parameter with value "{{ timeISO('now - 3d') }}"
254+
When the request is sent
255+
Then the response status is 200 OK
256+
241257
@generated @skip @team:DataDog/red-zone-revenue-query
242258
Scenario: Get hourly usage for RUM Sessions returns "Bad Request" response
243259
Given new "GetUsageRumSessions" request

lib/datadog_api_client/v1.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@
621621
require 'datadog_api_client/v1/models/usage_network_flows_response'
622622
require 'datadog_api_client/v1/models/usage_network_hosts_hour'
623623
require 'datadog_api_client/v1/models/usage_network_hosts_response'
624+
require 'datadog_api_client/v1/models/usage_online_archive_hour'
625+
require 'datadog_api_client/v1/models/usage_online_archive_response'
624626
require 'datadog_api_client/v1/models/usage_profiling_hour'
625627
require 'datadog_api_client/v1/models/usage_profiling_response'
626628
require 'datadog_api_client/v1/models/usage_reports_type'

lib/datadog_api_client/v1/api/usage_metering_api.rb

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,83 @@ def get_usage_network_hosts_with_http_info(start_hr, opts = {})
21182118
return data, status_code, headers
21192119
end
21202120

2121+
# Get hourly usage for Online Archive
2122+
# Get hourly usage for Online Archive.
2123+
# @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
2124+
# @param opts [Hash] the optional parameters
2125+
# @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
2126+
# @return [UsageOnlineArchiveResponse]
2127+
def get_usage_online_archive(start_hr, opts = {})
2128+
data, _status_code, _headers = get_usage_online_archive_with_http_info(start_hr, opts)
2129+
data
2130+
end
2131+
2132+
# Get hourly usage for Online Archive
2133+
# Get hourly usage for Online Archive.
2134+
# @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
2135+
# @param opts [Hash] the optional parameters
2136+
# @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
2137+
# @return [Array<(UsageOnlineArchiveResponse, Integer, Hash)>] UsageOnlineArchiveResponse data, response status code and response headers
2138+
def get_usage_online_archive_with_http_info(start_hr, opts = {})
2139+
2140+
if @api_client.config.unstable_operations.has_key?(:get_usage_online_archive)
2141+
unstable_enabled = @api_client.config.unstable_operations[:get_usage_online_archive]
2142+
if unstable_enabled
2143+
@api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_online_archive")
2144+
else
2145+
raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_online_archive"))
2146+
end
2147+
end
2148+
2149+
if @api_client.config.debugging
2150+
@api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_online_archive ...'
2151+
end
2152+
# verify the required parameter 'start_hr' is set
2153+
if @api_client.config.client_side_validation && start_hr.nil?
2154+
fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_online_archive"
2155+
end
2156+
# resource path
2157+
local_var_path = '/api/v1/usage/online-archive'
2158+
2159+
# query parameters
2160+
query_params = opts[:query_params] || {}
2161+
query_params[:'start_hr'] = start_hr
2162+
query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?
2163+
2164+
# header parameters
2165+
header_params = opts[:header_params] || {}
2166+
# HTTP header 'Accept' (if needed)
2167+
header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])
2168+
2169+
# form parameters
2170+
form_params = opts[:form_params] || {}
2171+
2172+
# http body (model)
2173+
post_body = opts[:debug_body]
2174+
2175+
# return_type
2176+
return_type = opts[:debug_return_type] || 'UsageOnlineArchiveResponse'
2177+
2178+
# auth_names
2179+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
2180+
2181+
new_options = opts.merge(
2182+
:operation => :get_usage_online_archive,
2183+
:header_params => header_params,
2184+
:query_params => query_params,
2185+
:form_params => form_params,
2186+
:body => post_body,
2187+
:auth_names => auth_names,
2188+
:return_type => return_type
2189+
)
2190+
2191+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2192+
if @api_client.config.debugging
2193+
@api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_online_archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2194+
end
2195+
return data, status_code, headers
2196+
end
2197+
21212198
# Get hourly usage for profiled hosts
21222199
# Get hourly usage for profiled hosts.
21232200
# @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.

0 commit comments

Comments
 (0)