Skip to content
Open
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
110 changes: 109 additions & 1 deletion .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
42 changes: 42 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------------------------------------------

Expand All @@ -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
--------------------------------------------------------------------

Expand Down
57 changes: 57 additions & 0 deletions examples/v1/dashboards/CreateDashboard_2342457693.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading