Skip to content

Commit 605e7a9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 795c134 of spec repo
1 parent 50cf60e commit 605e7a9

File tree

10 files changed

+235
-14
lines changed

10 files changed

+235
-14
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

docs/datadog_api_client.v1.model.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3672,6 +3672,20 @@ datadog\_api\_client.v1.model.slo\_correction\_update\_request\_attributes modul
36723672
:members:
36733673
:show-inheritance:
36743674

3675+
datadog\_api\_client.v1.model.slo\_count\_condition module
3676+
----------------------------------------------------------
3677+
3678+
.. automodule:: datadog_api_client.v1.model.slo_count_condition
3679+
:members:
3680+
:show-inheritance:
3681+
3682+
datadog\_api\_client.v1.model.slo\_count\_spec module
3683+
-----------------------------------------------------
3684+
3685+
.. automodule:: datadog_api_client.v1.model.slo_count_spec
3686+
:members:
3687+
:show-inheritance:
3688+
36753689
datadog\_api\_client.v1.model.slo\_creator module
36763690
-------------------------------------------------
36773691

src/datadog_api_client/v1/model/service_level_objective.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from datadog_api_client.v1.model.slo_timeframe import SLOTimeframe
2323
from datadog_api_client.v1.model.slo_type import SLOType
2424
from datadog_api_client.v1.model.slo_time_slice_spec import SLOTimeSliceSpec
25+
from datadog_api_client.v1.model.slo_count_spec import SLOCountSpec
2526

2627

2728
class ServiceLevelObjective(ModelNormal):
@@ -94,7 +95,7 @@ def __init__(
9495
monitor_ids: Union[List[int], UnsetType] = unset,
9596
monitor_tags: Union[List[str], UnsetType] = unset,
9697
query: Union[ServiceLevelObjectiveQuery, UnsetType] = unset,
97-
sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, UnsetType] = unset,
98+
sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, SLOCountSpec, UnsetType] = unset,
9899
tags: Union[List[str], UnsetType] = unset,
99100
target_threshold: Union[float, UnsetType] = unset,
100101
timeframe: Union[SLOTimeframe, UnsetType] = unset,
@@ -151,12 +152,12 @@ def __init__(
151152
:param name: The name of the service level objective object.
152153
:type name: str
153154
154-
:param query: A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator
155+
:param query: A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator
155156
to be used because this will sum up all request counts instead of averaging them, or taking the max or
156157
min of all of those requests.
157158
:type query: ServiceLevelObjectiveQuery, optional
158159
159-
:param sli_specification: A generic SLI specification. This is currently used for time-slice SLOs only.
160+
:param sli_specification: A generic SLI specification. This is currently used for time-slice and metric SLOs only.
160161
:type sli_specification: SLOSliSpec, optional
161162
162163
:param tags: A list of tags associated with this service level objective.

src/datadog_api_client/v1/model/service_level_objective_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def openapi_types(_):
2525

2626
def __init__(self_, denominator: str, numerator: str, **kwargs):
2727
"""
28-
A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator
28+
A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator
2929
to be used because this will sum up all request counts instead of averaging them, or taking the max or
3030
min of all of those requests.
3131

src/datadog_api_client/v1/model/service_level_objective_request.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from datadog_api_client.v1.model.slo_timeframe import SLOTimeframe
2222
from datadog_api_client.v1.model.slo_type import SLOType
2323
from datadog_api_client.v1.model.slo_time_slice_spec import SLOTimeSliceSpec
24+
from datadog_api_client.v1.model.slo_count_spec import SLOCountSpec
2425

2526

2627
class ServiceLevelObjectiveRequest(ModelNormal):
@@ -71,7 +72,7 @@ def __init__(
7172
groups: Union[List[str], UnsetType] = unset,
7273
monitor_ids: Union[List[int], UnsetType] = unset,
7374
query: Union[ServiceLevelObjectiveQuery, UnsetType] = unset,
74-
sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, UnsetType] = unset,
75+
sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, SLOCountSpec, UnsetType] = unset,
7576
tags: Union[List[str], UnsetType] = unset,
7677
target_threshold: Union[float, UnsetType] = unset,
7778
timeframe: Union[SLOTimeframe, UnsetType] = unset,
@@ -102,12 +103,12 @@ def __init__(
102103
:param name: The name of the service level objective object.
103104
:type name: str
104105
105-
:param query: A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator
106+
:param query: A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator
106107
to be used because this will sum up all request counts instead of averaging them, or taking the max or
107108
min of all of those requests.
108109
:type query: ServiceLevelObjectiveQuery, optional
109110
110-
:param sli_specification: A generic SLI specification. This is currently used for time-slice SLOs only.
111+
:param sli_specification: A generic SLI specification. This is currently used for time-slice and metric SLOs only.
111112
:type sli_specification: SLOSliSpec, optional
112113
113114
:param tags: A list of tags associated with this service level objective.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v1.model.slo_formula import SLOFormula
16+
from datadog_api_client.v1.model.slo_data_source_query_definition import SLODataSourceQueryDefinition
17+
from datadog_api_client.v1.model.formula_and_function_metric_query_definition import (
18+
FormulaAndFunctionMetricQueryDefinition,
19+
)
20+
21+
22+
class SLOCountCondition(ModelNormal):
23+
validations = {
24+
"queries": {
25+
"min_items": 1,
26+
},
27+
}
28+
29+
@cached_property
30+
def openapi_types(_):
31+
from datadog_api_client.v1.model.slo_formula import SLOFormula
32+
from datadog_api_client.v1.model.slo_data_source_query_definition import SLODataSourceQueryDefinition
33+
34+
return {
35+
"good_events_formula": (SLOFormula,),
36+
"queries": ([SLODataSourceQueryDefinition],),
37+
"total_events_formula": (SLOFormula,),
38+
}
39+
40+
attribute_map = {
41+
"good_events_formula": "good_events_formula",
42+
"queries": "queries",
43+
"total_events_formula": "total_events_formula",
44+
}
45+
46+
def __init__(
47+
self_,
48+
good_events_formula: SLOFormula,
49+
queries: List[Union[SLODataSourceQueryDefinition, FormulaAndFunctionMetricQueryDefinition]],
50+
total_events_formula: SLOFormula,
51+
**kwargs,
52+
):
53+
"""
54+
A metric SLI specification, composed of three parts: the good events formula, the total events formula,
55+
and the involved queries.
56+
57+
:param good_events_formula: A formula that specifies how to combine the results of multiple queries.
58+
:type good_events_formula: SLOFormula
59+
60+
:param queries:
61+
:type queries: [SLODataSourceQueryDefinition]
62+
63+
:param total_events_formula: A formula that specifies how to combine the results of multiple queries.
64+
:type total_events_formula: SLOFormula
65+
"""
66+
super().__init__(kwargs)
67+
68+
self_.good_events_formula = good_events_formula
69+
self_.queries = queries
70+
self_.total_events_formula = total_events_formula
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
)
12+
13+
14+
if TYPE_CHECKING:
15+
from datadog_api_client.v1.model.slo_count_condition import SLOCountCondition
16+
17+
18+
class SLOCountSpec(ModelNormal):
19+
@cached_property
20+
def additional_properties_type(_):
21+
return None
22+
23+
@cached_property
24+
def openapi_types(_):
25+
from datadog_api_client.v1.model.slo_count_condition import SLOCountCondition
26+
27+
return {
28+
"count": (SLOCountCondition,),
29+
}
30+
31+
attribute_map = {
32+
"count": "count",
33+
}
34+
35+
def __init__(self_, count: SLOCountCondition, **kwargs):
36+
"""
37+
A metric SLI specification.
38+
39+
:param count: A metric SLI specification, composed of three parts: the good events formula, the total events formula,
40+
and the involved queries.
41+
:type count: SLOCountCondition
42+
"""
43+
super().__init__(kwargs)
44+
45+
self_.count = count

src/datadog_api_client/v1/model/slo_response_data.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from datadog_api_client.v1.model.slo_timeframe import SLOTimeframe
2323
from datadog_api_client.v1.model.slo_type import SLOType
2424
from datadog_api_client.v1.model.slo_time_slice_spec import SLOTimeSliceSpec
25+
from datadog_api_client.v1.model.slo_count_spec import SLOCountSpec
2526

2627

2728
class SLOResponseData(ModelNormal):
@@ -95,7 +96,7 @@ def __init__(
9596
monitor_tags: Union[List[str], UnsetType] = unset,
9697
name: Union[str, UnsetType] = unset,
9798
query: Union[ServiceLevelObjectiveQuery, UnsetType] = unset,
98-
sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, UnsetType] = unset,
99+
sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, SLOCountSpec, UnsetType] = unset,
99100
tags: Union[List[str], UnsetType] = unset,
100101
target_threshold: Union[float, UnsetType] = unset,
101102
thresholds: Union[List[SLOThreshold], UnsetType] = unset,
@@ -157,12 +158,12 @@ def __init__(
157158
:param name: The name of the service level objective object.
158159
:type name: str, optional
159160
160-
:param query: A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator
161+
:param query: A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator
161162
to be used because this will sum up all request counts instead of averaging them, or taking the max or
162163
min of all of those requests.
163164
:type query: ServiceLevelObjectiveQuery, optional
164165
165-
:param sli_specification: A generic SLI specification. This is currently used for time-slice SLOs only.
166+
:param sli_specification: A generic SLI specification. This is currently used for time-slice and metric SLOs only.
166167
:type sli_specification: SLOSliSpec, optional
167168
168169
:param tags: A list of tags associated with this service level objective.

0 commit comments

Comments
 (0)