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
10 changes: 10 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9156,29 +9156,39 @@ components:
properties:
description:
description: Metric description.
example: Number of requests received.
nullable: true
type: string
integration:
description: Name of the integration that sent the metric if applicable.
nullable: true
readOnly: true
type: string
per_unit:
description: Per unit of the metric such as `second` in `bytes per second`.
example: second
nullable: true
type: string
short_name:
description: A more human-readable and abbreviated version of the metric name.
example: requests
nullable: true
type: string
statsd_interval:
description: StatsD flush interval of the metric in seconds if applicable.
example: 10
format: int64
nullable: true
type: integer
type:
description: Metric type such as `gauge` or `rate`.
example: count
nullable: true
type: string
unit:
description: Primary unit of the metric such as `byte` or `operation`.
example: byte
nullable: true
type: string
type: object
MetricSearchResponse:
Expand Down
3 changes: 3 additions & 0 deletions examples/v1/metrics/UpdateMetricMetadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
api_instance = DatadogAPIClient::V1::MetricsAPI.new

body = DatadogAPIClient::V1::MetricMetadata.new({
description: "Number of requests received.",
per_unit: "second",
short_name: "requests",
statsd_interval: 10,
type: "count",
unit: "byte",
})
Expand Down
6 changes: 3 additions & 3 deletions features/v1/metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: Metrics
Given a valid "appKeyAuth" key in the system
And new "UpdateMetricMetadata" request
And request contains "metric_name" parameter from "REPLACE.ME"
And body with value {"per_unit": "second", "type": "count", "unit": "byte"}
And body with value {"description": "Number of requests received.", "per_unit": "second", "short_name": "requests", "statsd_interval": 10, "type": "count", "unit": "byte"}
When the request is sent
Then the response status is 400 Bad Request

Expand All @@ -28,7 +28,7 @@ Feature: Metrics
Given a valid "appKeyAuth" key in the system
And new "UpdateMetricMetadata" request
And request contains "metric_name" parameter from "REPLACE.ME"
And body with value {"per_unit": "second", "type": "count", "unit": "byte"}
And body with value {"description": "Number of requests received.", "per_unit": "second", "short_name": "requests", "statsd_interval": 10, "type": "count", "unit": "byte"}
When the request is sent
Then the response status is 404 Not Found

Expand All @@ -37,7 +37,7 @@ Feature: Metrics
Given a valid "appKeyAuth" key in the system
And new "UpdateMetricMetadata" request
And request contains "metric_name" parameter from "REPLACE.ME"
And body with value {"per_unit": "second", "type": "count", "unit": "byte"}
And body with value {"description": "Number of requests received.", "per_unit": "second", "short_name": "requests", "statsd_interval": 10, "type": "count", "unit": "byte"}
When the request is sent
Then the response status is 200 OK

Expand Down
14 changes: 14 additions & 0 deletions lib/datadog_api_client/v1/models/metric_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ def self.openapi_types
}
end

# List of attributes with nullable: true
# @!visibility private
def self.openapi_nullable
Set.new([
:'description',
:'integration',
:'per_unit',
:'short_name',
:'statsd_interval',
:'type',
:'unit',
])
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
Expand Down
Loading