From f37fbc96990cab625ce9178ccb732da846f2899e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 15 Sep 2023 14:40:01 +0000 Subject: [PATCH] Regenerate client from commit dfa5ada6 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 175 +++++++++++++++++- docs/datadog_api_client.v1.model.rst | 63 +++++++ .../dashboards/CreateDashboard_2278756614.py | 125 +++++++++++++ .../v1/model/split_config.py | 86 +++++++++ .../v1/model/split_config_sort_compute.py | 39 ++++ .../v1/model/split_dimension.py | 33 ++++ .../split_graph_source_widget_definition.py | 144 ++++++++++++++ .../v1/model/split_graph_viz_size.py | 44 +++++ .../v1/model/split_graph_widget_definition.py | 119 ++++++++++++ .../split_graph_widget_definition_type.py | 35 ++++ src/datadog_api_client/v1/model/split_sort.py | 51 +++++ .../v1/model/split_vector_entry_item.py | 46 +++++ src/datadog_api_client/v1/model/widget.py | 22 ++- .../v1/model/widget_definition.py | 40 ++-- src/datadog_api_client/v1/models/__init__.py | 18 ++ ...w_dashboard_with_split_graph_widget.frozen | 1 + ...new_dashboard_with_split_graph_widget.yaml | 40 ++++ tests/v1/features/dashboards.feature | 15 ++ .../split_graph_widget.json | 49 +++++ 20 files changed, 1121 insertions(+), 32 deletions(-) create mode 100644 examples/v1/dashboards/CreateDashboard_2278756614.py create mode 100644 src/datadog_api_client/v1/model/split_config.py create mode 100644 src/datadog_api_client/v1/model/split_config_sort_compute.py create mode 100644 src/datadog_api_client/v1/model/split_dimension.py create mode 100644 src/datadog_api_client/v1/model/split_graph_source_widget_definition.py create mode 100644 src/datadog_api_client/v1/model/split_graph_viz_size.py create mode 100644 src/datadog_api_client/v1/model/split_graph_widget_definition.py create mode 100644 src/datadog_api_client/v1/model/split_graph_widget_definition_type.py create mode 100644 src/datadog_api_client/v1/model/split_sort.py create mode 100644 src/datadog_api_client/v1/model/split_vector_entry_item.py create mode 100644 tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_split_graph_widget.frozen create mode 100644 tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_split_graph_widget.yaml create mode 100644 tests/v1/features/dashboards_json_payload/split_graph_widget.json diff --git a/.apigentools-info b/.apigentools-info index 970ff0b75a..d6c409d31d 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.5", - "regenerated": "2023-09-14 14:35:30.424386", - "spec_repo_commit": "1d834ec1" + "regenerated": "2023-09-15 14:38:34.839281", + "spec_repo_commit": "dfa5ada6" }, "v2": { "apigentools_version": "1.6.5", - "regenerated": "2023-09-14 14:35:30.441566", - "spec_repo_commit": "1d834ec1" + "regenerated": "2023-09-15 14:38:34.866653", + "spec_repo_commit": "dfa5ada6" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index e67fc9b601..c88d93176f 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -12058,6 +12058,170 @@ components: items: $ref: '#/components/schemas/SlackIntegrationChannel' type: array + SplitConfig: + description: Encapsulates all user choices about how to split a graph. + properties: + limit: + description: Maximum number of graphs to display in the widget. + example: 24 + format: int64 + maximum: 100 + minimum: 1 + type: integer + sort: + $ref: '#/components/schemas/SplitSort' + split_dimensions: + description: The dimension(s) on which to split the graph + items: + $ref: '#/components/schemas/SplitDimension' + maxItems: 1 + minItems: 1 + type: array + static_splits: + description: Manual selection of tags making split graph widget static + items: + $ref: '#/components/schemas/SplitVectorEntry' + maxItems: 100 + type: array + required: + - split_dimensions + - limit + - sort + type: object + SplitConfigSortCompute: + description: Defines the metric and aggregation used as the sort value. + properties: + aggregation: + description: The metric to use for sorting graphs. + example: sum + type: string + metric: + description: How to aggregate the sort metric for the purposes of ordering. + example: system.cpu.user + type: string + required: + - aggregation + - metric + type: object + SplitDimension: + description: The property by which the graph splits + example: + one_graph_per: service + properties: + one_graph_per: + description: The system interprets this attribute differently depending + on the data source of the query being split. For metrics, it's a tag. + For the events platform, it's an attribute or tag. + example: service + type: string + required: + - one_graph_per + type: object + SplitGraphSourceWidgetDefinition: + description: The original widget we are splitting on. + oneOf: + - $ref: '#/components/schemas/ChangeWidgetDefinition' + - $ref: '#/components/schemas/GeomapWidgetDefinition' + - $ref: '#/components/schemas/QueryValueWidgetDefinition' + - $ref: '#/components/schemas/ScatterPlotWidgetDefinition' + - $ref: '#/components/schemas/SunburstWidgetDefinition' + - $ref: '#/components/schemas/TableWidgetDefinition' + - $ref: '#/components/schemas/TimeseriesWidgetDefinition' + - $ref: '#/components/schemas/ToplistWidgetDefinition' + - $ref: '#/components/schemas/TreeMapWidgetDefinition' + SplitGraphVizSize: + description: Size of the individual graphs in the split. + enum: + - xs + - sm + - md + - lg + example: sm + type: string + x-enum-varnames: + - XS + - SM + - MD + - LG + SplitGraphWidgetDefinition: + description: 'The split graph widget allows you to create repeating units of + a graph - one for each value in a group (for example: one per service) + + ' + properties: + has_uniform_y_axes: + description: Normalize y axes across graphs + type: boolean + size: + $ref: '#/components/schemas/SplitGraphVizSize' + source_widget_definition: + $ref: '#/components/schemas/SplitGraphSourceWidgetDefinition' + split_config: + $ref: '#/components/schemas/SplitConfig' + time: + $ref: '#/components/schemas/WidgetTime' + title: + description: Title of your widget. + type: string + type: + $ref: '#/components/schemas/SplitGraphWidgetDefinitionType' + required: + - size + - type + - source_widget_definition + - split_config + type: object + SplitGraphWidgetDefinitionType: + default: split_group + description: Type of the split graph widget + enum: + - split_group + example: split_group + type: string + x-enum-varnames: + - SPLIT_GROUP + SplitSort: + description: Controls the order in which graphs appear in the split. + properties: + compute: + $ref: '#/components/schemas/SplitConfigSortCompute' + order: + $ref: '#/components/schemas/WidgetSort' + required: + - order + type: object + SplitVectorEntry: + description: The widget displays one graph for each entry in this parameter. + example: + - tag_key: demo + tag_values: + - env + items: + $ref: '#/components/schemas/SplitVectorEntryItem' + minItems: 1 + type: array + SplitVectorEntryItem: + description: The split graph list contains a graph for each value of the split + dimension. + minLength: 1 + properties: + tag_key: + description: The tag key. + example: demo + minLength: 1 + type: string + tag_values: + description: The tag values. + example: + - env + items: + minLength: 1 + type: string + type: array + required: + - tag_key + - tag_values + type: object SuccessfulSignalUpdateResponse: description: Updated signal data following a successfully performed update. properties: @@ -19540,30 +19704,31 @@ components: - $ref: '#/components/schemas/EventStreamWidgetDefinition' - $ref: '#/components/schemas/EventTimelineWidgetDefinition' - $ref: '#/components/schemas/FreeTextWidgetDefinition' + - $ref: '#/components/schemas/FunnelWidgetDefinition' - $ref: '#/components/schemas/GeomapWidgetDefinition' - $ref: '#/components/schemas/GroupWidgetDefinition' - $ref: '#/components/schemas/HeatMapWidgetDefinition' - $ref: '#/components/schemas/HostMapWidgetDefinition' - $ref: '#/components/schemas/IFrameWidgetDefinition' - $ref: '#/components/schemas/ImageWidgetDefinition' + - $ref: '#/components/schemas/ListStreamWidgetDefinition' - $ref: '#/components/schemas/LogStreamWidgetDefinition' - $ref: '#/components/schemas/MonitorSummaryWidgetDefinition' - $ref: '#/components/schemas/NoteWidgetDefinition' - $ref: '#/components/schemas/QueryValueWidgetDefinition' - $ref: '#/components/schemas/RunWorkflowWidgetDefinition' - - $ref: '#/components/schemas/ScatterPlotWidgetDefinition' - - $ref: '#/components/schemas/SLOWidgetDefinition' - $ref: '#/components/schemas/SLOListWidgetDefinition' + - $ref: '#/components/schemas/SLOWidgetDefinition' + - $ref: '#/components/schemas/ScatterPlotWidgetDefinition' - $ref: '#/components/schemas/ServiceMapWidgetDefinition' - $ref: '#/components/schemas/ServiceSummaryWidgetDefinition' + - $ref: '#/components/schemas/SplitGraphWidgetDefinition' - $ref: '#/components/schemas/SunburstWidgetDefinition' - $ref: '#/components/schemas/TableWidgetDefinition' - $ref: '#/components/schemas/TimeseriesWidgetDefinition' - $ref: '#/components/schemas/ToplistWidgetDefinition' - - $ref: '#/components/schemas/TreeMapWidgetDefinition' - - $ref: '#/components/schemas/ListStreamWidgetDefinition' - - $ref: '#/components/schemas/FunnelWidgetDefinition' - $ref: '#/components/schemas/TopologyMapWidgetDefinition' + - $ref: '#/components/schemas/TreeMapWidgetDefinition' WidgetDisplayType: description: Type of display to use for the request. enum: diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index df40aa2a00..f8ef4650ac 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -3452,6 +3452,69 @@ slo\_widget\_definition\_type :members: :show-inheritance: +split\_config +------------- + +.. automodule:: datadog_api_client.v1.model.split_config + :members: + :show-inheritance: + +split\_config\_sort\_compute +---------------------------- + +.. automodule:: datadog_api_client.v1.model.split_config_sort_compute + :members: + :show-inheritance: + +split\_dimension +---------------- + +.. automodule:: datadog_api_client.v1.model.split_dimension + :members: + :show-inheritance: + +split\_graph\_source\_widget\_definition +---------------------------------------- + +.. automodule:: datadog_api_client.v1.model.split_graph_source_widget_definition + :members: + :show-inheritance: + +split\_graph\_viz\_size +----------------------- + +.. automodule:: datadog_api_client.v1.model.split_graph_viz_size + :members: + :show-inheritance: + +split\_graph\_widget\_definition +-------------------------------- + +.. automodule:: datadog_api_client.v1.model.split_graph_widget_definition + :members: + :show-inheritance: + +split\_graph\_widget\_definition\_type +-------------------------------------- + +.. automodule:: datadog_api_client.v1.model.split_graph_widget_definition_type + :members: + :show-inheritance: + +split\_sort +----------- + +.. automodule:: datadog_api_client.v1.model.split_sort + :members: + :show-inheritance: + +split\_vector\_entry\_item +-------------------------- + +.. automodule:: datadog_api_client.v1.model.split_vector_entry_item + :members: + :show-inheritance: + successful\_signal\_update\_response ------------------------------------ diff --git a/examples/v1/dashboards/CreateDashboard_2278756614.py b/examples/v1/dashboards/CreateDashboard_2278756614.py new file mode 100644 index 0000000000..9c2fe7e65b --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2278756614.py @@ -0,0 +1,125 @@ +""" +Create a new dashboard with split graph widget +""" + +from datadog_api_client import ApiClient, Configuration +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_metric_data_source import FormulaAndFunctionMetricDataSource +from datadog_api_client.v1.model.formula_and_function_metric_query_definition import ( + FormulaAndFunctionMetricQueryDefinition, +) +from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat +from datadog_api_client.v1.model.split_config import SplitConfig +from datadog_api_client.v1.model.split_config_sort_compute import SplitConfigSortCompute +from datadog_api_client.v1.model.split_dimension import SplitDimension +from datadog_api_client.v1.model.split_graph_viz_size import SplitGraphVizSize +from datadog_api_client.v1.model.split_graph_widget_definition import SplitGraphWidgetDefinition +from datadog_api_client.v1.model.split_graph_widget_definition_type import SplitGraphWidgetDefinitionType +from datadog_api_client.v1.model.split_sort import SplitSort +from datadog_api_client.v1.model.split_vector_entry_item import SplitVectorEntryItem +from datadog_api_client.v1.model.timeseries_widget_definition import TimeseriesWidgetDefinition +from datadog_api_client.v1.model.timeseries_widget_definition_type import TimeseriesWidgetDefinitionType +from datadog_api_client.v1.model.timeseries_widget_request import TimeseriesWidgetRequest +from datadog_api_client.v1.model.widget import Widget +from datadog_api_client.v1.model.widget_display_type import WidgetDisplayType +from datadog_api_client.v1.model.widget_layout import WidgetLayout +from datadog_api_client.v1.model.widget_line_type import WidgetLineType +from datadog_api_client.v1.model.widget_line_width import WidgetLineWidth +from datadog_api_client.v1.model.widget_request_style import WidgetRequestStyle +from datadog_api_client.v1.model.widget_sort import WidgetSort +from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign + +body = Dashboard( + title="Example-Dashboard", + description="", + widgets=[ + Widget( + layout=WidgetLayout( + x=0, + y=0, + width=12, + height=8, + ), + definition=SplitGraphWidgetDefinition( + title="", + type=SplitGraphWidgetDefinitionType.SPLIT_GROUP, + source_widget_definition=TimeseriesWidgetDefinition( + title="", + title_size="16", + title_align=WidgetTextAlign.LEFT, + type=TimeseriesWidgetDefinitionType.TIMESERIES, + requests=[ + TimeseriesWidgetRequest( + response_format=FormulaAndFunctionResponseFormat.TIMESERIES, + queries=[ + FormulaAndFunctionMetricQueryDefinition( + name="query1", + data_source=FormulaAndFunctionMetricDataSource.METRICS, + query="avg:system.cpu.user{*}", + ), + ], + style=WidgetRequestStyle( + palette="dog_classic", + line_type=WidgetLineType.SOLID, + line_width=WidgetLineWidth.NORMAL, + ), + display_type=WidgetDisplayType.LINE, + ), + ], + ), + split_config=SplitConfig( + split_dimensions=[ + SplitDimension( + one_graph_per="service", + ), + ], + limit=24, + sort=SplitSort( + compute=SplitConfigSortCompute( + aggregation="sum", + metric="system.cpu.user", + ), + order=WidgetSort.DESCENDING, + ), + static_splits=[ + [ + SplitVectorEntryItem( + tag_key="service", + tag_values=[ + "cassandra", + ], + ), + SplitVectorEntryItem( + tag_key="datacenter", + tag_values=[], + ), + ], + [ + SplitVectorEntryItem( + tag_key="demo", + tag_values=[ + "env", + ], + ), + ], + ], + ), + size=SplitGraphVizSize.MD, + has_uniform_y_axes=True, + ), + ), + ], + template_variables=[], + layout_type=DashboardLayoutType.ORDERED, + is_read_only=False, + notify_list=[], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = DashboardsApi(api_client) + response = api_instance.create_dashboard(body=body) + + print(response) diff --git a/src/datadog_api_client/v1/model/split_config.py b/src/datadog_api_client/v1/model/split_config.py new file mode 100644 index 0000000000..30a0ed10ac --- /dev/null +++ b/src/datadog_api_client/v1/model/split_config.py @@ -0,0 +1,86 @@ +# 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.split_sort import SplitSort + from datadog_api_client.v1.model.split_dimension import SplitDimension + from datadog_api_client.v1.model.split_vector_entry_item import SplitVectorEntryItem + + +class SplitConfig(ModelNormal): + validations = { + "limit": { + "inclusive_maximum": 100, + "inclusive_minimum": 1, + }, + "split_dimensions": { + "max_items": 1, + "min_items": 1, + }, + "static_splits": { + "max_items": 100, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.split_sort import SplitSort + from datadog_api_client.v1.model.split_dimension import SplitDimension + from datadog_api_client.v1.model.split_vector_entry_item import SplitVectorEntryItem + + return { + "limit": (int,), + "sort": (SplitSort,), + "split_dimensions": ([SplitDimension],), + "static_splits": ([[SplitVectorEntryItem]],), + } + + attribute_map = { + "limit": "limit", + "sort": "sort", + "split_dimensions": "split_dimensions", + "static_splits": "static_splits", + } + + def __init__( + self_, + limit: int, + sort: SplitSort, + split_dimensions: List[SplitDimension], + static_splits: Union[List[List[SplitVectorEntryItem]], UnsetType] = unset, + **kwargs, + ): + """ + Encapsulates all user choices about how to split a graph. + + :param limit: Maximum number of graphs to display in the widget. + :type limit: int + + :param sort: Controls the order in which graphs appear in the split. + :type sort: SplitSort + + :param split_dimensions: The dimension(s) on which to split the graph + :type split_dimensions: [SplitDimension] + + :param static_splits: Manual selection of tags making split graph widget static + :type static_splits: [[SplitVectorEntryItem]], optional + """ + if static_splits is not unset: + kwargs["static_splits"] = static_splits + super().__init__(kwargs) + + self_.limit = limit + self_.sort = sort + self_.split_dimensions = split_dimensions diff --git a/src/datadog_api_client/v1/model/split_config_sort_compute.py b/src/datadog_api_client/v1/model/split_config_sort_compute.py new file mode 100644 index 0000000000..7c19ded148 --- /dev/null +++ b/src/datadog_api_client/v1/model/split_config_sort_compute.py @@ -0,0 +1,39 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class SplitConfigSortCompute(ModelNormal): + @cached_property + def openapi_types(_): + return { + "aggregation": (str,), + "metric": (str,), + } + + attribute_map = { + "aggregation": "aggregation", + "metric": "metric", + } + + def __init__(self_, aggregation: str, metric: str, **kwargs): + """ + Defines the metric and aggregation used as the sort value. + + :param aggregation: The metric to use for sorting graphs. + :type aggregation: str + + :param metric: How to aggregate the sort metric for the purposes of ordering. + :type metric: str + """ + super().__init__(kwargs) + + self_.aggregation = aggregation + self_.metric = metric diff --git a/src/datadog_api_client/v1/model/split_dimension.py b/src/datadog_api_client/v1/model/split_dimension.py new file mode 100644 index 0000000000..88b1061b78 --- /dev/null +++ b/src/datadog_api_client/v1/model/split_dimension.py @@ -0,0 +1,33 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class SplitDimension(ModelNormal): + @cached_property + def openapi_types(_): + return { + "one_graph_per": (str,), + } + + attribute_map = { + "one_graph_per": "one_graph_per", + } + + def __init__(self_, one_graph_per: str, **kwargs): + """ + The property by which the graph splits + + :param one_graph_per: The system interprets this attribute differently depending on the data source of the query being split. For metrics, it's a tag. For the events platform, it's an attribute or tag. + :type one_graph_per: str + """ + super().__init__(kwargs) + + self_.one_graph_per = one_graph_per diff --git a/src/datadog_api_client/v1/model/split_graph_source_widget_definition.py b/src/datadog_api_client/v1/model/split_graph_source_widget_definition.py new file mode 100644 index 0000000000..531a31e2df --- /dev/null +++ b/src/datadog_api_client/v1/model/split_graph_source_widget_definition.py @@ -0,0 +1,144 @@ +# 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 ( + ModelComposed, + cached_property, +) + + +class SplitGraphSourceWidgetDefinition(ModelComposed): + def __init__(self, **kwargs): + """ + The original widget we are splitting on. + + :param custom_links: List of custom links. + :type custom_links: [WidgetCustomLink], optional + + :param requests: Array of one request object to display in the widget. + + See the dedicated [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json) + to learn how to build the `REQUEST_SCHEMA`. + :type requests: [ChangeWidgetRequest] + + :param time: Time setting for the widget. + :type time: WidgetTime, optional + + :param title: Title of the widget. + :type title: str, optional + + :param title_align: How to align the text on the widget. + :type title_align: WidgetTextAlign, optional + + :param title_size: Size of the title. + :type title_size: str, optional + + :param type: Type of the change widget. + :type type: ChangeWidgetDefinitionType + + :param style: The style to apply to the widget. + :type style: GeomapWidgetDefinitionStyle + + :param view: The view of the world that the map should render. + :type view: GeomapWidgetDefinitionView + + :param autoscale: Whether to use auto-scaling or not. + :type autoscale: bool, optional + + :param custom_unit: Display a unit of your choice on the widget. + :type custom_unit: str, optional + + :param precision: Number of decimals to show. If not defined, the widget uses the raw value. + :type precision: int, optional + + :param text_align: How to align the text on the widget. + :type text_align: WidgetTextAlign, optional + + :param timeseries_background: Set a timeseries on the widget background. + :type timeseries_background: TimeseriesBackground, optional + + :param color_by_groups: List of groups used for colors. + :type color_by_groups: [str], optional + + :param xaxis: Axis controls for the widget. + :type xaxis: WidgetAxis, optional + + :param yaxis: Axis controls for the widget. + :type yaxis: WidgetAxis, optional + + :param hide_total: Show the total value in this widget. + :type hide_total: bool, optional + + :param legend: Configuration of the legend. + :type legend: SunburstWidgetLegend, optional + + :param has_search_bar: Controls the display of the search bar. + :type has_search_bar: TableWidgetHasSearchBar, optional + + :param events: List of widget events. + :type events: [WidgetEvent], optional + + :param legend_columns: Columns displayed in the legend. + :type legend_columns: [TimeseriesWidgetLegendColumn], optional + + :param legend_layout: Layout of the legend. + :type legend_layout: TimeseriesWidgetLegendLayout, optional + + :param legend_size: Available legend sizes for a widget. Should be one of "0", "2", "4", "8", "16", or "auto". + :type legend_size: str, optional + + :param markers: List of markers. + :type markers: [WidgetMarker], optional + + :param right_yaxis: Axis controls for the widget. + :type right_yaxis: WidgetAxis, optional + + :param show_legend: (screenboard only) Show the legend for this widget. + :type show_legend: bool, optional + + :param color_by: (deprecated) The attribute formerly used to determine color in the widget. + :type color_by: TreeMapColorBy, optional + + :param group_by: (deprecated) The attribute formerly used to group elements in the widget. + :type group_by: TreeMapGroupBy, optional + + :param size_by: (deprecated) The attribute formerly used to determine size in the widget. + :type size_by: TreeMapSizeBy, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v1.model.change_widget_definition import ChangeWidgetDefinition + from datadog_api_client.v1.model.geomap_widget_definition import GeomapWidgetDefinition + from datadog_api_client.v1.model.query_value_widget_definition import QueryValueWidgetDefinition + from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition + from datadog_api_client.v1.model.sunburst_widget_definition import SunburstWidgetDefinition + from datadog_api_client.v1.model.table_widget_definition import TableWidgetDefinition + from datadog_api_client.v1.model.timeseries_widget_definition import TimeseriesWidgetDefinition + from datadog_api_client.v1.model.toplist_widget_definition import ToplistWidgetDefinition + from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition + + return { + "oneOf": [ + ChangeWidgetDefinition, + GeomapWidgetDefinition, + QueryValueWidgetDefinition, + ScatterPlotWidgetDefinition, + SunburstWidgetDefinition, + TableWidgetDefinition, + TimeseriesWidgetDefinition, + ToplistWidgetDefinition, + TreeMapWidgetDefinition, + ], + } diff --git a/src/datadog_api_client/v1/model/split_graph_viz_size.py b/src/datadog_api_client/v1/model/split_graph_viz_size.py new file mode 100644 index 0000000000..27941262fc --- /dev/null +++ b/src/datadog_api_client/v1/model/split_graph_viz_size.py @@ -0,0 +1,44 @@ +# 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 SplitGraphVizSize(ModelSimple): + """ + Size of the individual graphs in the split. + + :param value: Must be one of ["xs", "sm", "md", "lg"]. + :type value: str + """ + + allowed_values = { + "xs", + "sm", + "md", + "lg", + } + XS: ClassVar["SplitGraphVizSize"] + SM: ClassVar["SplitGraphVizSize"] + MD: ClassVar["SplitGraphVizSize"] + LG: ClassVar["SplitGraphVizSize"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SplitGraphVizSize.XS = SplitGraphVizSize("xs") +SplitGraphVizSize.SM = SplitGraphVizSize("sm") +SplitGraphVizSize.MD = SplitGraphVizSize("md") +SplitGraphVizSize.LG = SplitGraphVizSize("lg") diff --git a/src/datadog_api_client/v1/model/split_graph_widget_definition.py b/src/datadog_api_client/v1/model/split_graph_widget_definition.py new file mode 100644 index 0000000000..8235e089fa --- /dev/null +++ b/src/datadog_api_client/v1/model/split_graph_widget_definition.py @@ -0,0 +1,119 @@ +# 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.split_graph_viz_size import SplitGraphVizSize + from datadog_api_client.v1.model.split_graph_source_widget_definition import SplitGraphSourceWidgetDefinition + from datadog_api_client.v1.model.split_config import SplitConfig + from datadog_api_client.v1.model.widget_time import WidgetTime + from datadog_api_client.v1.model.split_graph_widget_definition_type import SplitGraphWidgetDefinitionType + from datadog_api_client.v1.model.change_widget_definition import ChangeWidgetDefinition + from datadog_api_client.v1.model.geomap_widget_definition import GeomapWidgetDefinition + from datadog_api_client.v1.model.query_value_widget_definition import QueryValueWidgetDefinition + from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition + from datadog_api_client.v1.model.sunburst_widget_definition import SunburstWidgetDefinition + from datadog_api_client.v1.model.table_widget_definition import TableWidgetDefinition + from datadog_api_client.v1.model.timeseries_widget_definition import TimeseriesWidgetDefinition + from datadog_api_client.v1.model.toplist_widget_definition import ToplistWidgetDefinition + from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition + + +class SplitGraphWidgetDefinition(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.split_graph_viz_size import SplitGraphVizSize + from datadog_api_client.v1.model.split_graph_source_widget_definition import SplitGraphSourceWidgetDefinition + from datadog_api_client.v1.model.split_config import SplitConfig + from datadog_api_client.v1.model.widget_time import WidgetTime + from datadog_api_client.v1.model.split_graph_widget_definition_type import SplitGraphWidgetDefinitionType + + return { + "has_uniform_y_axes": (bool,), + "size": (SplitGraphVizSize,), + "source_widget_definition": (SplitGraphSourceWidgetDefinition,), + "split_config": (SplitConfig,), + "time": (WidgetTime,), + "title": (str,), + "type": (SplitGraphWidgetDefinitionType,), + } + + attribute_map = { + "has_uniform_y_axes": "has_uniform_y_axes", + "size": "size", + "source_widget_definition": "source_widget_definition", + "split_config": "split_config", + "time": "time", + "title": "title", + "type": "type", + } + + def __init__( + self_, + size: SplitGraphVizSize, + source_widget_definition: Union[ + SplitGraphSourceWidgetDefinition, + ChangeWidgetDefinition, + GeomapWidgetDefinition, + QueryValueWidgetDefinition, + ScatterPlotWidgetDefinition, + SunburstWidgetDefinition, + TableWidgetDefinition, + TimeseriesWidgetDefinition, + ToplistWidgetDefinition, + TreeMapWidgetDefinition, + ], + split_config: SplitConfig, + type: SplitGraphWidgetDefinitionType, + has_uniform_y_axes: Union[bool, UnsetType] = unset, + time: Union[WidgetTime, UnsetType] = unset, + title: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The split graph widget allows you to create repeating units of a graph - one for each value in a group (for example: one per service) + + :param has_uniform_y_axes: Normalize y axes across graphs + :type has_uniform_y_axes: bool, optional + + :param size: Size of the individual graphs in the split. + :type size: SplitGraphVizSize + + :param source_widget_definition: The original widget we are splitting on. + :type source_widget_definition: SplitGraphSourceWidgetDefinition + + :param split_config: Encapsulates all user choices about how to split a graph. + :type split_config: SplitConfig + + :param time: Time setting for the widget. + :type time: WidgetTime, optional + + :param title: Title of your widget. + :type title: str, optional + + :param type: Type of the split graph widget + :type type: SplitGraphWidgetDefinitionType + """ + if has_uniform_y_axes is not unset: + kwargs["has_uniform_y_axes"] = has_uniform_y_axes + if time is not unset: + kwargs["time"] = time + if title is not unset: + kwargs["title"] = title + super().__init__(kwargs) + + self_.size = size + self_.source_widget_definition = source_widget_definition + self_.split_config = split_config + self_.type = type diff --git a/src/datadog_api_client/v1/model/split_graph_widget_definition_type.py b/src/datadog_api_client/v1/model/split_graph_widget_definition_type.py new file mode 100644 index 0000000000..ec12d7155d --- /dev/null +++ b/src/datadog_api_client/v1/model/split_graph_widget_definition_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 SplitGraphWidgetDefinitionType(ModelSimple): + """ + Type of the split graph widget + + :param value: If omitted defaults to "split_group". Must be one of ["split_group"]. + :type value: str + """ + + allowed_values = { + "split_group", + } + SPLIT_GROUP: ClassVar["SplitGraphWidgetDefinitionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SplitGraphWidgetDefinitionType.SPLIT_GROUP = SplitGraphWidgetDefinitionType("split_group") diff --git a/src/datadog_api_client/v1/model/split_sort.py b/src/datadog_api_client/v1/model/split_sort.py new file mode 100644 index 0000000000..c8afe7005e --- /dev/null +++ b/src/datadog_api_client/v1/model/split_sort.py @@ -0,0 +1,51 @@ +# 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.split_config_sort_compute import SplitConfigSortCompute + from datadog_api_client.v1.model.widget_sort import WidgetSort + + +class SplitSort(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.split_config_sort_compute import SplitConfigSortCompute + from datadog_api_client.v1.model.widget_sort import WidgetSort + + return { + "compute": (SplitConfigSortCompute,), + "order": (WidgetSort,), + } + + attribute_map = { + "compute": "compute", + "order": "order", + } + + def __init__(self_, order: WidgetSort, compute: Union[SplitConfigSortCompute, UnsetType] = unset, **kwargs): + """ + Controls the order in which graphs appear in the split. + + :param compute: Defines the metric and aggregation used as the sort value. + :type compute: SplitConfigSortCompute, optional + + :param order: Widget sorting methods. + :type order: WidgetSort + """ + if compute is not unset: + kwargs["compute"] = compute + super().__init__(kwargs) + + self_.order = order diff --git a/src/datadog_api_client/v1/model/split_vector_entry_item.py b/src/datadog_api_client/v1/model/split_vector_entry_item.py new file mode 100644 index 0000000000..fcbb601d6a --- /dev/null +++ b/src/datadog_api_client/v1/model/split_vector_entry_item.py @@ -0,0 +1,46 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class SplitVectorEntryItem(ModelNormal): + validations = { + "tag_key": { + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "tag_key": (str,), + "tag_values": ([str],), + } + + attribute_map = { + "tag_key": "tag_key", + "tag_values": "tag_values", + } + + def __init__(self_, tag_key: str, tag_values: List[str], **kwargs): + """ + The split graph list contains a graph for each value of the split dimension. + + :param tag_key: The tag key. + :type tag_key: str + + :param tag_values: The tag values. + :type tag_values: [str] + """ + super().__init__(kwargs) + + self_.tag_key = tag_key + self_.tag_values = tag_values diff --git a/src/datadog_api_client/v1/model/widget.py b/src/datadog_api_client/v1/model/widget.py index c74fe0bf7f..98334ec122 100644 --- a/src/datadog_api_client/v1/model/widget.py +++ b/src/datadog_api_client/v1/model/widget.py @@ -24,30 +24,31 @@ from datadog_api_client.v1.model.event_stream_widget_definition import EventStreamWidgetDefinition from datadog_api_client.v1.model.event_timeline_widget_definition import EventTimelineWidgetDefinition from datadog_api_client.v1.model.free_text_widget_definition import FreeTextWidgetDefinition + from datadog_api_client.v1.model.funnel_widget_definition import FunnelWidgetDefinition from datadog_api_client.v1.model.geomap_widget_definition import GeomapWidgetDefinition from datadog_api_client.v1.model.group_widget_definition import GroupWidgetDefinition from datadog_api_client.v1.model.heat_map_widget_definition import HeatMapWidgetDefinition from datadog_api_client.v1.model.host_map_widget_definition import HostMapWidgetDefinition from datadog_api_client.v1.model.i_frame_widget_definition import IFrameWidgetDefinition from datadog_api_client.v1.model.image_widget_definition import ImageWidgetDefinition + from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition from datadog_api_client.v1.model.log_stream_widget_definition import LogStreamWidgetDefinition from datadog_api_client.v1.model.monitor_summary_widget_definition import MonitorSummaryWidgetDefinition from datadog_api_client.v1.model.note_widget_definition import NoteWidgetDefinition from datadog_api_client.v1.model.query_value_widget_definition import QueryValueWidgetDefinition from datadog_api_client.v1.model.run_workflow_widget_definition import RunWorkflowWidgetDefinition - from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition - from datadog_api_client.v1.model.slo_widget_definition import SLOWidgetDefinition from datadog_api_client.v1.model.slo_list_widget_definition import SLOListWidgetDefinition + from datadog_api_client.v1.model.slo_widget_definition import SLOWidgetDefinition + from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition from datadog_api_client.v1.model.service_map_widget_definition import ServiceMapWidgetDefinition from datadog_api_client.v1.model.service_summary_widget_definition import ServiceSummaryWidgetDefinition + from datadog_api_client.v1.model.split_graph_widget_definition import SplitGraphWidgetDefinition from datadog_api_client.v1.model.sunburst_widget_definition import SunburstWidgetDefinition from datadog_api_client.v1.model.table_widget_definition import TableWidgetDefinition from datadog_api_client.v1.model.timeseries_widget_definition import TimeseriesWidgetDefinition from datadog_api_client.v1.model.toplist_widget_definition import ToplistWidgetDefinition - from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition - from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition - from datadog_api_client.v1.model.funnel_widget_definition import FunnelWidgetDefinition from datadog_api_client.v1.model.topology_map_widget_definition import TopologyMapWidgetDefinition + from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition class Widget(ModelNormal): @@ -80,30 +81,31 @@ def __init__( EventStreamWidgetDefinition, EventTimelineWidgetDefinition, FreeTextWidgetDefinition, + FunnelWidgetDefinition, GeomapWidgetDefinition, GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition, IFrameWidgetDefinition, ImageWidgetDefinition, + ListStreamWidgetDefinition, LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, QueryValueWidgetDefinition, RunWorkflowWidgetDefinition, - ScatterPlotWidgetDefinition, - SLOWidgetDefinition, SLOListWidgetDefinition, + SLOWidgetDefinition, + ScatterPlotWidgetDefinition, ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, + SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition, TimeseriesWidgetDefinition, ToplistWidgetDefinition, - TreeMapWidgetDefinition, - ListStreamWidgetDefinition, - FunnelWidgetDefinition, TopologyMapWidgetDefinition, + TreeMapWidgetDefinition, ], id: Union[int, UnsetType] = unset, layout: Union[WidgetLayout, UnsetType] = unset, diff --git a/src/datadog_api_client/v1/model/widget_definition.py b/src/datadog_api_client/v1/model/widget_definition.py index e8294c9f84..bbac1c191b 100644 --- a/src/datadog_api_client/v1/model/widget_definition.py +++ b/src/datadog_api_client/v1/model/widget_definition.py @@ -242,9 +242,6 @@ def __init__(self, **kwargs): :param workflow_id: Workflow id. :type workflow_id: str - :param color_by_groups: List of groups used for colors. - :type color_by_groups: [str], optional - :param additional_query_filters: Additional filters applied to the SLO query. :type additional_query_filters: str, optional @@ -266,6 +263,9 @@ def __init__(self, **kwargs): :param view_type: Type of view displayed by the widget. :type view_type: str + :param color_by_groups: List of groups used for colors. + :type color_by_groups: [str], optional + :param filters: Your environment and primary tag (or * if enabled for your account). :type filters: [str] @@ -299,6 +299,18 @@ def __init__(self, **kwargs): :param span_name: APM span name. :type span_name: str + :param has_uniform_y_axes: Normalize y axes across graphs + :type has_uniform_y_axes: bool, optional + + :param size: Size of the individual graphs in the split. + :type size: SplitGraphVizSize + + :param source_widget_definition: The original widget we are splitting on. + :type source_widget_definition: SplitGraphSourceWidgetDefinition + + :param split_config: Encapsulates all user choices about how to split a graph. + :type split_config: SplitConfig + :param hide_total: Show the total value in this widget. :type hide_total: bool, optional @@ -342,30 +354,31 @@ def _composed_schemas(_): from datadog_api_client.v1.model.event_stream_widget_definition import EventStreamWidgetDefinition from datadog_api_client.v1.model.event_timeline_widget_definition import EventTimelineWidgetDefinition from datadog_api_client.v1.model.free_text_widget_definition import FreeTextWidgetDefinition + from datadog_api_client.v1.model.funnel_widget_definition import FunnelWidgetDefinition from datadog_api_client.v1.model.geomap_widget_definition import GeomapWidgetDefinition from datadog_api_client.v1.model.group_widget_definition import GroupWidgetDefinition from datadog_api_client.v1.model.heat_map_widget_definition import HeatMapWidgetDefinition from datadog_api_client.v1.model.host_map_widget_definition import HostMapWidgetDefinition from datadog_api_client.v1.model.i_frame_widget_definition import IFrameWidgetDefinition from datadog_api_client.v1.model.image_widget_definition import ImageWidgetDefinition + from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition from datadog_api_client.v1.model.log_stream_widget_definition import LogStreamWidgetDefinition from datadog_api_client.v1.model.monitor_summary_widget_definition import MonitorSummaryWidgetDefinition from datadog_api_client.v1.model.note_widget_definition import NoteWidgetDefinition from datadog_api_client.v1.model.query_value_widget_definition import QueryValueWidgetDefinition from datadog_api_client.v1.model.run_workflow_widget_definition import RunWorkflowWidgetDefinition - from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition - from datadog_api_client.v1.model.slo_widget_definition import SLOWidgetDefinition from datadog_api_client.v1.model.slo_list_widget_definition import SLOListWidgetDefinition + from datadog_api_client.v1.model.slo_widget_definition import SLOWidgetDefinition + from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition from datadog_api_client.v1.model.service_map_widget_definition import ServiceMapWidgetDefinition from datadog_api_client.v1.model.service_summary_widget_definition import ServiceSummaryWidgetDefinition + from datadog_api_client.v1.model.split_graph_widget_definition import SplitGraphWidgetDefinition from datadog_api_client.v1.model.sunburst_widget_definition import SunburstWidgetDefinition from datadog_api_client.v1.model.table_widget_definition import TableWidgetDefinition from datadog_api_client.v1.model.timeseries_widget_definition import TimeseriesWidgetDefinition from datadog_api_client.v1.model.toplist_widget_definition import ToplistWidgetDefinition - from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition - from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition - from datadog_api_client.v1.model.funnel_widget_definition import FunnelWidgetDefinition from datadog_api_client.v1.model.topology_map_widget_definition import TopologyMapWidgetDefinition + from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition return { "oneOf": [ @@ -377,29 +390,30 @@ def _composed_schemas(_): EventStreamWidgetDefinition, EventTimelineWidgetDefinition, FreeTextWidgetDefinition, + FunnelWidgetDefinition, GeomapWidgetDefinition, GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition, IFrameWidgetDefinition, ImageWidgetDefinition, + ListStreamWidgetDefinition, LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, QueryValueWidgetDefinition, RunWorkflowWidgetDefinition, - ScatterPlotWidgetDefinition, - SLOWidgetDefinition, SLOListWidgetDefinition, + SLOWidgetDefinition, + ScatterPlotWidgetDefinition, ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, + SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition, TimeseriesWidgetDefinition, ToplistWidgetDefinition, - TreeMapWidgetDefinition, - ListStreamWidgetDefinition, - FunnelWidgetDefinition, TopologyMapWidgetDefinition, + TreeMapWidgetDefinition, ], } diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index a73654072f..9047719f6e 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -559,6 +559,15 @@ from datadog_api_client.v1.model.slack_integration_channel import SlackIntegrationChannel from datadog_api_client.v1.model.slack_integration_channel_display import SlackIntegrationChannelDisplay from datadog_api_client.v1.model.slack_integration_channels import SlackIntegrationChannels +from datadog_api_client.v1.model.split_config import SplitConfig +from datadog_api_client.v1.model.split_config_sort_compute import SplitConfigSortCompute +from datadog_api_client.v1.model.split_dimension import SplitDimension +from datadog_api_client.v1.model.split_graph_source_widget_definition import SplitGraphSourceWidgetDefinition +from datadog_api_client.v1.model.split_graph_viz_size import SplitGraphVizSize +from datadog_api_client.v1.model.split_graph_widget_definition import SplitGraphWidgetDefinition +from datadog_api_client.v1.model.split_graph_widget_definition_type import SplitGraphWidgetDefinitionType +from datadog_api_client.v1.model.split_sort import SplitSort +from datadog_api_client.v1.model.split_vector_entry_item import SplitVectorEntryItem from datadog_api_client.v1.model.successful_signal_update_response import SuccessfulSignalUpdateResponse from datadog_api_client.v1.model.sunburst_widget_definition import SunburstWidgetDefinition from datadog_api_client.v1.model.sunburst_widget_definition_type import SunburstWidgetDefinitionType @@ -1413,6 +1422,15 @@ "SlackIntegrationChannel", "SlackIntegrationChannelDisplay", "SlackIntegrationChannels", + "SplitConfig", + "SplitConfigSortCompute", + "SplitDimension", + "SplitGraphSourceWidgetDefinition", + "SplitGraphVizSize", + "SplitGraphWidgetDefinition", + "SplitGraphWidgetDefinitionType", + "SplitSort", + "SplitVectorEntryItem", "SuccessfulSignalUpdateResponse", "SunburstWidgetDefinition", "SunburstWidgetDefinitionType", diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_split_graph_widget.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_split_graph_widget.frozen new file mode 100644 index 0000000000..6e7aa326de --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_split_graph_widget.frozen @@ -0,0 +1 @@ +2023-09-14T14:04:40.364Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_split_graph_widget.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_split_graph_widget.yaml new file mode 100644 index 0000000000..7af277bbce --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_split_graph_widget.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"description":"","is_read_only":false,"layout_type":"ordered","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_split_graph_widget-1694700280","widgets":[{"definition":{"has_uniform_y_axes":true,"size":"md","source_widget_definition":{"requests":[{"display_type":"line","queries":[{"data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*}"}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"title":"","title_align":"left","title_size":"16","type":"timeseries"},"split_config":{"limit":24,"sort":{"compute":{"aggregation":"sum","metric":"system.cpu.user"},"order":"desc"},"split_dimensions":[{"one_graph_per":"service"}],"static_splits":[[{"tag_key":"service","tag_values":["cassandra"]},{"tag_key":"datacenter","tag_values":[]}],[{"tag_key":"demo","tag_values":["env"]}]]},"title":"","type":"split_group"},"layout":{"height":8,"width":12,"x":0,"y":0}}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + string: '{"id":"cjw-gqa-mgu","title":"Test-Create_a_new_dashboard_with_split_graph_widget-1694700280","description":"","author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/cjw-gqa-mgu/test-createanewdashboardwithsplitgraphwidget-1694700280","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"has_uniform_y_axes":true,"size":"md","source_widget_definition":{"requests":[{"display_type":"line","queries":[{"data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*}"}],"response_format":"timeseries","style":{"line_type":"solid","line_width":"normal","palette":"dog_classic"}}],"title":"","title_align":"left","title_size":"16","type":"timeseries"},"split_config":{"limit":24,"sort":{"compute":{"aggregation":"sum","metric":"system.cpu.user"},"order":"desc"},"split_dimensions":[{"one_graph_per":"service"}],"static_splits":[[{"tag_key":"service","tag_values":["cassandra"]},{"tag_key":"datacenter","tag_values":[]}],[{"tag_key":"demo","tag_values":["env"]}]]},"title":"","type":"split_group"},"layout":{"height":8,"width":12,"x":0,"y":0},"id":130983163053076}],"notify_list":[],"created_at":"2023-09-14T14:04:40.913735+00:00","modified_at":"2023-09-14T14:04:40.913735+00:00","restricted_roles":[]} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/cjw-gqa-mgu + response: + body: + string: '{"deleted_dashboard_id":"cjw-gqa-mgu"} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/features/dashboards.feature b/tests/v1/features/dashboards.feature index 743a9b4efb..68f41470fe 100644 --- a/tests/v1/features/dashboards.feature +++ b/tests/v1/features/dashboards.feature @@ -629,6 +629,21 @@ Feature: Dashboards And the response "widgets[0].definition.slo_id" is equal to "{{ slo.data[0].id }}" And the response "widgets[0].definition.additional_query_filters" is equal to "!host:excluded_host" + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with split graph widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/split_graph_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "split_group" + And the response "widgets[0].definition.source_widget_definition" is equal to {"title":"","title_size":"16","title_align":"left","type":"timeseries","requests":[{"response_format":"timeseries","queries":[{"name":"query1","data_source":"metrics","query":"avg:system.cpu.user{*}"}],"style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]} + And the response "widgets[0].definition.split_config.split_dimensions" is equal to [{"one_graph_per": "service"}] + And the response "widgets[0].definition.split_config.limit" is equal to 24 + And the response "widgets[0].definition.split_config.sort" is equal to {"compute": {"aggregation": "sum", "metric": "system.cpu.user"}, "order": "desc"} + And the response "widgets[0].definition.split_config.static_splits" is equal to [[{"tag_key":"service","tag_values":["cassandra"]},{"tag_key":"datacenter","tag_values":[]}],[{"tag_key":"demo","tag_values":["env"]}]] + And the response "widgets[0].definition.size" is equal to "md" + And the response "widgets[0].definition.has_uniform_y_axes" is equal to true + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with sunburst widget and metrics data Given new "CreateDashboard" request diff --git a/tests/v1/features/dashboards_json_payload/split_graph_widget.json b/tests/v1/features/dashboards_json_payload/split_graph_widget.json new file mode 100644 index 0000000000..b3d6c44293 --- /dev/null +++ b/tests/v1/features/dashboards_json_payload/split_graph_widget.json @@ -0,0 +1,49 @@ +{ + "title":"{{ unique }}", + "description":"", + "widgets":[ + { + "layout":{ + "x":0, + "y":0, + "width":12, + "height":8 + }, + "definition":{ + "title": "", + "type": "split_group", + "source_widget_definition": { + "title": "", + "title_size": "16", + "title_align": "left", + "type": "timeseries", + "requests": [ + { + "response_format": "timeseries", + "queries": [ + {"name": "query1", "data_source": "metrics", "query": "avg:system.cpu.user{*}"} + ], + "style": {"palette": "dog_classic", "line_type": "solid", "line_width": "normal"}, + "display_type": "line" + } + ] + }, + "split_config": { + "split_dimensions":[{"one_graph_per": "service"}], + "limit": 24, + "sort": {"compute": {"aggregation": "sum", "metric": "system.cpu.user"}, "order": "desc"}, + "static_splits": [ + [{"tag_key": "service", "tag_values": ["cassandra"]}, {"tag_key": "datacenter", "tag_values": []}], + [{"tag_key": "demo", "tag_values": ["env"]}] + ] + }, + "size": "md", + "has_uniform_y_axes": true + } + } + ], + "template_variables":[], + "layout_type":"ordered", + "is_read_only":false, + "notify_list":[] + } \ No newline at end of file