From d67e44171c02fa73acda73953f3f0585de2a044a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 14 Apr 2026 15:38:49 +0000 Subject: [PATCH] Regenerate client from commit a8278b6 of spec repo --- .generator/schemas/v1/openapi.yaml | 110 +++++++++++++++++- docs/datadog_api_client.v1.model.rst | 42 +++++++ .../dashboards/CreateDashboard_2342457693.py | 57 +++++++++ ...scatter_plot_widget_definition_requests.py | 5 +- .../scatterplot_data_projection_dimension.py | 71 +++++++++++ .../scatterplot_data_projection_projection.py | 57 +++++++++ ...terplot_data_projection_projection_type.py | 35 ++++++ .../scatterplot_data_projection_query.py | 77 ++++++++++++ ...atterplot_data_projection_query_storage.py | 56 +++++++++ .../v1/model/scatterplot_table_request.py | 45 ++++++- .../model/scatterplot_table_request_type.py | 38 ++++++ src/datadog_api_client/v1/models/__init__.py | 14 +++ ...w_dashboard_with_scatterplot_widget.frozen | 2 +- ...new_dashboard_with_scatterplot_widget.yaml | 19 ++- tests/v1/features/dashboards.feature | 7 ++ .../scatterplot_widget.json | 49 ++++++++ 16 files changed, 670 insertions(+), 14 deletions(-) create mode 100644 src/datadog_api_client/v1/model/scatterplot_data_projection_dimension.py create mode 100644 src/datadog_api_client/v1/model/scatterplot_data_projection_projection.py create mode 100644 src/datadog_api_client/v1/model/scatterplot_data_projection_projection_type.py create mode 100644 src/datadog_api_client/v1/model/scatterplot_data_projection_query.py create mode 100644 src/datadog_api_client/v1/model/scatterplot_data_projection_query_storage.py create mode 100644 src/datadog_api_client/v1/model/scatterplot_table_request_type.py diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 6ccf9dc766..3d139b2f3b 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -13325,6 +13325,88 @@ components: type: string x-enum-varnames: - SCATTERPLOT + ScatterplotDataProjectionDimension: + description: A single dimension mapping for a scatterplot data projection. + properties: + alias: + description: Display alias for the dimension. + type: string + column: + description: The column name from the data source. + example: duration + type: string + dimension: + $ref: "#/components/schemas/ScatterplotDimension" + number_format: + $ref: "#/components/schemas/WidgetNumberFormat" + required: + - column + - dimension + type: object + ScatterplotDataProjectionProjection: + description: The projection configuration for a scatterplot data projection request. + properties: + dimensions: + description: Dimension mappings for the scatterplot axes. + items: + $ref: "#/components/schemas/ScatterplotDataProjectionDimension" + type: array + type: + $ref: "#/components/schemas/ScatterplotDataProjectionProjectionType" + required: + - type + - dimensions + type: object + ScatterplotDataProjectionProjectionType: + description: The type of the scatterplot data projection. + enum: + - scatterplot + example: scatterplot + type: string + x-enum-varnames: + - SCATTERPLOT + ScatterplotDataProjectionQuery: + description: The query for a scatterplot data projection request. + properties: + data_source: + $ref: "#/components/schemas/FormulaAndFunctionEventsDataSource" + indexes: + description: Indexes to search. + items: + type: string + type: array + query_string: + description: The search query string. + example: "@service:web-store" + type: string + storage: + $ref: "#/components/schemas/ScatterplotDataProjectionQueryStorage" + required: + - query_string + - data_source + type: object + ScatterplotDataProjectionQueryStorage: + description: Storage tier to query. + enum: + - live + - hot + - habanero + - online_archives + - driveline + - flex_tier + - case_insensitive + - cloud_prem + example: hot + type: string + x-enum-varnames: + - LIVE + - HOT + - HABANERO + - ONLINE_ARCHIVES + - DRIVELINE + - FLEX_TIER + - CASE_INSENSITIVE + - CLOUD_PREM ScatterplotDimension: description: Dimension of the Scatterplot. enum: @@ -13340,21 +13422,47 @@ components: - RADIUS - COLOR ScatterplotTableRequest: - description: Scatterplot request containing formulas and functions. + description: |- + Scatterplot table request. Supports two modes: + - **Formulas and functions** (default): `request_type` is absent or `"table"`. Uses `queries` and `formulas`. + - **Data projection**: `request_type` is `"data_projection"`. Uses `query`, `projection`, and optionally `limit`. properties: formulas: description: List of Scatterplot formulas that operate on queries. items: $ref: "#/components/schemas/ScatterplotWidgetFormula" type: array + limit: + description: Maximum number of rows to return. Used when `request_type` is `"data_projection"`. + format: int64 + type: integer + projection: + $ref: "#/components/schemas/ScatterplotDataProjectionProjection" + description: Projection configuration for data projection mode. Used when `request_type` is `"data_projection"`. queries: description: List of queries that can be returned directly or used in formulas. items: $ref: "#/components/schemas/FormulaAndFunctionQueryDefinition" type: array + query: + $ref: "#/components/schemas/ScatterplotDataProjectionQuery" + description: Query for data projection mode. Used when `request_type` is `"data_projection"`. + request_type: + $ref: "#/components/schemas/ScatterplotTableRequestType" + description: The type of the scatterplot table request. Use `"data_projection"` for unaggregated raw data. response_format: $ref: "#/components/schemas/FormulaAndFunctionResponseFormat" type: object + ScatterplotTableRequestType: + description: The type of the scatterplot table request. + enum: + - table + - data_projection + example: data_projection + type: string + x-enum-varnames: + - TABLE + - DATA_PROJECTION ScatterplotWidgetAggregator: description: Aggregator used for the request. enum: diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 5a8ff03b84..305303c469 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -3623,6 +3623,41 @@ datadog\_api\_client.v1.model.scatter\_plot\_widget\_definition\_type module :members: :show-inheritance: +datadog\_api\_client.v1.model.scatterplot\_data\_projection\_dimension module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.scatterplot_data_projection_dimension + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.scatterplot\_data\_projection\_projection module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.scatterplot_data_projection_projection + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.scatterplot\_data\_projection\_projection\_type module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.scatterplot_data_projection_projection_type + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.scatterplot\_data\_projection\_query module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.scatterplot_data_projection_query + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.scatterplot\_data\_projection\_query\_storage module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.scatterplot_data_projection_query_storage + :members: + :show-inheritance: + datadog\_api\_client.v1.model.scatterplot\_dimension module ----------------------------------------------------------- @@ -3637,6 +3672,13 @@ datadog\_api\_client.v1.model.scatterplot\_table\_request module :members: :show-inheritance: +datadog\_api\_client.v1.model.scatterplot\_table\_request\_type module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.scatterplot_table_request_type + :members: + :show-inheritance: + datadog\_api\_client.v1.model.scatterplot\_widget\_aggregator module -------------------------------------------------------------------- diff --git a/examples/v1/dashboards/CreateDashboard_2342457693.py b/examples/v1/dashboards/CreateDashboard_2342457693.py index ebcf1eb028..2809d34f50 100644 --- a/examples/v1/dashboards/CreateDashboard_2342457693.py +++ b/examples/v1/dashboards/CreateDashboard_2342457693.py @@ -6,6 +6,7 @@ from datadog_api_client.v1.api.dashboards_api import DashboardsApi from datadog_api_client.v1.model.dashboard import Dashboard from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType +from datadog_api_client.v1.model.formula_and_function_events_data_source import FormulaAndFunctionEventsDataSource from datadog_api_client.v1.model.formula_and_function_metric_aggregation import FormulaAndFunctionMetricAggregation from datadog_api_client.v1.model.formula_and_function_metric_data_source import FormulaAndFunctionMetricDataSource from datadog_api_client.v1.model.formula_and_function_metric_query_definition import ( @@ -15,8 +16,15 @@ from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition from datadog_api_client.v1.model.scatter_plot_widget_definition_requests import ScatterPlotWidgetDefinitionRequests from datadog_api_client.v1.model.scatter_plot_widget_definition_type import ScatterPlotWidgetDefinitionType +from datadog_api_client.v1.model.scatterplot_data_projection_dimension import ScatterplotDataProjectionDimension +from datadog_api_client.v1.model.scatterplot_data_projection_projection import ScatterplotDataProjectionProjection +from datadog_api_client.v1.model.scatterplot_data_projection_projection_type import ( + ScatterplotDataProjectionProjectionType, +) +from datadog_api_client.v1.model.scatterplot_data_projection_query import ScatterplotDataProjectionQuery from datadog_api_client.v1.model.scatterplot_dimension import ScatterplotDimension from datadog_api_client.v1.model.scatterplot_table_request import ScatterplotTableRequest +from datadog_api_client.v1.model.scatterplot_table_request_type import ScatterplotTableRequestType from datadog_api_client.v1.model.scatterplot_widget_formula import ScatterplotWidgetFormula from datadog_api_client.v1.model.widget import Widget from datadog_api_client.v1.model.widget_axis import WidgetAxis @@ -87,6 +95,55 @@ color_by_groups=[], ), ), + Widget( + layout=WidgetLayout( + x=48, + y=0, + width=47, + height=15, + ), + definition=ScatterPlotWidgetDefinition( + title="Data Projection Scatterplot", + title_size="16", + title_align=WidgetTextAlign.LEFT, + type=ScatterPlotWidgetDefinitionType.SCATTERPLOT, + requests=ScatterPlotWidgetDefinitionRequests( + table=ScatterplotTableRequest( + request_type=ScatterplotTableRequestType.DATA_PROJECTION, + query=ScatterplotDataProjectionQuery( + query_string="@service:web-store", + data_source=FormulaAndFunctionEventsDataSource.SPANS, + ), + projection=ScatterplotDataProjectionProjection( + type=ScatterplotDataProjectionProjectionType.SCATTERPLOT, + dimensions=[ + ScatterplotDataProjectionDimension( + column="duration", + dimension=ScatterplotDimension.X, + ), + ScatterplotDataProjectionDimension( + column="@resource_name", + dimension=ScatterplotDimension.Y, + ), + ], + ), + limit=200, + ), + ), + xaxis=WidgetAxis( + scale="linear", + include_zero=True, + min="auto", + max="auto", + ), + yaxis=WidgetAxis( + scale="linear", + include_zero=True, + min="auto", + max="auto", + ), + ), + ), ], template_variables=[], layout_type=DashboardLayoutType.FREE, diff --git a/src/datadog_api_client/v1/model/scatter_plot_widget_definition_requests.py b/src/datadog_api_client/v1/model/scatter_plot_widget_definition_requests.py index 9f8f51c354..21a8166a1f 100644 --- a/src/datadog_api_client/v1/model/scatter_plot_widget_definition_requests.py +++ b/src/datadog_api_client/v1/model/scatter_plot_widget_definition_requests.py @@ -46,7 +46,10 @@ def __init__( """ Widget definition. - :param table: Scatterplot request containing formulas and functions. + :param table: Scatterplot table request. Supports two modes: + + * **Formulas and functions** (default): ``request_type`` is absent or ``"table"``. Uses ``queries`` and ``formulas``. + * **Data projection** : ``request_type`` is ``"data_projection"``. Uses ``query`` , ``projection`` , and optionally ``limit``. :type table: ScatterplotTableRequest, optional :param x: Updated scatter plot. diff --git a/src/datadog_api_client/v1/model/scatterplot_data_projection_dimension.py b/src/datadog_api_client/v1/model/scatterplot_data_projection_dimension.py new file mode 100644 index 0000000000..0f015e62a4 --- /dev/null +++ b/src/datadog_api_client/v1/model/scatterplot_data_projection_dimension.py @@ -0,0 +1,71 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.scatterplot_dimension import ScatterplotDimension + from datadog_api_client.v1.model.widget_number_format import WidgetNumberFormat + + +class ScatterplotDataProjectionDimension(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.scatterplot_dimension import ScatterplotDimension + from datadog_api_client.v1.model.widget_number_format import WidgetNumberFormat + + return { + "alias": (str,), + "column": (str,), + "dimension": (ScatterplotDimension,), + "number_format": (WidgetNumberFormat,), + } + + attribute_map = { + "alias": "alias", + "column": "column", + "dimension": "dimension", + "number_format": "number_format", + } + + def __init__( + self_, + column: str, + dimension: ScatterplotDimension, + alias: Union[str, UnsetType] = unset, + number_format: Union[WidgetNumberFormat, UnsetType] = unset, + **kwargs, + ): + """ + A single dimension mapping for a scatterplot data projection. + + :param alias: Display alias for the dimension. + :type alias: str, optional + + :param column: The column name from the data source. + :type column: str + + :param dimension: Dimension of the Scatterplot. + :type dimension: ScatterplotDimension + + :param number_format: Number format options for the widget. + :type number_format: WidgetNumberFormat, optional + """ + if alias is not unset: + kwargs["alias"] = alias + if number_format is not unset: + kwargs["number_format"] = number_format + super().__init__(kwargs) + + self_.column = column + self_.dimension = dimension diff --git a/src/datadog_api_client/v1/model/scatterplot_data_projection_projection.py b/src/datadog_api_client/v1/model/scatterplot_data_projection_projection.py new file mode 100644 index 0000000000..5a0355b4d9 --- /dev/null +++ b/src/datadog_api_client/v1/model/scatterplot_data_projection_projection.py @@ -0,0 +1,57 @@ +# 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, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.scatterplot_data_projection_dimension import ScatterplotDataProjectionDimension + from datadog_api_client.v1.model.scatterplot_data_projection_projection_type import ( + ScatterplotDataProjectionProjectionType, + ) + + +class ScatterplotDataProjectionProjection(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.scatterplot_data_projection_dimension import ScatterplotDataProjectionDimension + from datadog_api_client.v1.model.scatterplot_data_projection_projection_type import ( + ScatterplotDataProjectionProjectionType, + ) + + return { + "dimensions": ([ScatterplotDataProjectionDimension],), + "type": (ScatterplotDataProjectionProjectionType,), + } + + attribute_map = { + "dimensions": "dimensions", + "type": "type", + } + + def __init__( + self_, + dimensions: List[ScatterplotDataProjectionDimension], + type: ScatterplotDataProjectionProjectionType, + **kwargs, + ): + """ + The projection configuration for a scatterplot data projection request. + + :param dimensions: Dimension mappings for the scatterplot axes. + :type dimensions: [ScatterplotDataProjectionDimension] + + :param type: The type of the scatterplot data projection. + :type type: ScatterplotDataProjectionProjectionType + """ + super().__init__(kwargs) + + self_.dimensions = dimensions + self_.type = type diff --git a/src/datadog_api_client/v1/model/scatterplot_data_projection_projection_type.py b/src/datadog_api_client/v1/model/scatterplot_data_projection_projection_type.py new file mode 100644 index 0000000000..3bb994b004 --- /dev/null +++ b/src/datadog_api_client/v1/model/scatterplot_data_projection_projection_type.py @@ -0,0 +1,35 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ScatterplotDataProjectionProjectionType(ModelSimple): + """ + The type of the scatterplot data projection. + + :param value: If omitted defaults to "scatterplot". Must be one of ["scatterplot"]. + :type value: str + """ + + allowed_values = { + "scatterplot", + } + SCATTERPLOT: ClassVar["ScatterplotDataProjectionProjectionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ScatterplotDataProjectionProjectionType.SCATTERPLOT = ScatterplotDataProjectionProjectionType("scatterplot") diff --git a/src/datadog_api_client/v1/model/scatterplot_data_projection_query.py b/src/datadog_api_client/v1/model/scatterplot_data_projection_query.py new file mode 100644 index 0000000000..3decaf019b --- /dev/null +++ b/src/datadog_api_client/v1/model/scatterplot_data_projection_query.py @@ -0,0 +1,77 @@ +# 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, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.formula_and_function_events_data_source import FormulaAndFunctionEventsDataSource + from datadog_api_client.v1.model.scatterplot_data_projection_query_storage import ( + ScatterplotDataProjectionQueryStorage, + ) + + +class ScatterplotDataProjectionQuery(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.formula_and_function_events_data_source import ( + FormulaAndFunctionEventsDataSource, + ) + from datadog_api_client.v1.model.scatterplot_data_projection_query_storage import ( + ScatterplotDataProjectionQueryStorage, + ) + + return { + "data_source": (FormulaAndFunctionEventsDataSource,), + "indexes": ([str],), + "query_string": (str,), + "storage": (ScatterplotDataProjectionQueryStorage,), + } + + attribute_map = { + "data_source": "data_source", + "indexes": "indexes", + "query_string": "query_string", + "storage": "storage", + } + + def __init__( + self_, + data_source: FormulaAndFunctionEventsDataSource, + query_string: str, + indexes: Union[List[str], UnsetType] = unset, + storage: Union[ScatterplotDataProjectionQueryStorage, UnsetType] = unset, + **kwargs, + ): + """ + The query for a scatterplot data projection request. + + :param data_source: Data source for event platform-based queries. + :type data_source: FormulaAndFunctionEventsDataSource + + :param indexes: Indexes to search. + :type indexes: [str], optional + + :param query_string: The search query string. + :type query_string: str + + :param storage: Storage tier to query. + :type storage: ScatterplotDataProjectionQueryStorage, optional + """ + if indexes is not unset: + kwargs["indexes"] = indexes + if storage is not unset: + kwargs["storage"] = storage + super().__init__(kwargs) + + self_.data_source = data_source + self_.query_string = query_string diff --git a/src/datadog_api_client/v1/model/scatterplot_data_projection_query_storage.py b/src/datadog_api_client/v1/model/scatterplot_data_projection_query_storage.py new file mode 100644 index 0000000000..2851089fd7 --- /dev/null +++ b/src/datadog_api_client/v1/model/scatterplot_data_projection_query_storage.py @@ -0,0 +1,56 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ScatterplotDataProjectionQueryStorage(ModelSimple): + """ + Storage tier to query. + + :param value: Must be one of ["live", "hot", "habanero", "online_archives", "driveline", "flex_tier", "case_insensitive", "cloud_prem"]. + :type value: str + """ + + allowed_values = { + "live", + "hot", + "habanero", + "online_archives", + "driveline", + "flex_tier", + "case_insensitive", + "cloud_prem", + } + LIVE: ClassVar["ScatterplotDataProjectionQueryStorage"] + HOT: ClassVar["ScatterplotDataProjectionQueryStorage"] + HABANERO: ClassVar["ScatterplotDataProjectionQueryStorage"] + ONLINE_ARCHIVES: ClassVar["ScatterplotDataProjectionQueryStorage"] + DRIVELINE: ClassVar["ScatterplotDataProjectionQueryStorage"] + FLEX_TIER: ClassVar["ScatterplotDataProjectionQueryStorage"] + CASE_INSENSITIVE: ClassVar["ScatterplotDataProjectionQueryStorage"] + CLOUD_PREM: ClassVar["ScatterplotDataProjectionQueryStorage"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ScatterplotDataProjectionQueryStorage.LIVE = ScatterplotDataProjectionQueryStorage("live") +ScatterplotDataProjectionQueryStorage.HOT = ScatterplotDataProjectionQueryStorage("hot") +ScatterplotDataProjectionQueryStorage.HABANERO = ScatterplotDataProjectionQueryStorage("habanero") +ScatterplotDataProjectionQueryStorage.ONLINE_ARCHIVES = ScatterplotDataProjectionQueryStorage("online_archives") +ScatterplotDataProjectionQueryStorage.DRIVELINE = ScatterplotDataProjectionQueryStorage("driveline") +ScatterplotDataProjectionQueryStorage.FLEX_TIER = ScatterplotDataProjectionQueryStorage("flex_tier") +ScatterplotDataProjectionQueryStorage.CASE_INSENSITIVE = ScatterplotDataProjectionQueryStorage("case_insensitive") +ScatterplotDataProjectionQueryStorage.CLOUD_PREM = ScatterplotDataProjectionQueryStorage("cloud_prem") diff --git a/src/datadog_api_client/v1/model/scatterplot_table_request.py b/src/datadog_api_client/v1/model/scatterplot_table_request.py index 7dd99a5a9e..4c8fcac83a 100644 --- a/src/datadog_api_client/v1/model/scatterplot_table_request.py +++ b/src/datadog_api_client/v1/model/scatterplot_table_request.py @@ -15,7 +15,10 @@ if TYPE_CHECKING: from datadog_api_client.v1.model.scatterplot_widget_formula import ScatterplotWidgetFormula + from datadog_api_client.v1.model.scatterplot_data_projection_projection import ScatterplotDataProjectionProjection from datadog_api_client.v1.model.formula_and_function_query_definition import FormulaAndFunctionQueryDefinition + from datadog_api_client.v1.model.scatterplot_data_projection_query import ScatterplotDataProjectionQuery + from datadog_api_client.v1.model.scatterplot_table_request_type import ScatterplotTableRequestType from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat from datadog_api_client.v1.model.formula_and_function_metric_query_definition import ( FormulaAndFunctionMetricQueryDefinition, @@ -47,24 +50,39 @@ class ScatterplotTableRequest(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v1.model.scatterplot_widget_formula import ScatterplotWidgetFormula + from datadog_api_client.v1.model.scatterplot_data_projection_projection import ( + ScatterplotDataProjectionProjection, + ) from datadog_api_client.v1.model.formula_and_function_query_definition import FormulaAndFunctionQueryDefinition + from datadog_api_client.v1.model.scatterplot_data_projection_query import ScatterplotDataProjectionQuery + from datadog_api_client.v1.model.scatterplot_table_request_type import ScatterplotTableRequestType from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat return { "formulas": ([ScatterplotWidgetFormula],), + "limit": (int,), + "projection": (ScatterplotDataProjectionProjection,), "queries": ([FormulaAndFunctionQueryDefinition],), + "query": (ScatterplotDataProjectionQuery,), + "request_type": (ScatterplotTableRequestType,), "response_format": (FormulaAndFunctionResponseFormat,), } attribute_map = { "formulas": "formulas", + "limit": "limit", + "projection": "projection", "queries": "queries", + "query": "query", + "request_type": "request_type", "response_format": "response_format", } def __init__( self_, formulas: Union[List[ScatterplotWidgetFormula], UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + projection: Union[ScatterplotDataProjectionProjection, UnsetType] = unset, queries: Union[ List[ Union[ @@ -81,25 +99,50 @@ def __init__( ], UnsetType, ] = unset, + query: Union[ScatterplotDataProjectionQuery, UnsetType] = unset, + request_type: Union[ScatterplotTableRequestType, UnsetType] = unset, response_format: Union[FormulaAndFunctionResponseFormat, UnsetType] = unset, **kwargs, ): """ - Scatterplot request containing formulas and functions. + Scatterplot table request. Supports two modes: + + * **Formulas and functions** (default): ``request_type`` is absent or ``"table"``. Uses ``queries`` and ``formulas``. + * **Data projection** : ``request_type`` is ``"data_projection"``. Uses ``query`` , ``projection`` , and optionally ``limit``. :param formulas: List of Scatterplot formulas that operate on queries. :type formulas: [ScatterplotWidgetFormula], optional + :param limit: Maximum number of rows to return. Used when ``request_type`` is ``"data_projection"``. + :type limit: int, optional + + :param projection: The projection configuration for a scatterplot data projection request. + :type projection: ScatterplotDataProjectionProjection, optional + :param queries: List of queries that can be returned directly or used in formulas. :type queries: [FormulaAndFunctionQueryDefinition], optional + :param query: The query for a scatterplot data projection request. + :type query: ScatterplotDataProjectionQuery, optional + + :param request_type: The type of the scatterplot table request. + :type request_type: ScatterplotTableRequestType, optional + :param response_format: Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets. :type response_format: FormulaAndFunctionResponseFormat, optional """ if formulas is not unset: kwargs["formulas"] = formulas + if limit is not unset: + kwargs["limit"] = limit + if projection is not unset: + kwargs["projection"] = projection if queries is not unset: kwargs["queries"] = queries + if query is not unset: + kwargs["query"] = query + if request_type is not unset: + kwargs["request_type"] = request_type if response_format is not unset: kwargs["response_format"] = response_format super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/scatterplot_table_request_type.py b/src/datadog_api_client/v1/model/scatterplot_table_request_type.py new file mode 100644 index 0000000000..e82fdd38cd --- /dev/null +++ b/src/datadog_api_client/v1/model/scatterplot_table_request_type.py @@ -0,0 +1,38 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ScatterplotTableRequestType(ModelSimple): + """ + The type of the scatterplot table request. + + :param value: Must be one of ["table", "data_projection"]. + :type value: str + """ + + allowed_values = { + "table", + "data_projection", + } + TABLE: ClassVar["ScatterplotTableRequestType"] + DATA_PROJECTION: ClassVar["ScatterplotTableRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ScatterplotTableRequestType.TABLE = ScatterplotTableRequestType("table") +ScatterplotTableRequestType.DATA_PROJECTION = ScatterplotTableRequestType("data_projection") diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index c11b4ad69a..6976304a78 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -706,8 +706,16 @@ from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition from datadog_api_client.v1.model.scatter_plot_widget_definition_requests import ScatterPlotWidgetDefinitionRequests from datadog_api_client.v1.model.scatter_plot_widget_definition_type import ScatterPlotWidgetDefinitionType +from datadog_api_client.v1.model.scatterplot_data_projection_dimension import ScatterplotDataProjectionDimension +from datadog_api_client.v1.model.scatterplot_data_projection_projection import ScatterplotDataProjectionProjection +from datadog_api_client.v1.model.scatterplot_data_projection_projection_type import ( + ScatterplotDataProjectionProjectionType, +) +from datadog_api_client.v1.model.scatterplot_data_projection_query import ScatterplotDataProjectionQuery +from datadog_api_client.v1.model.scatterplot_data_projection_query_storage import ScatterplotDataProjectionQueryStorage from datadog_api_client.v1.model.scatterplot_dimension import ScatterplotDimension from datadog_api_client.v1.model.scatterplot_table_request import ScatterplotTableRequest +from datadog_api_client.v1.model.scatterplot_table_request_type import ScatterplotTableRequestType from datadog_api_client.v1.model.scatterplot_widget_aggregator import ScatterplotWidgetAggregator from datadog_api_client.v1.model.scatterplot_widget_formula import ScatterplotWidgetFormula from datadog_api_client.v1.model.search_slo_query import SearchSLOQuery @@ -1834,8 +1842,14 @@ "ScatterPlotWidgetDefinition", "ScatterPlotWidgetDefinitionRequests", "ScatterPlotWidgetDefinitionType", + "ScatterplotDataProjectionDimension", + "ScatterplotDataProjectionProjection", + "ScatterplotDataProjectionProjectionType", + "ScatterplotDataProjectionQuery", + "ScatterplotDataProjectionQueryStorage", "ScatterplotDimension", "ScatterplotTableRequest", + "ScatterplotTableRequestType", "ScatterplotWidgetAggregator", "ScatterplotWidgetFormula", "SearchSLOQuery", diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_scatterplot_widget.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_scatterplot_widget.frozen index 2f263e05b5..f981265341 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_scatterplot_widget.frozen +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_scatterplot_widget.frozen @@ -1 +1 @@ -2024-11-15T19:32:52.260Z \ No newline at end of file +2026-04-14T13:48:27.274Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_scatterplot_widget.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_scatterplot_widget.yaml index 7221d88ae3..dc416f612d 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_scatterplot_widget.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_scatterplot_widget.yaml @@ -1,8 +1,9 @@ interactions: - request: - body: '{"description":"","layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_scatterplot_widget-1731699172","widgets":[{"definition":{"color_by_groups":[],"requests":{"table":{"formulas":[{"alias":"","dimension":"x","formula":"query1"},{"alias":"","dimension":"y","formula":"query2"}],"queries":[{"aggregator":"avg","data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} + body: '{"description":"","layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_scatterplot_widget-1776174507","widgets":[{"definition":{"color_by_groups":[],"requests":{"table":{"formulas":[{"alias":"","dimension":"x","formula":"query1"},{"alias":"","dimension":"y","formula":"query2"}],"queries":[{"aggregator":"avg","data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} by {service}"},{"aggregator":"avg","data_source":"metrics","name":"query2","query":"avg:system.mem.used{*} - by {service}"}],"response_format":"scalar"}},"time":{},"title":"","title_align":"left","title_size":"16","type":"scatterplot","xaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"},"yaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"}},"layout":{"height":15,"width":47,"x":0,"y":0}}]}' + by {service}"}],"response_format":"scalar"}},"time":{},"title":"","title_align":"left","title_size":"16","type":"scatterplot","xaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"},"yaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"}},"layout":{"height":15,"width":47,"x":0,"y":0}},{"definition":{"requests":{"table":{"limit":200,"projection":{"dimensions":[{"column":"duration","dimension":"x"},{"column":"@resource_name","dimension":"y"}],"type":"scatterplot"},"query":{"data_source":"spans","query_string":"@service:web-store"},"request_type":"data_projection"}},"title":"Data + Projection Scatterplot","title_align":"left","title_size":"16","type":"scatterplot","xaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"},"yaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"}},"layout":{"height":15,"width":47,"x":48,"y":0}}]}' headers: accept: - application/json @@ -12,11 +13,11 @@ interactions: uri: https://api.datadoghq.com/api/v1/dashboard response: body: - string: '{"id":"s39-kcu-kcv","title":"Test-Create_a_new_dashboard_with_scatterplot_widget-1731699172","description":"","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"free","url":"/dashboard/s39-kcu-kcv/test-createanewdashboardwithscatterplotwidget-1731699172","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"color_by_groups":[],"requests":{"table":{"formulas":[{"alias":"","dimension":"x","formula":"query1"},{"alias":"","dimension":"y","formula":"query2"}],"queries":[{"aggregator":"avg","data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} + string: '{"id":"zdc-f9y-htv","title":"Test-Create_a_new_dashboard_with_scatterplot_widget-1776174507","description":"","author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"free","url":"/dashboard/zdc-f9y-htv/test-createanewdashboardwithscatterplotwidget-1776174507","template_variables":[],"widgets":[{"definition":{"color_by_groups":[],"requests":{"table":{"formulas":[{"alias":"","dimension":"x","formula":"query1"},{"alias":"","dimension":"y","formula":"query2"}],"queries":[{"aggregator":"avg","data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} by {service}"},{"aggregator":"avg","data_source":"metrics","name":"query2","query":"avg:system.mem.used{*} - by {service}"}],"response_format":"scalar"}},"time":{},"title":"","title_align":"left","title_size":"16","type":"scatterplot","xaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"},"yaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"}},"layout":{"height":15,"width":47,"x":0,"y":0},"id":6421549335837738}],"notify_list":[],"created_at":"2024-11-15T19:32:52.488297+00:00","modified_at":"2024-11-15T19:32:52.488297+00:00","restricted_roles":[]} - - ' + by {service}"}],"response_format":"scalar"}},"time":{},"title":"","title_align":"left","title_size":"16","type":"scatterplot","xaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"},"yaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"}},"layout":{"height":15,"width":47,"x":0,"y":0},"id":6156355834526034},{"definition":{"requests":{"table":{"limit":200,"projection":{"dimensions":[{"column":"duration","dimension":"x"},{"column":"@resource_name","dimension":"y"}],"type":"scatterplot"},"query":{"data_source":"spans","query_string":"@service:web-store"},"request_type":"data_projection"}},"title":"Data + Projection Scatterplot","title_align":"left","title_size":"16","type":"scatterplot","xaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"},"yaxis":{"include_zero":true,"max":"auto","min":"auto","scale":"linear"}},"layout":{"height":15,"width":47,"x":48,"y":0},"id":1138848396119898}],"notify_list":[],"created_at":"2026-04-14T13:48:27.576450+00:00","modified_at":"2026-04-14T13:48:27.576450+00:00","restricted_roles":[]}' headers: content-type: - application/json @@ -29,12 +30,10 @@ interactions: accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/s39-kcu-kcv + uri: https://api.datadoghq.com/api/v1/dashboard/zdc-f9y-htv response: body: - string: '{"deleted_dashboard_id":"s39-kcu-kcv"} - - ' + string: '{"deleted_dashboard_id":"zdc-f9y-htv"}' headers: content-type: - application/json diff --git a/tests/v1/features/dashboards.feature b/tests/v1/features/dashboards.feature index 2541faab2d..2707ceb720 100644 --- a/tests/v1/features/dashboards.feature +++ b/tests/v1/features/dashboards.feature @@ -859,6 +859,13 @@ Feature: Dashboards When the request is sent Then the response status is 200 OK And the response "widgets[0].definition.type" is equal to "scatterplot" + And the response "widgets[1].definition.type" is equal to "scatterplot" + And the response "widgets[1].definition.requests.table.request_type" is equal to "data_projection" + And the response "widgets[1].definition.requests.table.query.data_source" is equal to "spans" + And the response "widgets[1].definition.requests.table.query.query_string" is equal to "@service:web-store" + And the response "widgets[1].definition.requests.table.projection.type" is equal to "scatterplot" + And the response "widgets[1].definition.requests.table.projection.dimensions" has length 2 + And the response "widgets[1].definition.requests.table.limit" is equal to 200 @team:DataDog/dashboards-backend Scenario: Create a new dashboard with servicemap widget diff --git a/tests/v1/features/dashboards_json_payload/scatterplot_widget.json b/tests/v1/features/dashboards_json_payload/scatterplot_widget.json index 65bcc2ff3c..ea11963333 100644 --- a/tests/v1/features/dashboards_json_payload/scatterplot_widget.json +++ b/tests/v1/features/dashboards_json_payload/scatterplot_widget.json @@ -64,6 +64,55 @@ ] } + }, + { + "layout":{ + "x":48, + "y":0, + "width":47, + "height":15 + }, + "definition":{ + "title":"Data Projection Scatterplot", + "title_size":"16", + "title_align":"left", + "type":"scatterplot", + "requests":{ + "table":{ + "request_type":"data_projection", + "query":{ + "query_string":"@service:web-store", + "data_source":"spans" + }, + "projection":{ + "type":"scatterplot", + "dimensions":[ + { + "column":"duration", + "dimension":"x" + }, + { + "column":"@resource_name", + "dimension":"y" + } + ] + }, + "limit":200 + } + }, + "xaxis":{ + "scale":"linear", + "include_zero":true, + "min":"auto", + "max":"auto" + }, + "yaxis":{ + "scale":"linear", + "include_zero":true, + "min":"auto", + "max":"auto" + } + } } ], "template_variables":[