diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 051a69bc02..fa4685af5c 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -1904,6 +1904,67 @@ components: type: string x-enum-varnames: - DATA_PROJECTION + DatasetListQuery: + description: Query that lists the rows of a published dataset (a DDSQL query) without aggregation. + properties: + data_source: + $ref: "#/components/schemas/DatasetListQueryDataSourceType" + dataset_id: + description: ID of the published dataset to query. + example: "abc-123-def" + type: string + dataset_provider: + $ref: "#/components/schemas/PublishedDatasetProvider" + filter: + description: Filter applied to the dataset's rows, using events-style search syntax. + example: "service:web-store" + type: string + limit: + description: Maximum number of rows to return from the dataset query. + format: int64 + type: integer + sort: + $ref: "#/components/schemas/DatasetListQuerySort" + required: + - data_source + - dataset_provider + - dataset_id + type: object + DatasetListQueryDataSourceType: + description: Identifies this as a published-dataset list query. + enum: + - dataset + example: dataset + type: string + x-enum-varnames: + - DATASET + DatasetListQuerySort: + description: Sort configuration for a `DatasetListQuery`. + properties: + fields: + description: List of fields to sort the rows by, applied in order. + example: + - name: cpu_usage + order: desc + items: + $ref: "#/components/schemas/DatasetListQuerySortField" + type: array + required: + - fields + type: object + DatasetListQuerySortField: + description: A single sort directive for a `DatasetListQuery`. + properties: + name: + description: Name of the field to sort on. + example: duration + type: string + order: + $ref: "#/components/schemas/QuerySortOrder" + required: + - name + - order + type: object DeleteSharedDashboardResponse: description: Response containing token of deleted shared dashboard. properties: @@ -4492,7 +4553,9 @@ components: type: integer type: object HostMapRequest: - description: Updated host map. + deprecated: true + description: >- + Deprecated - Legacy metric-based host map request. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. properties: apm_query: $ref: "#/components/schemas/LogQueryDefinition" @@ -4542,32 +4605,46 @@ components: description: The description of the widget. type: string group: - description: List of tag prefixes to group by. + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `group_by` (infrastructure) or a `group` dimension (DDSQL) inside `requests` instead. items: description: Tag prefixes. type: string type: array no_group_hosts: - description: Whether to show the hosts that don’t fit in a group. + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `no_group_hosts` inside `requests` instead. type: boolean no_metric_hosts: - description: Whether to show the hosts with no metrics. + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `no_metric_hosts` inside `requests` instead. type: boolean node_type: $ref: "#/components/schemas/WidgetNodeType" + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `node_type` inside `requests` instead. notes: description: Notes on the title. type: string requests: $ref: "#/components/schemas/HostMapWidgetDefinitionRequests" scope: - description: List of tags used to filter the map. + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `filter` inside `requests` instead. items: description: Tags. type: string type: array style: $ref: "#/components/schemas/HostMapWidgetDefinitionStyle" + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `style` inside `requests` instead. title: description: Title of the widget. type: string @@ -4582,20 +4659,33 @@ components: - type - requests type: object + HostMapWidgetDefinitionRequestType: + description: >- + Identifies which host map request format the sibling fields on `HostMapWidgetDefinitionRequests` describe: an infrastructure-backed request or a DDSQL published-dataset request. + enum: + - infrastructure_hostmap + - data_projection + example: infrastructure_hostmap + type: string + x-enum-varnames: + - INFRASTRUCTURE_HOSTMAP + - DATA_PROJECTION HostMapWidgetDefinitionRequests: description: >- - Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of `request_type`: the legacy metric-based format (`fill`/`size`) and the infrastructure-backed format (`request_type`, `node_type`, `enrichments`). + Query definition for the host map widget. Supports three mutually exclusive formats distinguished by `request_type`: the deprecated legacy metric-based format (`fill`/`size`, no `request_type`), the infrastructure-backed format (`request_type: infrastructure_hostmap`), and the DDSQL published-dataset format (`request_type: data_projection`). example: {} properties: child: $ref: "#/components/schemas/HostMapWidgetInfrastructureRequest" + description: Optional child entities for hierarchical visualization (for example, host → container). Only used by the infrastructure-backed format. conditional_formats: description: List of conditional formatting rules applied to fill values. items: $ref: "#/components/schemas/WidgetConditionalFormat" type: array enrichments: - description: Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + description: >- + Metric or event queries joined to the entity set. Each formula specifies a visual dimension. Only used by the infrastructure-backed format. example: - formulas: - dimension: fill @@ -4610,17 +4700,25 @@ components: type: array fill: $ref: "#/components/schemas/HostMapRequest" + deprecated: true + description: >- + Deprecated - Legacy metric-based format. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. filter: - description: Filter string for the entity set in tag format (for example, `env:prod`). + description: >- + Filter string for the entity set in tag format (for example, `env:prod`). Only used by the infrastructure-backed format. example: "env:prod" type: string group_by: description: |- Defines how entities are grouped into tiles. The ordering of entries implies - the grouping hierarchy. + the grouping hierarchy. Only used by the infrastructure-backed format. items: $ref: "#/components/schemas/HostMapWidgetGroupBy" type: array + limit: + description: Maximum number of rows to return from the dataset query. Only used by the DDSQL format. + format: int64 + type: integer no_group_hosts: description: Whether to hide entities that have no group assignment. type: boolean @@ -4629,15 +4727,28 @@ components: type: boolean node_type: $ref: "#/components/schemas/HostMapWidgetNodeType" + description: Entity type to visualize. Only used by the infrastructure-backed format. + projection: + $ref: "#/components/schemas/HostMapWidgetProjection" + description: >- + Maps dataset columns to map dimensions (entity, optional parent for grouping, fill, size). Only used by the DDSQL format. + query: + $ref: "#/components/schemas/DatasetListQuery" + description: Published-dataset query. Only used by the DDSQL format. request_type: - $ref: "#/components/schemas/HostMapWidgetInfrastructureRequestRequestType" + $ref: "#/components/schemas/HostMapWidgetDefinitionRequestType" size: $ref: "#/components/schemas/HostMapRequest" + deprecated: true + description: >- + Deprecated - Legacy metric-based format. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. style: $ref: "#/components/schemas/HostMapWidgetInfrastructureStyle" type: object HostMapWidgetDefinitionStyle: - description: The style to apply to the widget. + deprecated: true + description: >- + Deprecated - The style to apply to the legacy metric-based host map widget. Use `HostMapWidgetInfrastructureStyle` instead. properties: fill_max: description: Max value to use to color the map. @@ -4662,17 +4773,20 @@ components: x-enum-varnames: - HOSTMAP HostMapWidgetDimension: - description: Visual dimension driven by a formula in the infrastructure host map widget. + description: >- + Visual dimension for the host map widget. Used both by infrastructure-backed formulas and by DDSQL projection columns; `group` is only meaningful for DDSQL projection columns, where repeated entries define the grouping hierarchy. enum: - node - fill - size + - group example: node type: string x-enum-varnames: - NODE - FILL - SIZE + - GROUP HostMapWidgetFormula: description: |- Formula for the infrastructure host map widget that specifies both the expression @@ -4857,6 +4971,54 @@ components: - CONTAINER - POD - CLUSTER + HostMapWidgetProjection: + description: >- + Projection for the DDSQL host map request. Maps dataset columns to map dimensions: `node` identifies the entity, repeated `group` entries define the grouping hierarchy (outermost first), and `fill`/`size` drive the tile color and size. + properties: + dimensions: + description: List of column-to-dimension mappings for the projection. + example: + - column: entity_id + dimension: node + - column: parent_id + dimension: group + - column: cpu_usage + dimension: fill + items: + $ref: "#/components/schemas/HostMapWidgetProjectionDimensionMapping" + type: array + type: + $ref: "#/components/schemas/HostMapWidgetProjectionType" + required: + - type + - dimensions + type: object + HostMapWidgetProjectionDimensionMapping: + description: Maps a dataset column to a host map visual dimension. + properties: + alias: + description: Alias used to label the column instead of its name. + type: string + column: + description: Source column name from the dataset. + example: entity_id + type: string + dimension: + $ref: "#/components/schemas/HostMapWidgetDimension" + number_format: + $ref: "#/components/schemas/WidgetNumberFormat" + required: + - column + - dimension + type: object + HostMapWidgetProjectionType: + description: Type of the host map projection. + enum: + - hostmap + example: hostmap + type: string + x-enum-varnames: + - HOSTMAP HostMapWidgetScalarRequest: description: |- Scalar formula request for the infrastructure host map widget. Each formula specifies @@ -12635,12 +12797,22 @@ components: - type - requests type: object + PublishedDatasetProvider: + description: >- + Product page that published the dataset queried by a `DatasetListQuery`. `ddsql_query` is the only provider currently supported for host map widgets. + enum: + - ddsql_query + example: ddsql_query + type: string + x-enum-varnames: + - DDSQL_QUERY QuerySortOrder: default: desc description: Direction of sort. enum: - asc - desc + example: asc type: string x-enum-varnames: - ASC diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 4a3f774b9d..4c41df147e 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -711,6 +711,34 @@ datadog\_api\_client.v1.model.data\_projection\_request\_type module :members: :show-inheritance: +datadog\_api\_client.v1.model.dataset\_list\_query module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.dataset_list_query + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.dataset\_list\_query\_data\_source\_type module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.dataset_list_query_data_source_type + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.dataset\_list\_query\_sort module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.dataset_list_query_sort + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.dataset\_list\_query\_sort\_field module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.dataset_list_query_sort_field + :members: + :show-inheritance: + datadog\_api\_client.v1.model.delete\_shared\_dashboard\_response module ------------------------------------------------------------------------ @@ -1446,6 +1474,13 @@ datadog\_api\_client.v1.model.host\_map\_widget\_definition module :members: :show-inheritance: +datadog\_api\_client.v1.model.host\_map\_widget\_definition\_request\_type module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.host_map_widget_definition_request_type + :members: + :show-inheritance: + datadog\_api\_client.v1.model.host\_map\_widget\_definition\_requests module ---------------------------------------------------------------------------- @@ -1523,6 +1558,27 @@ datadog\_api\_client.v1.model.host\_map\_widget\_node\_type module :members: :show-inheritance: +datadog\_api\_client.v1.model.host\_map\_widget\_projection module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.host_map_widget_projection + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.host\_map\_widget\_projection\_dimension\_mapping module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.host_map_widget_projection_dimension_mapping + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.host\_map\_widget\_projection\_type module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.host_map_widget_projection_type + :members: + :show-inheritance: + datadog\_api\_client.v1.model.host\_map\_widget\_scalar\_request module ----------------------------------------------------------------------- @@ -3868,6 +3924,13 @@ datadog\_api\_client.v1.model.product\_analytics\_funnel\_widget\_definition mod :members: :show-inheritance: +datadog\_api\_client.v1.model.published\_dataset\_provider module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.published_dataset_provider + :members: + :show-inheritance: + datadog\_api\_client.v1.model.query\_sort\_order module ------------------------------------------------------- diff --git a/examples/v1/dashboards/CreateDashboard_2780500284.py b/examples/v1/dashboards/CreateDashboard_2780500284.py new file mode 100644 index 0000000000..f7f809c75c --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2780500284.py @@ -0,0 +1,86 @@ +""" +Create a new dashboard with hostmap DDSQL 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.dataset_list_query import DatasetListQuery +from datadog_api_client.v1.model.dataset_list_query_data_source_type import DatasetListQueryDataSourceType +from datadog_api_client.v1.model.host_map_widget_definition import HostMapWidgetDefinition +from datadog_api_client.v1.model.host_map_widget_definition_request_type import HostMapWidgetDefinitionRequestType +from datadog_api_client.v1.model.host_map_widget_definition_requests import HostMapWidgetDefinitionRequests +from datadog_api_client.v1.model.host_map_widget_definition_type import HostMapWidgetDefinitionType +from datadog_api_client.v1.model.host_map_widget_dimension import HostMapWidgetDimension +from datadog_api_client.v1.model.host_map_widget_infrastructure_style import HostMapWidgetInfrastructureStyle +from datadog_api_client.v1.model.host_map_widget_projection import HostMapWidgetProjection +from datadog_api_client.v1.model.host_map_widget_projection_dimension_mapping import ( + HostMapWidgetProjectionDimensionMapping, +) +from datadog_api_client.v1.model.host_map_widget_projection_type import HostMapWidgetProjectionType +from datadog_api_client.v1.model.published_dataset_provider import PublishedDatasetProvider +from datadog_api_client.v1.model.widget import Widget +from datadog_api_client.v1.model.widget_layout import WidgetLayout +from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign + +body = Dashboard( + title="Example-Dashboard", + description=None, + widgets=[ + Widget( + layout=WidgetLayout( + x=0, + y=0, + width=47, + height=22, + ), + definition=HostMapWidgetDefinition( + title="", + title_size="16", + title_align=WidgetTextAlign.LEFT, + type=HostMapWidgetDefinitionType.HOSTMAP, + requests=HostMapWidgetDefinitionRequests( + request_type=HostMapWidgetDefinitionRequestType.DATA_PROJECTION, + limit=1000, + query=DatasetListQuery( + data_source=DatasetListQueryDataSourceType.DATASET, + dataset_provider=PublishedDatasetProvider.DDSQL_QUERY, + dataset_id="abc-123-def", + ), + projection=HostMapWidgetProjection( + type=HostMapWidgetProjectionType.HOSTMAP, + dimensions=[ + HostMapWidgetProjectionDimensionMapping( + column="entity_id", + dimension=HostMapWidgetDimension.NODE, + ), + HostMapWidgetProjectionDimensionMapping( + column="parent_id", + dimension=HostMapWidgetDimension.GROUP, + ), + HostMapWidgetProjectionDimensionMapping( + column="cpu_usage", + dimension=HostMapWidgetDimension.FILL, + ), + ], + ), + style=HostMapWidgetInfrastructureStyle( + palette="green_to_orange", + palette_flip=False, + ), + ), + ), + ), + ], + template_variables=[], + layout_type=DashboardLayoutType.FREE, + 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/examples/v1/dashboards/CreateDashboard_2882802132.py b/examples/v1/dashboards/CreateDashboard_2882802132.py index eb5b418efd..f97bb7c34e 100644 --- a/examples/v1/dashboards/CreateDashboard_2882802132.py +++ b/examples/v1/dashboards/CreateDashboard_2882802132.py @@ -11,14 +11,12 @@ FormulaAndFunctionMetricQueryDefinition, ) from datadog_api_client.v1.model.host_map_widget_definition import HostMapWidgetDefinition +from datadog_api_client.v1.model.host_map_widget_definition_request_type import HostMapWidgetDefinitionRequestType from datadog_api_client.v1.model.host_map_widget_definition_requests import HostMapWidgetDefinitionRequests from datadog_api_client.v1.model.host_map_widget_definition_type import HostMapWidgetDefinitionType from datadog_api_client.v1.model.host_map_widget_dimension import HostMapWidgetDimension from datadog_api_client.v1.model.host_map_widget_formula import HostMapWidgetFormula from datadog_api_client.v1.model.host_map_widget_group_by import HostMapWidgetGroupBy -from datadog_api_client.v1.model.host_map_widget_infrastructure_request_request_type import ( - HostMapWidgetInfrastructureRequestRequestType, -) from datadog_api_client.v1.model.host_map_widget_infrastructure_style import HostMapWidgetInfrastructureStyle from datadog_api_client.v1.model.host_map_widget_node_type import HostMapWidgetNodeType from datadog_api_client.v1.model.host_map_widget_scalar_request import HostMapWidgetScalarRequest @@ -46,7 +44,7 @@ title_align=WidgetTextAlign.LEFT, type=HostMapWidgetDefinitionType.HOSTMAP, requests=HostMapWidgetDefinitionRequests( - request_type=HostMapWidgetInfrastructureRequestRequestType.INFRASTRUCTURE_HOSTMAP, + request_type=HostMapWidgetDefinitionRequestType.INFRASTRUCTURE_HOSTMAP, node_type=HostMapWidgetNodeType.HOST, filter="env:prod", group_by=[ diff --git a/src/datadog_api_client/v1/model/dataset_list_query.py b/src/datadog_api_client/v1/model/dataset_list_query.py new file mode 100644 index 0000000000..cd9d9b6d6f --- /dev/null +++ b/src/datadog_api_client/v1/model/dataset_list_query.py @@ -0,0 +1,88 @@ +# 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.dataset_list_query_data_source_type import DatasetListQueryDataSourceType + from datadog_api_client.v1.model.published_dataset_provider import PublishedDatasetProvider + from datadog_api_client.v1.model.dataset_list_query_sort import DatasetListQuerySort + + +class DatasetListQuery(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.dataset_list_query_data_source_type import DatasetListQueryDataSourceType + from datadog_api_client.v1.model.published_dataset_provider import PublishedDatasetProvider + from datadog_api_client.v1.model.dataset_list_query_sort import DatasetListQuerySort + + return { + "data_source": (DatasetListQueryDataSourceType,), + "dataset_id": (str,), + "dataset_provider": (PublishedDatasetProvider,), + "filter": (str,), + "limit": (int,), + "sort": (DatasetListQuerySort,), + } + + attribute_map = { + "data_source": "data_source", + "dataset_id": "dataset_id", + "dataset_provider": "dataset_provider", + "filter": "filter", + "limit": "limit", + "sort": "sort", + } + + def __init__( + self_, + data_source: DatasetListQueryDataSourceType, + dataset_id: str, + dataset_provider: PublishedDatasetProvider, + filter: Union[str, UnsetType] = unset, + limit: Union[int, UnsetType] = unset, + sort: Union[DatasetListQuerySort, UnsetType] = unset, + **kwargs, + ): + """ + Query that lists the rows of a published dataset (a DDSQL query) without aggregation. + + :param data_source: Identifies this as a published-dataset list query. + :type data_source: DatasetListQueryDataSourceType + + :param dataset_id: ID of the published dataset to query. + :type dataset_id: str + + :param dataset_provider: Product page that published the dataset queried by a ``DatasetListQuery``. ``ddsql_query`` is the only provider currently supported for host map widgets. + :type dataset_provider: PublishedDatasetProvider + + :param filter: Filter applied to the dataset's rows, using events-style search syntax. + :type filter: str, optional + + :param limit: Maximum number of rows to return from the dataset query. + :type limit: int, optional + + :param sort: Sort configuration for a ``DatasetListQuery``. + :type sort: DatasetListQuerySort, optional + """ + if filter is not unset: + kwargs["filter"] = filter + if limit is not unset: + kwargs["limit"] = limit + if sort is not unset: + kwargs["sort"] = sort + super().__init__(kwargs) + + self_.data_source = data_source + self_.dataset_id = dataset_id + self_.dataset_provider = dataset_provider diff --git a/src/datadog_api_client/v1/model/dataset_list_query_data_source_type.py b/src/datadog_api_client/v1/model/dataset_list_query_data_source_type.py new file mode 100644 index 0000000000..8b9db0bf3b --- /dev/null +++ b/src/datadog_api_client/v1/model/dataset_list_query_data_source_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 DatasetListQueryDataSourceType(ModelSimple): + """ + Identifies this as a published-dataset list query. + + :param value: If omitted defaults to "dataset". Must be one of ["dataset"]. + :type value: str + """ + + allowed_values = { + "dataset", + } + DATASET: ClassVar["DatasetListQueryDataSourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DatasetListQueryDataSourceType.DATASET = DatasetListQueryDataSourceType("dataset") diff --git a/src/datadog_api_client/v1/model/dataset_list_query_sort.py b/src/datadog_api_client/v1/model/dataset_list_query_sort.py new file mode 100644 index 0000000000..9f3ee98474 --- /dev/null +++ b/src/datadog_api_client/v1/model/dataset_list_query_sort.py @@ -0,0 +1,40 @@ +# 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.dataset_list_query_sort_field import DatasetListQuerySortField + + +class DatasetListQuerySort(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.dataset_list_query_sort_field import DatasetListQuerySortField + + return { + "fields": ([DatasetListQuerySortField],), + } + + attribute_map = { + "fields": "fields", + } + + def __init__(self_, fields: List[DatasetListQuerySortField], **kwargs): + """ + Sort configuration for a ``DatasetListQuery``. + + :param fields: List of fields to sort the rows by, applied in order. + :type fields: [DatasetListQuerySortField] + """ + super().__init__(kwargs) + + self_.fields = fields diff --git a/src/datadog_api_client/v1/model/dataset_list_query_sort_field.py b/src/datadog_api_client/v1/model/dataset_list_query_sort_field.py new file mode 100644 index 0000000000..b30f8b95ff --- /dev/null +++ b/src/datadog_api_client/v1/model/dataset_list_query_sort_field.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.query_sort_order import QuerySortOrder + + +class DatasetListQuerySortField(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.query_sort_order import QuerySortOrder + + return { + "name": (str,), + "order": (QuerySortOrder,), + } + + attribute_map = { + "name": "name", + "order": "order", + } + + def __init__(self_, name: str, order: QuerySortOrder, **kwargs): + """ + A single sort directive for a ``DatasetListQuery``. + + :param name: Name of the field to sort on. + :type name: str + + :param order: Direction of sort. + :type order: QuerySortOrder + """ + super().__init__(kwargs) + + self_.name = name + self_.order = order diff --git a/src/datadog_api_client/v1/model/host_map_request.py b/src/datadog_api_client/v1/model/host_map_request.py index 08bbc3e7bb..a63fbc5663 100644 --- a/src/datadog_api_client/v1/model/host_map_request.py +++ b/src/datadog_api_client/v1/model/host_map_request.py @@ -62,7 +62,7 @@ def __init__( **kwargs, ): """ - Updated host map. + Deprecated - Legacy metric-based host map request. Use the infrastructure-backed ( ``request_type: infrastructure_hostmap`` ) or DDSQL ( ``request_type: data_projection`` ) format instead. :param apm_query: The log query. :type apm_query: LogQueryDefinition, optional diff --git a/src/datadog_api_client/v1/model/host_map_widget_definition.py b/src/datadog_api_client/v1/model/host_map_widget_definition.py index 43b8f9a205..6cd41d6c71 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_definition.py +++ b/src/datadog_api_client/v1/model/host_map_widget_definition.py @@ -93,13 +93,13 @@ def __init__( :param description: The description of the widget. :type description: str, optional - :param group: List of tag prefixes to group by. + :param group: Deprecated - Only used by the legacy metric-based format. Use ``group_by`` (infrastructure) or a ``group`` dimension (DDSQL) inside ``requests`` instead. **Deprecated**. :type group: [str], optional - :param no_group_hosts: Whether to show the hosts that don’t fit in a group. + :param no_group_hosts: Deprecated - Only used by the legacy metric-based format. Use ``no_group_hosts`` inside ``requests`` instead. **Deprecated**. :type no_group_hosts: bool, optional - :param no_metric_hosts: Whether to show the hosts with no metrics. + :param no_metric_hosts: Deprecated - Only used by the legacy metric-based format. Use ``no_metric_hosts`` inside ``requests`` instead. **Deprecated**. :type no_metric_hosts: bool, optional :param node_type: Which type of node to use in the map. @@ -108,13 +108,13 @@ def __init__( :param notes: Notes on the title. :type notes: str, optional - :param requests: Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of ``request_type`` : the legacy metric-based format ( ``fill`` / ``size`` ) and the infrastructure-backed format ( ``request_type`` , ``node_type`` , ``enrichments`` ). + :param requests: Query definition for the host map widget. Supports three mutually exclusive formats distinguished by `request_type`: the deprecated legacy metric-based format (`fill`/`size`, no `request_type`), the infrastructure-backed format (`request_type: infrastructure_hostmap ``), and the DDSQL published-dataset format (`` request_type: data_projection`). :type requests: HostMapWidgetDefinitionRequests - :param scope: List of tags used to filter the map. + :param scope: Deprecated - Only used by the legacy metric-based format. Use ``filter`` inside ``requests`` instead. **Deprecated**. :type scope: [str], optional - :param style: The style to apply to the widget. + :param style: Deprecated - The style to apply to the legacy metric-based host map widget. Use ``HostMapWidgetInfrastructureStyle`` instead. **Deprecated**. :type style: HostMapWidgetDefinitionStyle, optional :param title: Title of the widget. diff --git a/src/datadog_api_client/v1/model/host_map_widget_definition_request_type.py b/src/datadog_api_client/v1/model/host_map_widget_definition_request_type.py new file mode 100644 index 0000000000..0100ee32ce --- /dev/null +++ b/src/datadog_api_client/v1/model/host_map_widget_definition_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 HostMapWidgetDefinitionRequestType(ModelSimple): + """ + Identifies which host map request format the sibling fields on `HostMapWidgetDefinitionRequests` describe: an infrastructure-backed request or a DDSQL published-dataset request. + + :param value: Must be one of ["infrastructure_hostmap", "data_projection"]. + :type value: str + """ + + allowed_values = { + "infrastructure_hostmap", + "data_projection", + } + INFRASTRUCTURE_HOSTMAP: ClassVar["HostMapWidgetDefinitionRequestType"] + DATA_PROJECTION: ClassVar["HostMapWidgetDefinitionRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +HostMapWidgetDefinitionRequestType.INFRASTRUCTURE_HOSTMAP = HostMapWidgetDefinitionRequestType("infrastructure_hostmap") +HostMapWidgetDefinitionRequestType.DATA_PROJECTION = HostMapWidgetDefinitionRequestType("data_projection") diff --git a/src/datadog_api_client/v1/model/host_map_widget_definition_requests.py b/src/datadog_api_client/v1/model/host_map_widget_definition_requests.py index a0b7df51a5..796647915a 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_definition_requests.py +++ b/src/datadog_api_client/v1/model/host_map_widget_definition_requests.py @@ -20,9 +20,9 @@ from datadog_api_client.v1.model.host_map_request import HostMapRequest from datadog_api_client.v1.model.host_map_widget_group_by import HostMapWidgetGroupBy from datadog_api_client.v1.model.host_map_widget_node_type import HostMapWidgetNodeType - from datadog_api_client.v1.model.host_map_widget_infrastructure_request_request_type import ( - HostMapWidgetInfrastructureRequestRequestType, - ) + from datadog_api_client.v1.model.host_map_widget_projection import HostMapWidgetProjection + from datadog_api_client.v1.model.dataset_list_query import DatasetListQuery + from datadog_api_client.v1.model.host_map_widget_definition_request_type import HostMapWidgetDefinitionRequestType from datadog_api_client.v1.model.host_map_widget_infrastructure_style import HostMapWidgetInfrastructureStyle @@ -37,8 +37,10 @@ def openapi_types(_): from datadog_api_client.v1.model.host_map_request import HostMapRequest from datadog_api_client.v1.model.host_map_widget_group_by import HostMapWidgetGroupBy from datadog_api_client.v1.model.host_map_widget_node_type import HostMapWidgetNodeType - from datadog_api_client.v1.model.host_map_widget_infrastructure_request_request_type import ( - HostMapWidgetInfrastructureRequestRequestType, + from datadog_api_client.v1.model.host_map_widget_projection import HostMapWidgetProjection + from datadog_api_client.v1.model.dataset_list_query import DatasetListQuery + from datadog_api_client.v1.model.host_map_widget_definition_request_type import ( + HostMapWidgetDefinitionRequestType, ) from datadog_api_client.v1.model.host_map_widget_infrastructure_style import HostMapWidgetInfrastructureStyle @@ -49,10 +51,13 @@ def openapi_types(_): "fill": (HostMapRequest,), "filter": (str,), "group_by": ([HostMapWidgetGroupBy],), + "limit": (int,), "no_group_hosts": (bool,), "no_metric_hosts": (bool,), "node_type": (HostMapWidgetNodeType,), - "request_type": (HostMapWidgetInfrastructureRequestRequestType,), + "projection": (HostMapWidgetProjection,), + "query": (DatasetListQuery,), + "request_type": (HostMapWidgetDefinitionRequestType,), "size": (HostMapRequest,), "style": (HostMapWidgetInfrastructureStyle,), } @@ -64,9 +69,12 @@ def openapi_types(_): "fill": "fill", "filter": "filter", "group_by": "group_by", + "limit": "limit", "no_group_hosts": "no_group_hosts", "no_metric_hosts": "no_metric_hosts", "node_type": "node_type", + "projection": "projection", + "query": "query", "request_type": "request_type", "size": "size", "style": "style", @@ -80,16 +88,19 @@ def __init__( fill: Union[HostMapRequest, UnsetType] = unset, filter: Union[str, UnsetType] = unset, group_by: Union[List[HostMapWidgetGroupBy], UnsetType] = unset, + limit: Union[int, UnsetType] = unset, no_group_hosts: Union[bool, UnsetType] = unset, no_metric_hosts: Union[bool, UnsetType] = unset, node_type: Union[HostMapWidgetNodeType, UnsetType] = unset, - request_type: Union[HostMapWidgetInfrastructureRequestRequestType, UnsetType] = unset, + projection: Union[HostMapWidgetProjection, UnsetType] = unset, + query: Union[DatasetListQuery, UnsetType] = unset, + request_type: Union[HostMapWidgetDefinitionRequestType, UnsetType] = unset, size: Union[HostMapRequest, UnsetType] = unset, style: Union[HostMapWidgetInfrastructureStyle, UnsetType] = unset, **kwargs, ): """ - Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of ``request_type`` : the legacy metric-based format ( ``fill`` / ``size`` ) and the infrastructure-backed format ( ``request_type`` , ``node_type`` , ``enrichments`` ). + Query definition for the host map widget. Supports three mutually exclusive formats distinguished by `request_type`: the deprecated legacy metric-based format (`fill`/`size`, no `request_type`), the infrastructure-backed format (`request_type: infrastructure_hostmap ``), and the DDSQL published-dataset format (`` request_type: data_projection`). :param child: Infrastructure-backed request for the host map widget. Supports entity-based visualization with metric query enrichments, tag-based filtering, flexible grouping, @@ -99,19 +110,22 @@ def __init__( :param conditional_formats: List of conditional formatting rules applied to fill values. :type conditional_formats: [WidgetConditionalFormat], optional - :param enrichments: Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + :param enrichments: Metric or event queries joined to the entity set. Each formula specifies a visual dimension. Only used by the infrastructure-backed format. :type enrichments: [HostMapWidgetScalarRequest], optional - :param fill: Updated host map. + :param fill: Deprecated - Legacy metric-based host map request. Use the infrastructure-backed ( ``request_type: infrastructure_hostmap`` ) or DDSQL ( ``request_type: data_projection`` ) format instead. **Deprecated**. :type fill: HostMapRequest, optional - :param filter: Filter string for the entity set in tag format (for example, ``env:prod`` ). + :param filter: Filter string for the entity set in tag format (for example, ``env:prod`` ). Only used by the infrastructure-backed format. :type filter: str, optional :param group_by: Defines how entities are grouped into tiles. The ordering of entries implies - the grouping hierarchy. + the grouping hierarchy. Only used by the infrastructure-backed format. :type group_by: [HostMapWidgetGroupBy], optional + :param limit: Maximum number of rows to return from the dataset query. Only used by the DDSQL format. + :type limit: int, optional + :param no_group_hosts: Whether to hide entities that have no group assignment. :type no_group_hosts: bool, optional @@ -121,10 +135,16 @@ def __init__( :param node_type: Which type of infrastructure entity to visualize in the host map. :type node_type: HostMapWidgetNodeType, optional - :param request_type: Identifies this as an infrastructure-backed host map request. - :type request_type: HostMapWidgetInfrastructureRequestRequestType, optional + :param projection: Projection for the DDSQL host map request. Maps dataset columns to map dimensions: ``node`` identifies the entity, repeated ``group`` entries define the grouping hierarchy (outermost first), and ``fill`` / ``size`` drive the tile color and size. + :type projection: HostMapWidgetProjection, optional + + :param query: Query that lists the rows of a published dataset (a DDSQL query) without aggregation. + :type query: DatasetListQuery, optional + + :param request_type: Identifies which host map request format the sibling fields on ``HostMapWidgetDefinitionRequests`` describe: an infrastructure-backed request or a DDSQL published-dataset request. + :type request_type: HostMapWidgetDefinitionRequestType, optional - :param size: Updated host map. + :param size: Deprecated - Legacy metric-based host map request. Use the infrastructure-backed ( ``request_type: infrastructure_hostmap`` ) or DDSQL ( ``request_type: data_projection`` ) format instead. **Deprecated**. :type size: HostMapRequest, optional :param style: Style configuration for the infrastructure host map. @@ -142,12 +162,18 @@ def __init__( kwargs["filter"] = filter if group_by is not unset: kwargs["group_by"] = group_by + if limit is not unset: + kwargs["limit"] = limit if no_group_hosts is not unset: kwargs["no_group_hosts"] = no_group_hosts if no_metric_hosts is not unset: kwargs["no_metric_hosts"] = no_metric_hosts if node_type is not unset: kwargs["node_type"] = node_type + if projection is not unset: + kwargs["projection"] = projection + if query is not unset: + kwargs["query"] = query if request_type is not unset: kwargs["request_type"] = request_type if size is not unset: diff --git a/src/datadog_api_client/v1/model/host_map_widget_definition_style.py b/src/datadog_api_client/v1/model/host_map_widget_definition_style.py index 1e938863bc..dfa6ab9b12 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_definition_style.py +++ b/src/datadog_api_client/v1/model/host_map_widget_definition_style.py @@ -39,7 +39,7 @@ def __init__( **kwargs, ): """ - The style to apply to the widget. + Deprecated - The style to apply to the legacy metric-based host map widget. Use ``HostMapWidgetInfrastructureStyle`` instead. :param fill_max: Max value to use to color the map. :type fill_max: str, optional diff --git a/src/datadog_api_client/v1/model/host_map_widget_dimension.py b/src/datadog_api_client/v1/model/host_map_widget_dimension.py index 6a84462b67..f5ee567e8b 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_dimension.py +++ b/src/datadog_api_client/v1/model/host_map_widget_dimension.py @@ -14,9 +14,9 @@ class HostMapWidgetDimension(ModelSimple): """ - Visual dimension driven by a formula in the infrastructure host map widget. + Visual dimension for the host map widget. Used both by infrastructure-backed formulas and by DDSQL projection columns; `group` is only meaningful for DDSQL projection columns, where repeated entries define the grouping hierarchy. - :param value: Must be one of ["node", "fill", "size"]. + :param value: Must be one of ["node", "fill", "size", "group"]. :type value: str """ @@ -24,10 +24,12 @@ class HostMapWidgetDimension(ModelSimple): "node", "fill", "size", + "group", } NODE: ClassVar["HostMapWidgetDimension"] FILL: ClassVar["HostMapWidgetDimension"] SIZE: ClassVar["HostMapWidgetDimension"] + GROUP: ClassVar["HostMapWidgetDimension"] @cached_property def openapi_types(_): @@ -39,3 +41,4 @@ def openapi_types(_): HostMapWidgetDimension.NODE = HostMapWidgetDimension("node") HostMapWidgetDimension.FILL = HostMapWidgetDimension("fill") HostMapWidgetDimension.SIZE = HostMapWidgetDimension("size") +HostMapWidgetDimension.GROUP = HostMapWidgetDimension("group") diff --git a/src/datadog_api_client/v1/model/host_map_widget_formula.py b/src/datadog_api_client/v1/model/host_map_widget_formula.py index 51dcc094a6..26b90af7f5 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_formula.py +++ b/src/datadog_api_client/v1/model/host_map_widget_formula.py @@ -53,7 +53,7 @@ def __init__( :param alias: Expression alias. :type alias: str, optional - :param dimension: Visual dimension driven by a formula in the infrastructure host map widget. + :param dimension: Visual dimension for the host map widget. Used both by infrastructure-backed formulas and by DDSQL projection columns; ``group`` is only meaningful for DDSQL projection columns, where repeated entries define the grouping hierarchy. :type dimension: HostMapWidgetDimension :param formula: String expression built from queries, formulas, and functions. diff --git a/src/datadog_api_client/v1/model/host_map_widget_projection.py b/src/datadog_api_client/v1/model/host_map_widget_projection.py new file mode 100644 index 0000000000..83ff8ae943 --- /dev/null +++ b/src/datadog_api_client/v1/model/host_map_widget_projection.py @@ -0,0 +1,54 @@ +# 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.host_map_widget_projection_dimension_mapping import ( + HostMapWidgetProjectionDimensionMapping, + ) + from datadog_api_client.v1.model.host_map_widget_projection_type import HostMapWidgetProjectionType + + +class HostMapWidgetProjection(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.host_map_widget_projection_dimension_mapping import ( + HostMapWidgetProjectionDimensionMapping, + ) + from datadog_api_client.v1.model.host_map_widget_projection_type import HostMapWidgetProjectionType + + return { + "dimensions": ([HostMapWidgetProjectionDimensionMapping],), + "type": (HostMapWidgetProjectionType,), + } + + attribute_map = { + "dimensions": "dimensions", + "type": "type", + } + + def __init__( + self_, dimensions: List[HostMapWidgetProjectionDimensionMapping], type: HostMapWidgetProjectionType, **kwargs + ): + """ + Projection for the DDSQL host map request. Maps dataset columns to map dimensions: ``node`` identifies the entity, repeated ``group`` entries define the grouping hierarchy (outermost first), and ``fill`` / ``size`` drive the tile color and size. + + :param dimensions: List of column-to-dimension mappings for the projection. + :type dimensions: [HostMapWidgetProjectionDimensionMapping] + + :param type: Type of the host map projection. + :type type: HostMapWidgetProjectionType + """ + super().__init__(kwargs) + + self_.dimensions = dimensions + self_.type = type diff --git a/src/datadog_api_client/v1/model/host_map_widget_projection_dimension_mapping.py b/src/datadog_api_client/v1/model/host_map_widget_projection_dimension_mapping.py new file mode 100644 index 0000000000..d1b6c3b283 --- /dev/null +++ b/src/datadog_api_client/v1/model/host_map_widget_projection_dimension_mapping.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.host_map_widget_dimension import HostMapWidgetDimension + from datadog_api_client.v1.model.widget_number_format import WidgetNumberFormat + + +class HostMapWidgetProjectionDimensionMapping(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.host_map_widget_dimension import HostMapWidgetDimension + from datadog_api_client.v1.model.widget_number_format import WidgetNumberFormat + + return { + "alias": (str,), + "column": (str,), + "dimension": (HostMapWidgetDimension,), + "number_format": (WidgetNumberFormat,), + } + + attribute_map = { + "alias": "alias", + "column": "column", + "dimension": "dimension", + "number_format": "number_format", + } + + def __init__( + self_, + column: str, + dimension: HostMapWidgetDimension, + alias: Union[str, UnsetType] = unset, + number_format: Union[WidgetNumberFormat, UnsetType] = unset, + **kwargs, + ): + """ + Maps a dataset column to a host map visual dimension. + + :param alias: Alias used to label the column instead of its name. + :type alias: str, optional + + :param column: Source column name from the dataset. + :type column: str + + :param dimension: Visual dimension for the host map widget. Used both by infrastructure-backed formulas and by DDSQL projection columns; ``group`` is only meaningful for DDSQL projection columns, where repeated entries define the grouping hierarchy. + :type dimension: HostMapWidgetDimension + + :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/host_map_widget_projection_type.py b/src/datadog_api_client/v1/model/host_map_widget_projection_type.py new file mode 100644 index 0000000000..2169071669 --- /dev/null +++ b/src/datadog_api_client/v1/model/host_map_widget_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 HostMapWidgetProjectionType(ModelSimple): + """ + Type of the host map projection. + + :param value: If omitted defaults to "hostmap". Must be one of ["hostmap"]. + :type value: str + """ + + allowed_values = { + "hostmap", + } + HOSTMAP: ClassVar["HostMapWidgetProjectionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +HostMapWidgetProjectionType.HOSTMAP = HostMapWidgetProjectionType("hostmap") diff --git a/src/datadog_api_client/v1/model/published_dataset_provider.py b/src/datadog_api_client/v1/model/published_dataset_provider.py new file mode 100644 index 0000000000..609ffebd6d --- /dev/null +++ b/src/datadog_api_client/v1/model/published_dataset_provider.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 PublishedDatasetProvider(ModelSimple): + """ + Product page that published the dataset queried by a `DatasetListQuery`. `ddsql_query` is the only provider currently supported for host map widgets. + + :param value: If omitted defaults to "ddsql_query". Must be one of ["ddsql_query"]. + :type value: str + """ + + allowed_values = { + "ddsql_query", + } + DDSQL_QUERY: ClassVar["PublishedDatasetProvider"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PublishedDatasetProvider.DDSQL_QUERY = PublishedDatasetProvider("ddsql_query") diff --git a/src/datadog_api_client/v1/model/widget_definition.py b/src/datadog_api_client/v1/model/widget_definition.py index 6ceb2b0cca..8d4b3a9849 100644 --- a/src/datadog_api_client/v1/model/widget_definition.py +++ b/src/datadog_api_client/v1/model/widget_definition.py @@ -129,10 +129,10 @@ def __init__(self, **kwargs): :param events: List of widget events. Deprecated - Use `overlay` request type instead. :type events: [WidgetEvent], optional - :param no_group_hosts: Whether to show the hosts that don’t fit in a group. + :param no_group_hosts: Deprecated - Only used by the legacy metric-based format. Use `no_group_hosts` inside `requests` instead. :type no_group_hosts: bool, optional - :param no_metric_hosts: Whether to show the hosts with no metrics. + :param no_metric_hosts: Deprecated - Only used by the legacy metric-based format. Use `no_metric_hosts` inside `requests` instead. :type no_metric_hosts: bool, optional :param node_type: Which type of node to use in the map. @@ -141,7 +141,7 @@ def __init__(self, **kwargs): :param notes: Notes on the title. :type notes: str, optional - :param scope: List of tags used to filter the map. + :param scope: Deprecated - Only used by the legacy metric-based format. Use `filter` inside `requests` instead. :type scope: [str], optional :param url: URL of the iframe. diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 0611a0942c..d93d02afc8 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -99,6 +99,10 @@ from datadog_api_client.v1.model.dashboard_type import DashboardType from datadog_api_client.v1.model.data_projection_query import DataProjectionQuery from datadog_api_client.v1.model.data_projection_request_type import DataProjectionRequestType +from datadog_api_client.v1.model.dataset_list_query import DatasetListQuery +from datadog_api_client.v1.model.dataset_list_query_data_source_type import DatasetListQueryDataSourceType +from datadog_api_client.v1.model.dataset_list_query_sort import DatasetListQuerySort +from datadog_api_client.v1.model.dataset_list_query_sort_field import DatasetListQuerySortField from datadog_api_client.v1.model.delete_shared_dashboard_response import DeleteSharedDashboardResponse from datadog_api_client.v1.model.deleted_monitor import DeletedMonitor from datadog_api_client.v1.model.distribution_point import DistributionPoint @@ -257,6 +261,7 @@ from datadog_api_client.v1.model.host_list_response import HostListResponse from datadog_api_client.v1.model.host_map_request import HostMapRequest from datadog_api_client.v1.model.host_map_widget_definition import HostMapWidgetDefinition +from datadog_api_client.v1.model.host_map_widget_definition_request_type import HostMapWidgetDefinitionRequestType from datadog_api_client.v1.model.host_map_widget_definition_requests import HostMapWidgetDefinitionRequests from datadog_api_client.v1.model.host_map_widget_definition_style import HostMapWidgetDefinitionStyle from datadog_api_client.v1.model.host_map_widget_definition_type import HostMapWidgetDefinitionType @@ -272,6 +277,11 @@ ) from datadog_api_client.v1.model.host_map_widget_infrastructure_style import HostMapWidgetInfrastructureStyle from datadog_api_client.v1.model.host_map_widget_node_type import HostMapWidgetNodeType +from datadog_api_client.v1.model.host_map_widget_projection import HostMapWidgetProjection +from datadog_api_client.v1.model.host_map_widget_projection_dimension_mapping import ( + HostMapWidgetProjectionDimensionMapping, +) +from datadog_api_client.v1.model.host_map_widget_projection_type import HostMapWidgetProjectionType from datadog_api_client.v1.model.host_map_widget_scalar_request import HostMapWidgetScalarRequest from datadog_api_client.v1.model.host_map_widget_scalar_request_response_format import ( HostMapWidgetScalarRequestResponseFormat, @@ -697,6 +707,7 @@ from datadog_api_client.v1.model.product_analytics_funnel_widget_definition import ( ProductAnalyticsFunnelWidgetDefinition, ) +from datadog_api_client.v1.model.published_dataset_provider import PublishedDatasetProvider from datadog_api_client.v1.model.query_sort_order import QuerySortOrder from datadog_api_client.v1.model.query_value_widget_comparison import QueryValueWidgetComparison from datadog_api_client.v1.model.query_value_widget_comparison_directionality import ( @@ -1506,6 +1517,10 @@ "DashboardType", "DataProjectionQuery", "DataProjectionRequestType", + "DatasetListQuery", + "DatasetListQueryDataSourceType", + "DatasetListQuerySort", + "DatasetListQuerySortField", "DeleteSharedDashboardResponse", "DeletedMonitor", "DistributionPoint", @@ -1614,6 +1629,7 @@ "HostListResponse", "HostMapRequest", "HostMapWidgetDefinition", + "HostMapWidgetDefinitionRequestType", "HostMapWidgetDefinitionRequests", "HostMapWidgetDefinitionStyle", "HostMapWidgetDefinitionType", @@ -1625,6 +1641,9 @@ "HostMapWidgetInfrastructureRequestRequestType", "HostMapWidgetInfrastructureStyle", "HostMapWidgetNodeType", + "HostMapWidgetProjection", + "HostMapWidgetProjectionDimensionMapping", + "HostMapWidgetProjectionType", "HostMapWidgetScalarRequest", "HostMapWidgetScalarRequestResponseFormat", "HostMeta", @@ -1958,6 +1977,7 @@ "ProductAnalyticsFunnelRequest", "ProductAnalyticsFunnelRequestType", "ProductAnalyticsFunnelWidgetDefinition", + "PublishedDatasetProvider", "QuerySortOrder", "QueryValueWidgetComparison", "QueryValueWidgetComparisonDirectionality", diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_hostmap_ddsql_widget.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_hostmap_ddsql_widget.frozen new file mode 100644 index 0000000000..932b74391e --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_hostmap_ddsql_widget.frozen @@ -0,0 +1 @@ +2026-07-08T15:57:41.949Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_hostmap_ddsql_widget.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_hostmap_ddsql_widget.yaml new file mode 100644 index 0000000000..89518fce7e --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_hostmap_ddsql_widget.yaml @@ -0,0 +1,37 @@ +interactions: +- request: + body: '{"description":null,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_hostmap_DDSQL_widget-1783526261","widgets":[{"definition":{"requests":{"limit":1000,"projection":{"dimensions":[{"column":"entity_id","dimension":"node"},{"column":"parent_id","dimension":"group"},{"column":"cpu_usage","dimension":"fill"}],"type":"hostmap"},"query":{"data_source":"dataset","dataset_id":"abc-123-def","dataset_provider":"ddsql_query"},"request_type":"data_projection","style":{"palette":"green_to_orange","palette_flip":false}},"title":"","title_align":"left","title_size":"16","type":"hostmap"},"layout":{"height":22,"width":47,"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":"ei8-bm4-cy2","title":"Test-Create_a_new_dashboard_with_hostmap_DDSQL_widget-1783526261","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"free","url":"/dashboard/ei8-bm4-cy2/test-createanewdashboardwithhostmapddsqlwidget-1783526261","template_variables":[],"widgets":[{"definition":{"requests":{"limit":1000,"projection":{"dimensions":[{"column":"entity_id","dimension":"node"},{"column":"parent_id","dimension":"group"},{"column":"cpu_usage","dimension":"fill"}],"type":"hostmap"},"query":{"data_source":"dataset","dataset_id":"abc-123-def","dataset_provider":"ddsql_query"},"request_type":"data_projection","style":{"palette":"green_to_orange","palette_flip":false}},"title":"","title_align":"left","title_size":"16","type":"hostmap"},"layout":{"height":22,"width":47,"x":0,"y":0},"id":2962556261296626}],"notify_list":[],"created_at":"2026-07-08T15:57:42.209375+00:00","modified_at":"2026-07-08T15:57:42.209375+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/ei8-bm4-cy2 + response: + body: + string: '{"deleted_dashboard_id":"ei8-bm4-cy2"}' + 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 42df30e0a6..28e57ec5e2 100644 --- a/tests/v1/features/dashboards.feature +++ b/tests/v1/features/dashboards.feature @@ -581,6 +581,15 @@ Feature: Dashboards And the response "widgets[0].definition.xaxis.num_buckets" is equal to 75 And the response "widgets[0].definition.markers" is equal to [{"display_type": "percentile", "value": "50"}, {"display_type": "percentile", "value": "99"}] + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with hostmap DDSQL widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/hostmap_ddsql_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "hostmap" + And the response "widgets[0].definition.requests" is equal to {"request_type": "data_projection", "limit": 1000, "query": {"data_source": "dataset", "dataset_provider": "ddsql_query", "dataset_id": "abc-123-def"}, "projection": {"type": "hostmap", "dimensions": [{"column": "entity_id", "dimension": "node"}, {"column": "parent_id", "dimension": "group"}, {"column": "cpu_usage", "dimension": "fill"}]}, "style": {"palette": "green_to_orange", "palette_flip": false}} + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with hostmap infra widget Given new "CreateDashboard" request diff --git a/tests/v1/features/dashboards_json_payload/hostmap_ddsql_widget.json b/tests/v1/features/dashboards_json_payload/hostmap_ddsql_widget.json new file mode 100644 index 0000000000..51cc5936b8 --- /dev/null +++ b/tests/v1/features/dashboards_json_payload/hostmap_ddsql_widget.json @@ -0,0 +1,57 @@ +{ + "title":"{{ unique }}", + "description":null, + "widgets":[ + { + "layout":{ + "x":0, + "y":0, + "width":47, + "height":22 + }, + "definition":{ + "title":"", + "title_size":"16", + "title_align":"left", + "type":"hostmap", + "requests":{ + "request_type":"data_projection", + "limit":1000, + "query":{ + "data_source":"dataset", + "dataset_provider":"ddsql_query", + "dataset_id":"abc-123-def" + }, + "projection":{ + "type":"hostmap", + "dimensions":[ + { + "column":"entity_id", + "dimension":"node" + }, + { + "column":"parent_id", + "dimension":"group" + }, + { + "column":"cpu_usage", + "dimension":"fill" + } + ] + }, + "style":{ + "palette":"green_to_orange", + "palette_flip":false + } + } + } + } + ], + "template_variables":[ + + ], + "layout_type":"free", + "notify_list":[ + + ] +} diff --git a/tests/v1/features/monitors.feature b/tests/v1/features/monitors.feature index eabe7b2afe..2a34a879f7 100644 --- a/tests/v1/features/monitors.feature +++ b/tests/v1/features/monitors.feature @@ -219,7 +219,7 @@ Feature: Monitors Scenario: Edit a monitor returns "Bad Request" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "REPLACE.ME" - And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_query": "formula(\"2 * query1\").rollup(\"avg\").last(\"6mo\")", "critical_recovery": null, "critical_recovery_query": "formula(\"1.5 * query1\").rollup(\"avg\").last(\"3mo\")", "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"} + And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_query": "formula(\"2 * query1\").rollup(\"avg\").last(\"6mo\")", "critical_recovery": null, "critical_recovery_query": "formula(\"1.5 * query1\").rollup(\"avg\").last(\"3mo\")", "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "asc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"} When the request is sent Then the response status is 400 Bad Request