Skip to content

Commit db558ed

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 795c134 of spec repo
1 parent 0a339c6 commit db558ed

File tree

9 files changed

+365
-12
lines changed

9 files changed

+365
-12
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11481,6 +11481,60 @@ components:
1148111481
example: UTC
1148211482
type: string
1148311483
type: object
11484+
SLOCountCondition:
11485+
description: 'A metric SLI specification, composed of three parts: the good
11486+
events formula, the total events formula,
11487+
11488+
and the involved queries.'
11489+
example:
11490+
good_events_formula: query1 - query2
11491+
queries:
11492+
- data_source: metrics
11493+
name: query1
11494+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11495+
- data_source: metrics
11496+
name: query2
11497+
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
11498+
total_events_formula: query1
11499+
properties:
11500+
good_events_formula:
11501+
$ref: '#/components/schemas/SLOFormula'
11502+
queries:
11503+
example:
11504+
- data_source: metrics
11505+
name: query1
11506+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11507+
items:
11508+
$ref: '#/components/schemas/SLODataSourceQueryDefinition'
11509+
minItems: 1
11510+
type: array
11511+
total_events_formula:
11512+
$ref: '#/components/schemas/SLOFormula'
11513+
required:
11514+
- good_events_formula
11515+
- total_events_formula
11516+
- queries
11517+
type: object
11518+
SLOCountSpec:
11519+
additionalProperties: false
11520+
description: A metric SLI specification.
11521+
example:
11522+
count:
11523+
good_events_formula: query1 - query2
11524+
queries:
11525+
- data_source: metrics
11526+
name: query1
11527+
query: sum:trace.servlet.request.hits{*} by {env}.as_count()
11528+
- data_source: metrics
11529+
name: query2
11530+
query: sum:trace.servlet.request.errors{*} by {env}.as_count()
11531+
total_events_formula: query1
11532+
properties:
11533+
count:
11534+
$ref: '#/components/schemas/SLOCountCondition'
11535+
required:
11536+
- count
11537+
type: object
1148411538
SLOCreator:
1148511539
description: The creator of the SLO
1148611540
nullable: true
@@ -12328,8 +12382,16 @@ components:
1232812382
type: string
1232912383
query:
1233012384
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
12385+
description: 'The metric query of good / total events. This is not allowed
12386+
if the `sli_specification` field
12387+
12388+
is used in the same request.'
1233112389
sli_specification:
1233212390
$ref: '#/components/schemas/SLOSliSpec'
12391+
description: 'A generic SLI specification. This is currently used for time-slice
12392+
and metric SLOs only.
12393+
12394+
This is not allowed if the `query` field is used in the same request.'
1233312395
tags:
1233412396
description: 'A list of tags associated with this service level objective.
1233512397

@@ -12386,9 +12448,10 @@ components:
1238612448
type: object
1238712449
SLOSliSpec:
1238812450
description: A generic SLI specification. This is currently used for time-slice
12389-
SLOs only.
12451+
and metric SLOs only.
1239012452
oneOf:
1239112453
- $ref: '#/components/schemas/SLOTimeSliceSpec'
12454+
- $ref: '#/components/schemas/SLOCountSpec'
1239212455
SLOState:
1239312456
description: State of the SLO.
1239412457
enum:
@@ -13479,8 +13542,16 @@ components:
1347913542
type: string
1348013543
query:
1348113544
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
13545+
description: 'The metric query of good / total events. This is not allowed
13546+
if the `sli_specification` field
13547+
13548+
is used in the same request.'
1348213549
sli_specification:
1348313550
$ref: '#/components/schemas/SLOSliSpec'
13551+
description: 'A generic SLI specification. This is currently used for time-slice
13552+
and metric SLOs only.
13553+
13554+
This is not allowed if the `query` field is used in the same request.'
1348413555
tags:
1348513556
description: 'A list of tags associated with this service level objective.
1348613557

@@ -13540,8 +13611,8 @@ components:
1354013611
- type
1354113612
type: object
1354213613
ServiceLevelObjectiveQuery:
13543-
description: 'A metric-based SLO. **Required if type is `metric`**. Note that
13544-
Datadog only allows the sum by aggregator
13614+
description: 'A now deprecated metric SLO. Note that Datadog only allows the
13615+
sum by aggregator
1354513616

1354613617
to be used because this will sum up all request counts instead of averaging
1354713618
them, or taking the max or
@@ -13610,8 +13681,16 @@ components:
1361013681
type: string
1361113682
query:
1361213683
$ref: '#/components/schemas/ServiceLevelObjectiveQuery'
13684+
description: 'The metric query of good / total events. This is not allowed
13685+
if the `sli_specification` field
13686+
13687+
is used in the same request.'
1361313688
sli_specification:
1361413689
$ref: '#/components/schemas/SLOSliSpec'
13690+
description: 'A generic SLI specification. This is currently used for time-slice
13691+
and metric SLOs only.
13692+
13693+
This is not allowed if the `query` field is used in the same request.'
1361513694
tags:
1361613695
description: 'A list of tags associated with this service level objective.
1361713696

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ def overrides
522522
"v1.slo_correction_update_data" => "SLOCorrectionUpdateData",
523523
"v1.slo_correction_update_request" => "SLOCorrectionUpdateRequest",
524524
"v1.slo_correction_update_request_attributes" => "SLOCorrectionUpdateRequestAttributes",
525+
"v1.slo_count_condition" => "SLOCountCondition",
526+
"v1.slo_count_spec" => "SLOCountSpec",
525527
"v1.slo_creator" => "SLOCreator",
526528
"v1.slo_data_source_query_definition" => "SLODataSourceQueryDefinition",
527529
"v1.slo_delete_response" => "SLODeleteResponse",

lib/datadog_api_client/v1/models/service_level_objective.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ class ServiceLevelObjective
6868
# The name of the service level objective object.
6969
attr_reader :name
7070

71-
# A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator
71+
# A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator
7272
# to be used because this will sum up all request counts instead of averaging them, or taking the max or
7373
# min of all of those requests.
7474
attr_accessor :query
7575

76-
# A generic SLI specification. This is currently used for time-slice SLOs only.
76+
# A generic SLI specification. This is currently used for time-slice and metric SLOs only.
7777
attr_accessor :sli_specification
7878

7979
# A list of tags associated with this service level objective.

lib/datadog_api_client/v1/models/service_level_objective_query.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
require 'time'
1818

1919
module DatadogAPIClient::V1
20-
# A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator
20+
# A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator
2121
# to be used because this will sum up all request counts instead of averaging them, or taking the max or
2222
# min of all of those requests.
2323
class ServiceLevelObjectiveQuery

lib/datadog_api_client/v1/models/service_level_objective_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ class ServiceLevelObjectiveRequest
4242
# The name of the service level objective object.
4343
attr_reader :name
4444

45-
# A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator
45+
# A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator
4646
# to be used because this will sum up all request counts instead of averaging them, or taking the max or
4747
# min of all of those requests.
4848
attr_accessor :query
4949

50-
# A generic SLI specification. This is currently used for time-slice SLOs only.
50+
# A generic SLI specification. This is currently used for time-slice and metric SLOs only.
5151
attr_accessor :sli_specification
5252

5353
# A list of tags associated with this service level objective.
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
=begin
2+
#Datadog API V1 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V1
20+
# A metric SLI specification, composed of three parts: the good events formula, the total events formula,
21+
# and the involved queries.
22+
class SLOCountCondition
23+
include BaseGenericModel
24+
25+
# A formula that specifies how to combine the results of multiple queries.
26+
attr_reader :good_events_formula
27+
28+
#
29+
attr_reader :queries
30+
31+
# A formula that specifies how to combine the results of multiple queries.
32+
attr_reader :total_events_formula
33+
34+
attr_accessor :additional_properties
35+
36+
# Attribute mapping from ruby-style variable name to JSON key.
37+
# @!visibility private
38+
def self.attribute_map
39+
{
40+
:'good_events_formula' => :'good_events_formula',
41+
:'queries' => :'queries',
42+
:'total_events_formula' => :'total_events_formula'
43+
}
44+
end
45+
46+
# Attribute type mapping.
47+
# @!visibility private
48+
def self.openapi_types
49+
{
50+
:'good_events_formula' => :'SLOFormula',
51+
:'queries' => :'Array<SLODataSourceQueryDefinition>',
52+
:'total_events_formula' => :'SLOFormula'
53+
}
54+
end
55+
56+
# Initializes the object
57+
# @param attributes [Hash] Model attributes in the form of hash
58+
# @!visibility private
59+
def initialize(attributes = {})
60+
if (!attributes.is_a?(Hash))
61+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SLOCountCondition` initialize method"
62+
end
63+
64+
self.additional_properties = {}
65+
# check to see if the attribute exists and convert string to symbol for hash key
66+
attributes = attributes.each_with_object({}) { |(k, v), h|
67+
if (!self.class.attribute_map.key?(k.to_sym))
68+
self.additional_properties[k.to_sym] = v
69+
else
70+
h[k.to_sym] = v
71+
end
72+
}
73+
74+
if attributes.key?(:'good_events_formula')
75+
self.good_events_formula = attributes[:'good_events_formula']
76+
end
77+
78+
if attributes.key?(:'queries')
79+
if (value = attributes[:'queries']).is_a?(Array)
80+
self.queries = value
81+
end
82+
end
83+
84+
if attributes.key?(:'total_events_formula')
85+
self.total_events_formula = attributes[:'total_events_formula']
86+
end
87+
end
88+
89+
# Check to see if the all the properties in the model are valid
90+
# @return true if the model is valid
91+
# @!visibility private
92+
def valid?
93+
return false if @good_events_formula.nil?
94+
return false if @queries.nil?
95+
return false if @queries.length < 1
96+
return false if @total_events_formula.nil?
97+
true
98+
end
99+
100+
# Custom attribute writer method with validation
101+
# @param good_events_formula [Object] Object to be assigned
102+
# @!visibility private
103+
def good_events_formula=(good_events_formula)
104+
if good_events_formula.nil?
105+
fail ArgumentError, 'invalid value for "good_events_formula", good_events_formula cannot be nil.'
106+
end
107+
@good_events_formula = good_events_formula
108+
end
109+
110+
# Custom attribute writer method with validation
111+
# @param queries [Object] Object to be assigned
112+
# @!visibility private
113+
def queries=(queries)
114+
if queries.nil?
115+
fail ArgumentError, 'invalid value for "queries", queries cannot be nil.'
116+
end
117+
if queries.length < 1
118+
fail ArgumentError, 'invalid value for "queries", number of items must be greater than or equal to 1.'
119+
end
120+
@queries = queries
121+
end
122+
123+
# Custom attribute writer method with validation
124+
# @param total_events_formula [Object] Object to be assigned
125+
# @!visibility private
126+
def total_events_formula=(total_events_formula)
127+
if total_events_formula.nil?
128+
fail ArgumentError, 'invalid value for "total_events_formula", total_events_formula cannot be nil.'
129+
end
130+
@total_events_formula = total_events_formula
131+
end
132+
133+
# Returns the object in the form of hash, with additionalProperties support.
134+
# @return [Hash] Returns the object in the form of hash
135+
# @!visibility private
136+
def to_hash
137+
hash = {}
138+
self.class.attribute_map.each_pair do |attr, param|
139+
value = self.send(attr)
140+
if value.nil?
141+
is_nullable = self.class.openapi_nullable.include?(attr)
142+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
143+
end
144+
145+
hash[param] = _to_hash(value)
146+
end
147+
self.additional_properties.each_pair do |attr, value|
148+
hash[attr] = value
149+
end
150+
hash
151+
end
152+
153+
# Checks equality by comparing each attribute.
154+
# @param o [Object] Object to be compared
155+
# @!visibility private
156+
def ==(o)
157+
return true if self.equal?(o)
158+
self.class == o.class &&
159+
good_events_formula == o.good_events_formula &&
160+
queries == o.queries &&
161+
total_events_formula == o.total_events_formula &&
162+
additional_properties == o.additional_properties
163+
end
164+
165+
# Calculates hash code according to all attributes.
166+
# @return [Integer] Hash code
167+
# @!visibility private
168+
def hash
169+
[good_events_formula, queries, total_events_formula, additional_properties].hash
170+
end
171+
end
172+
end

0 commit comments

Comments
 (0)