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.6",
"regenerated": "2024-04-02 13:17:38.209256",
"spec_repo_commit": "de9967cc"
"regenerated": "2024-04-03 15:02:06.639007",
"spec_repo_commit": "e8144990"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-02 13:17:38.259818",
"spec_repo_commit": "de9967cc"
"regenerated": "2024-04-03 15:02:06.656114",
"spec_repo_commit": "e8144990"
}
}
}
21 changes: 20 additions & 1 deletion .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11370,7 +11370,8 @@ components:
description: 'The time-slice condition, composed of 3 parts: 1. the metric timeseries
query, 2. the comparator,

and 3. the threshold.'
and 3. the threshold. Optionally, a fourth part, the query interval, can be
provided.'
example:
comparator: <
query:
Expand All @@ -11389,6 +11390,8 @@ components:
$ref: '#/components/schemas/SLOTimeSliceComparator'
query:
$ref: '#/components/schemas/SLOTimeSliceQuery'
query_interval_seconds:
$ref: '#/components/schemas/SLOTimeSliceInterval'
threshold:
description: The threshold value to which each SLI value will be compared.
example: 5
Expand All @@ -11399,6 +11402,22 @@ components:
- threshold
- query
type: object
SLOTimeSliceInterval:
description: 'The interval used when querying data, which defines the size of
a time slice.

Two values are allowed: 60 (1 minute) and 300 (5 minutes).

If not provided, the value defaults to 300 (5 minutes).'
enum:
- 60
- 300
example: 300
format: int32
type: integer
x-enum-varnames:
- ONE_MINUTE
- FIVE_MINUTES
SLOTimeSliceQuery:
description: The queries and formula used to calculate the SLI value.
example:
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ def overrides
"v1.slo_timeframe" => "SLOTimeframe",
"v1.slo_time_slice_comparator" => "SLOTimeSliceComparator",
"v1.slo_time_slice_condition" => "SLOTimeSliceCondition",
"v1.slo_time_slice_interval" => "SLOTimeSliceInterval",
"v1.slo_time_slice_query" => "SLOTimeSliceQuery",
"v1.slo_time_slice_spec" => "SLOTimeSliceSpec",
"v1.slo_type" => "SLOType",
Expand Down
16 changes: 14 additions & 2 deletions lib/datadog_api_client/v1/models/slo_time_slice_condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

module DatadogAPIClient::V1
# The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator,
# and 3. the threshold.
# and 3. the threshold. Optionally, a fourth part, the query interval, can be provided.
class SLOTimeSliceCondition
include BaseGenericModel

Expand All @@ -28,6 +28,11 @@ class SLOTimeSliceCondition
# The queries and formula used to calculate the SLI value.
attr_reader :query

# The interval used when querying data, which defines the size of a time slice.
# Two values are allowed: 60 (1 minute) and 300 (5 minutes).
# If not provided, the value defaults to 300 (5 minutes).
attr_accessor :query_interval_seconds

# The threshold value to which each SLI value will be compared.
attr_reader :threshold

Expand All @@ -37,6 +42,7 @@ def self.attribute_map
{
:'comparator' => :'comparator',
:'query' => :'query',
:'query_interval_seconds' => :'query_interval_seconds',
:'threshold' => :'threshold'
}
end
Expand All @@ -47,6 +53,7 @@ def self.openapi_types
{
:'comparator' => :'SLOTimeSliceComparator',
:'query' => :'SLOTimeSliceQuery',
:'query_interval_seconds' => :'SLOTimeSliceInterval',
:'threshold' => :'Float'
}
end
Expand Down Expand Up @@ -75,6 +82,10 @@ def initialize(attributes = {})
self.query = attributes[:'query']
end

if attributes.key?(:'query_interval_seconds')
self.query_interval_seconds = attributes[:'query_interval_seconds']
end

if attributes.key?(:'threshold')
self.threshold = attributes[:'threshold']
end
Expand Down Expand Up @@ -128,14 +139,15 @@ def ==(o)
self.class == o.class &&
comparator == o.comparator &&
query == o.query &&
query_interval_seconds == o.query_interval_seconds &&
threshold == o.threshold
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[comparator, query, threshold].hash
[comparator, query, query_interval_seconds, threshold].hash
end
end
end
29 changes: 29 additions & 0 deletions lib/datadog_api_client/v1/models/slo_time_slice_interval.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
=begin
#Datadog API V1 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'date'
require 'time'

module DatadogAPIClient::V1
# The interval used when querying data, which defines the size of a time slice.
# Two values are allowed: 60 (1 minute) and 300 (5 minutes).
# If not provided, the value defaults to 300 (5 minutes).
class SLOTimeSliceInterval
include BaseEnumModel

ONE_MINUTE = 60.freeze
FIVE_MINUTES = 300.freeze
end
end
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v1/models/slo_time_slice_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SLOTimeSliceSpec
include BaseGenericModel

# The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator,
# and 3. the threshold.
# and 3. the threshold. Optionally, a fourth part, the query interval, can be provided.
attr_reader :time_slice

# Attribute mapping from ruby-style variable name to JSON key.
Expand Down