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.4.1.dev6",
"regenerated": "2021-03-23 14:01:30.773317",
"spec_repo_commit": "7e667f1"
"regenerated": "2021-03-23 15:41:49.644923",
"spec_repo_commit": "1906d5b"
},
"v2": {
"apigentools_version": "1.4.1.dev6",
"regenerated": "2021-03-23 14:01:44.126537",
"spec_repo_commit": "7e667f1"
"regenerated": "2021-03-23 15:42:03.671644",
"spec_repo_commit": "1906d5b"
}
}
}
30 changes: 27 additions & 3 deletions data/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10181,10 +10181,24 @@ components:
description: Contains the custom metric name.
type: string
type: object
UsageTopAvgMetricsMetadata:
description: The object containing document metadata.
properties:
day:
description: The day value from the user request that contains the returned
usage data. (If day was used the request)
month:
description: The month value from the user request that contains the returned
usage data. (If month was used the request)
pagination:
$ref: '#/components/schemas/UsageAttributionPagination'
type: object
UsageTopAvgMetricsResponse:
description: Response containing the number of hourly recorded custom metrics
for a given organization.
properties:
metadata:
$ref: '#/components/schemas/UsageTopAvgMetricsMetadata'
usage:
description: Number of hourly recorded custom metrics for a given organization.
items:
Expand Down Expand Up @@ -18490,14 +18504,24 @@ paths:
/api/v1/usage/top_avg_metrics:
get:
description: Get top [custom metrics](https://docs.datadoghq.com/developers/metrics/custom_metrics/)
by hourly average.
by hourly average. Use the month parameter to get a month-to-date data resolution
or use the day parameter to get a daily resolution. One of the two is required,
and only one of the two is allowed.
operationId: GetUsageTopAvgMetrics
parameters:
- description: 'Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM]
for usage beginning at this hour.'
for usage beginning at this hour. (Either month or day should be specified,
but not both)'
in: query
name: month
required: true
schema:
format: date-time
type: string
- description: 'Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD]
for usage beginning at this hour. (Either month or day should be specified,
but not both)'
in: query
name: day
schema:
format: date-time
type: string
Expand Down
1 change: 1 addition & 0 deletions docs/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ Class | Method | HTTP request | Description
- [DatadogAPIClient::V1::UsageTimeseriesHour](UsageTimeseriesHour.md)
- [DatadogAPIClient::V1::UsageTimeseriesResponse](UsageTimeseriesResponse.md)
- [DatadogAPIClient::V1::UsageTopAvgMetricsHour](UsageTopAvgMetricsHour.md)
- [DatadogAPIClient::V1::UsageTopAvgMetricsMetadata](UsageTopAvgMetricsMetadata.md)
- [DatadogAPIClient::V1::UsageTopAvgMetricsResponse](UsageTopAvgMetricsResponse.md)
- [DatadogAPIClient::V1::UsageTraceHour](UsageTraceHour.md)
- [DatadogAPIClient::V1::UsageTraceResponse](UsageTraceResponse.md)
Expand Down
16 changes: 9 additions & 7 deletions docs/v1/UsageMeteringApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2217,11 +2217,11 @@ end

## get_usage_top_avg_metrics

> <UsageTopAvgMetricsResponse> get_usage_top_avg_metrics(month, opts)
> <UsageTopAvgMetricsResponse> get_usage_top_avg_metrics(opts)

Get top custom metrics by hourly average

Get top [custom metrics](https://docs.datadoghq.com/developers/metrics/custom_metrics/) by hourly average.
Get top [custom metrics](https://docs.datadoghq.com/developers/metrics/custom_metrics/) by hourly average. Use the month parameter to get a month-to-date data resolution or use the day parameter to get a daily resolution. One of the two is required, and only one of the two is allowed.

### Examples

Expand All @@ -2242,15 +2242,16 @@ DatadogAPIClient::V1.configure do |config|
end

api_instance = DatadogAPIClient::V1::UsageMeteringApi.new
month = Time.parse('2013-10-20T19:20:30+01:00') # Time | Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour.
opts = {
month: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour. (Either month or day should be specified, but not both)
day: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD] for usage beginning at this hour. (Either month or day should be specified, but not both)
names: ['inner_example'], # Array<String> | Comma-separated list of metric names.
limit: 56 # Integer | Maximum number of results to return (between 1 and 5000) - defaults to 500 results if limit not specified.
}

begin
# Get top custom metrics by hourly average
result = api_instance.get_usage_top_avg_metrics(month, opts)
result = api_instance.get_usage_top_avg_metrics(opts)
p result
rescue DatadogAPIClient::V1::ApiError => e
puts "Error when calling UsageMeteringApi->get_usage_top_avg_metrics: #{e}"
Expand All @@ -2261,12 +2262,12 @@ end

This returns an Array which contains the response data, status code and headers.

> <Array(<UsageTopAvgMetricsResponse>, Integer, Hash)> get_usage_top_avg_metrics_with_http_info(month, opts)
> <Array(<UsageTopAvgMetricsResponse>, Integer, Hash)> get_usage_top_avg_metrics_with_http_info(opts)

```ruby
begin
# Get top custom metrics by hourly average
data, status_code, headers = api_instance.get_usage_top_avg_metrics_with_http_info(month, opts)
data, status_code, headers = api_instance.get_usage_top_avg_metrics_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <UsageTopAvgMetricsResponse>
Expand All @@ -2279,7 +2280,8 @@ end

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **month** | **Time** | Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour. | |
| **month** | **Time** | Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour. (Either month or day should be specified, but not both) | [optional] |
| **day** | **Time** | Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD] for usage beginning at this hour. (Either month or day should be specified, but not both) | [optional] |
| **names** | **Array&lt;String&gt;** | Comma-separated list of metric names. | [optional] |
| **limit** | **Integer** | Maximum number of results to return (between 1 and 5000) - defaults to 500 results if limit not specified. | [optional][default to 500] |

Expand Down
22 changes: 22 additions & 0 deletions docs/v1/UsageTopAvgMetricsMetadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DatadogAPIClient::V1::UsageTopAvgMetricsMetadata

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **day** | **Object** | The day value from the user request that contains the returned usage data. (If day was used the request) | [optional] |
| **month** | **Object** | The month value from the user request that contains the returned usage data. (If month was used the request) | [optional] |
| **pagination** | [**UsageAttributionPagination**](UsageAttributionPagination.md) | | [optional] |

## Example

```ruby
require 'datadog_api_client/v1'

instance = DatadogAPIClient::V1::UsageTopAvgMetricsMetadata.new(
day: null,
month: null,
pagination: null
)
```

2 changes: 2 additions & 0 deletions docs/v1/UsageTopAvgMetricsResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **metadata** | [**UsageTopAvgMetricsMetadata**](UsageTopAvgMetricsMetadata.md) | | [optional] |
| **usage** | [**Array&lt;UsageTopAvgMetricsHour&gt;**](UsageTopAvgMetricsHour.md) | Number of hourly recorded custom metrics for a given organization. | [optional] |

## Example
Expand All @@ -12,6 +13,7 @@
require 'datadog_api_client/v1'

instance = DatadogAPIClient::V1::UsageTopAvgMetricsResponse.new(
metadata: null,
usage: null
)
```
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
require 'datadog_api_client/v1/models/usage_timeseries_hour'
require 'datadog_api_client/v1/models/usage_timeseries_response'
require 'datadog_api_client/v1/models/usage_top_avg_metrics_hour'
require 'datadog_api_client/v1/models/usage_top_avg_metrics_metadata'
require 'datadog_api_client/v1/models/usage_top_avg_metrics_response'
require 'datadog_api_client/v1/models/usage_trace_hour'
require 'datadog_api_client/v1/models/usage_trace_response'
Expand Down
23 changes: 11 additions & 12 deletions lib/datadog_api_client/v1/api/usage_metering_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2113,25 +2113,27 @@ def get_usage_timeseries_with_http_info(start_hr, opts = {})
end

# Get top custom metrics by hourly average
# Get top [custom metrics](https://docs.datadoghq.com/developers/metrics/custom_metrics/) by hourly average.
# @param month [Time] Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour.
# Get top [custom metrics](https://docs.datadoghq.com/developers/metrics/custom_metrics/) by hourly average. Use the month parameter to get a month-to-date data resolution or use the day parameter to get a daily resolution. One of the two is required, and only one of the two is allowed.
# @param [Hash] opts the optional parameters
# @option opts [Time] :month Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour. (Either month or day should be specified, but not both)
# @option opts [Time] :day Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD] for usage beginning at this hour. (Either month or day should be specified, but not both)
# @option opts [Array<String>] :names Comma-separated list of metric names.
# @option opts [Integer] :limit Maximum number of results to return (between 1 and 5000) - defaults to 500 results if limit not specified. (default to 500)
# @return [UsageTopAvgMetricsResponse]
def get_usage_top_avg_metrics(month, opts = {})
data, _status_code, _headers = get_usage_top_avg_metrics_with_http_info(month, opts)
def get_usage_top_avg_metrics(opts = {})
data, _status_code, _headers = get_usage_top_avg_metrics_with_http_info(opts)
data
end

# Get top custom metrics by hourly average
# Get top [custom metrics](https://docs.datadoghq.com/developers/metrics/custom_metrics/) by hourly average.
# @param month [Time] Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour.
# Get top [custom metrics](https://docs.datadoghq.com/developers/metrics/custom_metrics/) by hourly average. Use the month parameter to get a month-to-date data resolution or use the day parameter to get a daily resolution. One of the two is required, and only one of the two is allowed.
# @param [Hash] opts the optional parameters
# @option opts [Time] :month Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour. (Either month or day should be specified, but not both)
# @option opts [Time] :day Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD] for usage beginning at this hour. (Either month or day should be specified, but not both)
# @option opts [Array<String>] :names Comma-separated list of metric names.
# @option opts [Integer] :limit Maximum number of results to return (between 1 and 5000) - defaults to 500 results if limit not specified.
# @return [Array<(UsageTopAvgMetricsResponse, Integer, Hash)>] UsageTopAvgMetricsResponse data, response status code and response headers
def get_usage_top_avg_metrics_with_http_info(month, opts = {})
def get_usage_top_avg_metrics_with_http_info(opts = {})

if @api_client.config.unstable_operations.has_key?(:get_usage_top_avg_metrics)
unstable_enabled = @api_client.config.unstable_operations[:get_usage_top_avg_metrics]
Expand All @@ -2145,10 +2147,6 @@ def get_usage_top_avg_metrics_with_http_info(month, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: UsageMeteringApi.get_usage_top_avg_metrics ...'
end
# verify the required parameter 'month' is set
if @api_client.config.client_side_validation && month.nil?
fail ArgumentError, "Missing the required parameter 'month' when calling UsageMeteringApi.get_usage_top_avg_metrics"
end
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsageMeteringApi.get_usage_top_avg_metrics, must be smaller than or equal to 5000.'
end
Expand All @@ -2162,7 +2160,8 @@ def get_usage_top_avg_metrics_with_http_info(month, opts = {})

# query parameters
query_params = opts[:query_params] || {}
query_params[:'month'] = month
query_params[:'month'] = opts[:'month'] if !opts[:'month'].nil?
query_params[:'day'] = opts[:'day'] if !opts[:'day'].nil?
query_params[:'names'] = @api_client.build_collection_param(opts[:'names'], :multi) if !opts[:'names'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

Expand Down
Loading