Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2",
"regenerated": "2022-03-09 10:47:04.862600",
"spec_repo_commit": "1124bbef"
"regenerated": "2022-03-09 11:38:32.619758",
"spec_repo_commit": "b5bc30a4"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-03-09 10:47:04.884613",
"spec_repo_commit": "1124bbef"
"regenerated": "2022-03-09 11:38:32.643014",
"spec_repo_commit": "b5bc30a4"
}
}
}
100 changes: 100 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14060,6 +14060,32 @@ components:
$ref: '#/components/schemas/UsageNetworkHostsHour'
type: array
type: object
UsageOnlineArchiveHour:
description: Online Archive usage in a given hour.
properties:
hour:
description: The hour for the usage.
format: date-time
type: string
online_archive_events_count:
description: Total count of online archived events within the hour.
type: integer
org_name:
description: The organization name.
type: string
public_id:
description: The organization public ID.
type: string
type: object
UsageOnlineArchiveResponse:
description: Online Archive usage response.
properties:
usage:
description: Response containing Online Archive usage.
items:
$ref: '#/components/schemas/UsageOnlineArchiveHour'
type: array
type: object
UsageProfilingHour:
description: The number of profiled hosts for each hour for a given organization.
properties:
Expand Down Expand Up @@ -14565,6 +14591,11 @@ components:
all hours in the current date for all organizations.
format: int64
type: integer
online_archive_events_count_sum:
description: Sum of all online archived events over all hours in the current
date for all organizations.
format: int64
type: integer
opentelemetry_host_top99p:
description: Shows the 99th percentile of all hosts reported by the Datadog
exporter for the OpenTelemetry Collector over all hours in the current
Expand Down Expand Up @@ -14877,6 +14908,11 @@ components:
all hours in the current date for the given org.
format: int64
type: integer
online_archive_events_count_sum:
description: Sum of all online archived events over all hours in the current
date for the given org.
format: int64
type: integer
opentelemetry_host_top99p:
description: Shows the 99th percentile of all hosts reported by the Datadog
exporter for the OpenTelemetry Collector over all hours in the current
Expand Down Expand Up @@ -15213,6 +15249,11 @@ components:
all hours in the current months for all organizations.
format: int64
type: integer
online_archive_events_count_agg_sum:
description: Sum of all online archived events over all hours in the current
months for all organizations.
format: int64
type: integer
opentelemetry_host_top99p_sum:
description: Shows the 99th percentile of all hosts reported by the Datadog
exporter for the OpenTelemetry Collector over all hours in the current
Expand Down Expand Up @@ -26780,6 +26821,65 @@ paths:
x-menu-order: 14
x-undo:
type: safe
/api/v1/usage/online-archive:
get:
description: Get hourly usage for Online Archive.
operationId: GetUsageOnlineArchive
parameters:
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
for usage beginning at this hour.'
in: query
name: start_hr
required: true
schema:
format: date-time
type: string
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
for usage ending

**before** this hour.'
in: query
name: end_hr
required: false
schema:
format: date-time
type: string
responses:
'200':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/UsageOnlineArchiveResponse'
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 hourly usage for Online Archive
tags:
- Usage Metering
x-menu-order: 38
x-undo:
type: safe
/api/v1/usage/profiling:
get:
description: Get hourly usage for profiled hosts.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-03-08T15:58:31.986Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-03-08T15:58:32.586Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions examples/v1/usage-metering/GetUsageOnlineArchive.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get hourly usage for Online Archive returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::UsageMeteringAPI.new
opts = {
end_hr: (Time.now + -3 * 86400),
}
p api_instance.get_usage_online_archive((Time.now + -5 * 86400), opts)
6 changes: 6 additions & 0 deletions features/v1/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,12 @@
"type": "safe"
}
},
"GetUsageOnlineArchive": {
"tag": "Usage Metering",
"undo": {
"type": "safe"
}
},
"GetUsageProfiling": {
"tag": "Usage Metering",
"undo": {
Expand Down
16 changes: 16 additions & 0 deletions features/v1/usage_metering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,22 @@ Feature: Usage Metering
When the request is sent
Then the response status is 200 OK

@team:DataDog/red-zone-revenue-query
Scenario: Get hourly usage for Online Archive returns "Bad Request" response
Given new "GetUsageOnlineArchive" request
And request contains "start_hr" parameter with value "{{ timeISO('now - 3d') }}"
And request contains "end_hr" parameter with value "{{ timeISO('now - 5d') }}"
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/red-zone-revenue-query
Scenario: Get hourly usage for Online Archive returns "OK" response
Given new "GetUsageOnlineArchive" request
And request contains "start_hr" parameter with value "{{ timeISO('now - 5d') }}"
And request contains "end_hr" parameter with value "{{ timeISO('now - 3d') }}"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/red-zone-revenue-query
Scenario: Get hourly usage for RUM Sessions returns "Bad Request" response
Given new "GetUsageRumSessions" request
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@
require 'datadog_api_client/v1/models/usage_network_flows_response'
require 'datadog_api_client/v1/models/usage_network_hosts_hour'
require 'datadog_api_client/v1/models/usage_network_hosts_response'
require 'datadog_api_client/v1/models/usage_online_archive_hour'
require 'datadog_api_client/v1/models/usage_online_archive_response'
require 'datadog_api_client/v1/models/usage_profiling_hour'
require 'datadog_api_client/v1/models/usage_profiling_response'
require 'datadog_api_client/v1/models/usage_reports_type'
Expand Down
77 changes: 77 additions & 0 deletions lib/datadog_api_client/v1/api/usage_metering_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2118,6 +2118,83 @@ def get_usage_network_hosts_with_http_info(start_hr, opts = {})
return data, status_code, headers
end

# Get hourly usage for Online Archive
# Get hourly usage for Online Archive.
# @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
# @param opts [Hash] the optional parameters
# @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
# @return [UsageOnlineArchiveResponse]
def get_usage_online_archive(start_hr, opts = {})
data, _status_code, _headers = get_usage_online_archive_with_http_info(start_hr, opts)
data
end

# Get hourly usage for Online Archive
# Get hourly usage for Online Archive.
# @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
# @param opts [Hash] the optional parameters
# @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
# @return [Array<(UsageOnlineArchiveResponse, Integer, Hash)>] UsageOnlineArchiveResponse data, response status code and response headers
def get_usage_online_archive_with_http_info(start_hr, opts = {})

if @api_client.config.unstable_operations.has_key?(:get_usage_online_archive)
unstable_enabled = @api_client.config.unstable_operations[:get_usage_online_archive]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_online_archive")
else
raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_online_archive"))
end
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_online_archive ...'
end
# verify the required parameter 'start_hr' is set
if @api_client.config.client_side_validation && start_hr.nil?
fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_online_archive"
end
# resource path
local_var_path = '/api/v1/usage/online-archive'

# query parameters
query_params = opts[:query_params] || {}
query_params[:'start_hr'] = start_hr
query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'UsageOnlineArchiveResponse'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

new_options = opts.merge(
:operation => :get_usage_online_archive,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_online_archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get hourly usage for profiled hosts
# Get hourly usage for profiled hosts.
# @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
Expand Down
Loading