From 605e7a9dd8837008cd9653270d15ef168978f1ac Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 10 Dec 2025 15:38:18 +0000 Subject: [PATCH] Regenerate client from commit 795c134 of spec repo --- .generator/schemas/v1/openapi.yaml | 85 ++++++++++++++++++- docs/datadog_api_client.v1.model.rst | 14 +++ .../v1/model/service_level_objective.py | 7 +- .../v1/model/service_level_objective_query.py | 2 +- .../model/service_level_objective_request.py | 7 +- .../v1/model/slo_count_condition.py | 70 +++++++++++++++ .../v1/model/slo_count_spec.py | 45 ++++++++++ .../v1/model/slo_response_data.py | 7 +- .../v1/model/slo_sli_spec.py | 8 +- src/datadog_api_client/v1/models/__init__.py | 4 + 10 files changed, 235 insertions(+), 14 deletions(-) create mode 100644 src/datadog_api_client/v1/model/slo_count_condition.py create mode 100644 src/datadog_api_client/v1/model/slo_count_spec.py diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index afb32a4a89..f640568bf2 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -11481,6 +11481,60 @@ components: example: UTC type: string type: object + SLOCountCondition: + description: 'A metric SLI specification, composed of three parts: the good + events formula, the total events formula, + + and the involved queries.' + example: + good_events_formula: query1 - query2 + queries: + - data_source: metrics + name: query1 + query: sum:trace.servlet.request.hits{*} by {env}.as_count() + - data_source: metrics + name: query2 + query: sum:trace.servlet.request.errors{*} by {env}.as_count() + total_events_formula: query1 + properties: + good_events_formula: + $ref: '#/components/schemas/SLOFormula' + queries: + example: + - data_source: metrics + name: query1 + query: sum:trace.servlet.request.hits{*} by {env}.as_count() + items: + $ref: '#/components/schemas/SLODataSourceQueryDefinition' + minItems: 1 + type: array + total_events_formula: + $ref: '#/components/schemas/SLOFormula' + required: + - good_events_formula + - total_events_formula + - queries + type: object + SLOCountSpec: + additionalProperties: false + description: A metric SLI specification. + example: + count: + good_events_formula: query1 - query2 + queries: + - data_source: metrics + name: query1 + query: sum:trace.servlet.request.hits{*} by {env}.as_count() + - data_source: metrics + name: query2 + query: sum:trace.servlet.request.errors{*} by {env}.as_count() + total_events_formula: query1 + properties: + count: + $ref: '#/components/schemas/SLOCountCondition' + required: + - count + type: object SLOCreator: description: The creator of the SLO nullable: true @@ -12328,8 +12382,16 @@ components: type: string query: $ref: '#/components/schemas/ServiceLevelObjectiveQuery' + description: 'The metric query of good / total events. This is not allowed + if the `sli_specification` field + + is used in the same request.' sli_specification: $ref: '#/components/schemas/SLOSliSpec' + description: 'A generic SLI specification. This is currently used for time-slice + and metric SLOs only. + + This is not allowed if the `query` field is used in the same request.' tags: description: 'A list of tags associated with this service level objective. @@ -12386,9 +12448,10 @@ components: type: object SLOSliSpec: description: A generic SLI specification. This is currently used for time-slice - SLOs only. + and metric SLOs only. oneOf: - $ref: '#/components/schemas/SLOTimeSliceSpec' + - $ref: '#/components/schemas/SLOCountSpec' SLOState: description: State of the SLO. enum: @@ -13479,8 +13542,16 @@ components: type: string query: $ref: '#/components/schemas/ServiceLevelObjectiveQuery' + description: 'The metric query of good / total events. This is not allowed + if the `sli_specification` field + + is used in the same request.' sli_specification: $ref: '#/components/schemas/SLOSliSpec' + description: 'A generic SLI specification. This is currently used for time-slice + and metric SLOs only. + + This is not allowed if the `query` field is used in the same request.' tags: description: 'A list of tags associated with this service level objective. @@ -13540,8 +13611,8 @@ components: - type type: object ServiceLevelObjectiveQuery: - description: 'A metric-based SLO. **Required if type is `metric`**. Note that - Datadog only allows the sum by aggregator + description: 'A now deprecated metric SLO. Note that Datadog only allows the + sum by aggregator to be used because this will sum up all request counts instead of averaging them, or taking the max or @@ -13610,8 +13681,16 @@ components: type: string query: $ref: '#/components/schemas/ServiceLevelObjectiveQuery' + description: 'The metric query of good / total events. This is not allowed + if the `sli_specification` field + + is used in the same request.' sli_specification: $ref: '#/components/schemas/SLOSliSpec' + description: 'A generic SLI specification. This is currently used for time-slice + and metric SLOs only. + + This is not allowed if the `query` field is used in the same request.' tags: description: 'A list of tags associated with this service level objective. diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 6af64f9fa9..ee7923283c 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -3672,6 +3672,20 @@ datadog\_api\_client.v1.model.slo\_correction\_update\_request\_attributes modul :members: :show-inheritance: +datadog\_api\_client.v1.model.slo\_count\_condition module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.slo_count_condition + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.slo\_count\_spec module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.slo_count_spec + :members: + :show-inheritance: + datadog\_api\_client.v1.model.slo\_creator module ------------------------------------------------- diff --git a/src/datadog_api_client/v1/model/service_level_objective.py b/src/datadog_api_client/v1/model/service_level_objective.py index a95b993513..3b555e5d30 100644 --- a/src/datadog_api_client/v1/model/service_level_objective.py +++ b/src/datadog_api_client/v1/model/service_level_objective.py @@ -22,6 +22,7 @@ from datadog_api_client.v1.model.slo_timeframe import SLOTimeframe from datadog_api_client.v1.model.slo_type import SLOType from datadog_api_client.v1.model.slo_time_slice_spec import SLOTimeSliceSpec + from datadog_api_client.v1.model.slo_count_spec import SLOCountSpec class ServiceLevelObjective(ModelNormal): @@ -94,7 +95,7 @@ def __init__( monitor_ids: Union[List[int], UnsetType] = unset, monitor_tags: Union[List[str], UnsetType] = unset, query: Union[ServiceLevelObjectiveQuery, UnsetType] = unset, - sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, UnsetType] = unset, + sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, SLOCountSpec, UnsetType] = unset, tags: Union[List[str], UnsetType] = unset, target_threshold: Union[float, UnsetType] = unset, timeframe: Union[SLOTimeframe, UnsetType] = unset, @@ -151,12 +152,12 @@ def __init__( :param name: The name of the service level objective object. :type name: str - :param query: A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator + :param query: A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator to be used because this will sum up all request counts instead of averaging them, or taking the max or min of all of those requests. :type query: ServiceLevelObjectiveQuery, optional - :param sli_specification: A generic SLI specification. This is currently used for time-slice SLOs only. + :param sli_specification: A generic SLI specification. This is currently used for time-slice and metric SLOs only. :type sli_specification: SLOSliSpec, optional :param tags: A list of tags associated with this service level objective. diff --git a/src/datadog_api_client/v1/model/service_level_objective_query.py b/src/datadog_api_client/v1/model/service_level_objective_query.py index ee11656739..463651c651 100644 --- a/src/datadog_api_client/v1/model/service_level_objective_query.py +++ b/src/datadog_api_client/v1/model/service_level_objective_query.py @@ -25,7 +25,7 @@ def openapi_types(_): def __init__(self_, denominator: str, numerator: str, **kwargs): """ - A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator + A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator to be used because this will sum up all request counts instead of averaging them, or taking the max or min of all of those requests. diff --git a/src/datadog_api_client/v1/model/service_level_objective_request.py b/src/datadog_api_client/v1/model/service_level_objective_request.py index dbeb4bd0d9..94a3a87903 100644 --- a/src/datadog_api_client/v1/model/service_level_objective_request.py +++ b/src/datadog_api_client/v1/model/service_level_objective_request.py @@ -21,6 +21,7 @@ from datadog_api_client.v1.model.slo_timeframe import SLOTimeframe from datadog_api_client.v1.model.slo_type import SLOType from datadog_api_client.v1.model.slo_time_slice_spec import SLOTimeSliceSpec + from datadog_api_client.v1.model.slo_count_spec import SLOCountSpec class ServiceLevelObjectiveRequest(ModelNormal): @@ -71,7 +72,7 @@ def __init__( groups: Union[List[str], UnsetType] = unset, monitor_ids: Union[List[int], UnsetType] = unset, query: Union[ServiceLevelObjectiveQuery, UnsetType] = unset, - sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, UnsetType] = unset, + sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, SLOCountSpec, UnsetType] = unset, tags: Union[List[str], UnsetType] = unset, target_threshold: Union[float, UnsetType] = unset, timeframe: Union[SLOTimeframe, UnsetType] = unset, @@ -102,12 +103,12 @@ def __init__( :param name: The name of the service level objective object. :type name: str - :param query: A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator + :param query: A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator to be used because this will sum up all request counts instead of averaging them, or taking the max or min of all of those requests. :type query: ServiceLevelObjectiveQuery, optional - :param sli_specification: A generic SLI specification. This is currently used for time-slice SLOs only. + :param sli_specification: A generic SLI specification. This is currently used for time-slice and metric SLOs only. :type sli_specification: SLOSliSpec, optional :param tags: A list of tags associated with this service level objective. diff --git a/src/datadog_api_client/v1/model/slo_count_condition.py b/src/datadog_api_client/v1/model/slo_count_condition.py new file mode 100644 index 0000000000..581d26fea0 --- /dev/null +++ b/src/datadog_api_client/v1/model/slo_count_condition.py @@ -0,0 +1,70 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.slo_formula import SLOFormula + from datadog_api_client.v1.model.slo_data_source_query_definition import SLODataSourceQueryDefinition + from datadog_api_client.v1.model.formula_and_function_metric_query_definition import ( + FormulaAndFunctionMetricQueryDefinition, + ) + + +class SLOCountCondition(ModelNormal): + validations = { + "queries": { + "min_items": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.slo_formula import SLOFormula + from datadog_api_client.v1.model.slo_data_source_query_definition import SLODataSourceQueryDefinition + + return { + "good_events_formula": (SLOFormula,), + "queries": ([SLODataSourceQueryDefinition],), + "total_events_formula": (SLOFormula,), + } + + attribute_map = { + "good_events_formula": "good_events_formula", + "queries": "queries", + "total_events_formula": "total_events_formula", + } + + def __init__( + self_, + good_events_formula: SLOFormula, + queries: List[Union[SLODataSourceQueryDefinition, FormulaAndFunctionMetricQueryDefinition]], + total_events_formula: SLOFormula, + **kwargs, + ): + """ + A metric SLI specification, composed of three parts: the good events formula, the total events formula, + and the involved queries. + + :param good_events_formula: A formula that specifies how to combine the results of multiple queries. + :type good_events_formula: SLOFormula + + :param queries: + :type queries: [SLODataSourceQueryDefinition] + + :param total_events_formula: A formula that specifies how to combine the results of multiple queries. + :type total_events_formula: SLOFormula + """ + super().__init__(kwargs) + + self_.good_events_formula = good_events_formula + self_.queries = queries + self_.total_events_formula = total_events_formula diff --git a/src/datadog_api_client/v1/model/slo_count_spec.py b/src/datadog_api_client/v1/model/slo_count_spec.py new file mode 100644 index 0000000000..d09c3df743 --- /dev/null +++ b/src/datadog_api_client/v1/model/slo_count_spec.py @@ -0,0 +1,45 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.slo_count_condition import SLOCountCondition + + +class SLOCountSpec(ModelNormal): + @cached_property + def additional_properties_type(_): + return None + + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.slo_count_condition import SLOCountCondition + + return { + "count": (SLOCountCondition,), + } + + attribute_map = { + "count": "count", + } + + def __init__(self_, count: SLOCountCondition, **kwargs): + """ + A metric SLI specification. + + :param count: A metric SLI specification, composed of three parts: the good events formula, the total events formula, + and the involved queries. + :type count: SLOCountCondition + """ + super().__init__(kwargs) + + self_.count = count diff --git a/src/datadog_api_client/v1/model/slo_response_data.py b/src/datadog_api_client/v1/model/slo_response_data.py index 275644beb1..08d3d6a1b6 100644 --- a/src/datadog_api_client/v1/model/slo_response_data.py +++ b/src/datadog_api_client/v1/model/slo_response_data.py @@ -22,6 +22,7 @@ from datadog_api_client.v1.model.slo_timeframe import SLOTimeframe from datadog_api_client.v1.model.slo_type import SLOType from datadog_api_client.v1.model.slo_time_slice_spec import SLOTimeSliceSpec + from datadog_api_client.v1.model.slo_count_spec import SLOCountSpec class SLOResponseData(ModelNormal): @@ -95,7 +96,7 @@ def __init__( monitor_tags: Union[List[str], UnsetType] = unset, name: Union[str, UnsetType] = unset, query: Union[ServiceLevelObjectiveQuery, UnsetType] = unset, - sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, UnsetType] = unset, + sli_specification: Union[SLOSliSpec, SLOTimeSliceSpec, SLOCountSpec, UnsetType] = unset, tags: Union[List[str], UnsetType] = unset, target_threshold: Union[float, UnsetType] = unset, thresholds: Union[List[SLOThreshold], UnsetType] = unset, @@ -157,12 +158,12 @@ def __init__( :param name: The name of the service level objective object. :type name: str, optional - :param query: A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator + :param query: A now deprecated metric SLO. Note that Datadog only allows the sum by aggregator to be used because this will sum up all request counts instead of averaging them, or taking the max or min of all of those requests. :type query: ServiceLevelObjectiveQuery, optional - :param sli_specification: A generic SLI specification. This is currently used for time-slice SLOs only. + :param sli_specification: A generic SLI specification. This is currently used for time-slice and metric SLOs only. :type sli_specification: SLOSliSpec, optional :param tags: A list of tags associated with this service level objective. diff --git a/src/datadog_api_client/v1/model/slo_sli_spec.py b/src/datadog_api_client/v1/model/slo_sli_spec.py index 69f9e701d5..6f4d4c1887 100644 --- a/src/datadog_api_client/v1/model/slo_sli_spec.py +++ b/src/datadog_api_client/v1/model/slo_sli_spec.py @@ -13,11 +13,15 @@ class SLOSliSpec(ModelComposed): def __init__(self, **kwargs): """ - A generic SLI specification. This is currently used for time-slice SLOs only. + A generic SLI specification. This is currently used for time-slice and metric SLOs only. :param time_slice: The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator, and 3. the threshold. Optionally, a fourth part, the query interval, can be provided. :type time_slice: SLOTimeSliceCondition + + :param count: A metric SLI specification, composed of three parts: the good events formula, the total events formula, + and the involved queries. + :type count: SLOCountCondition """ super().__init__(kwargs) @@ -31,9 +35,11 @@ def _composed_schemas(_): # classes don't exist yet because their module has not finished # loading from datadog_api_client.v1.model.slo_time_slice_spec import SLOTimeSliceSpec + from datadog_api_client.v1.model.slo_count_spec import SLOCountSpec return { "oneOf": [ SLOTimeSliceSpec, + SLOCountSpec, ], } diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index a0eb1f4f6f..c51fc36344 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -539,6 +539,8 @@ from datadog_api_client.v1.model.slo_correction_update_data import SLOCorrectionUpdateData from datadog_api_client.v1.model.slo_correction_update_request import SLOCorrectionUpdateRequest from datadog_api_client.v1.model.slo_correction_update_request_attributes import SLOCorrectionUpdateRequestAttributes +from datadog_api_client.v1.model.slo_count_condition import SLOCountCondition +from datadog_api_client.v1.model.slo_count_spec import SLOCountSpec from datadog_api_client.v1.model.slo_creator import SLOCreator from datadog_api_client.v1.model.slo_data_source_query_definition import SLODataSourceQueryDefinition from datadog_api_client.v1.model.slo_delete_response import SLODeleteResponse @@ -1591,6 +1593,8 @@ "SLOCorrectionUpdateData", "SLOCorrectionUpdateRequest", "SLOCorrectionUpdateRequestAttributes", + "SLOCountCondition", + "SLOCountSpec", "SLOCreator", "SLODataSourceQueryDefinition", "SLODeleteResponse",