Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23742,6 +23742,7 @@ components:
- $ref: "#/components/schemas/ToplistWidgetDefinition"
- $ref: "#/components/schemas/TopologyMapWidgetDefinition"
- $ref: "#/components/schemas/TreeMapWidgetDefinition"
- $ref: "#/components/schemas/WildcardWidgetDefinition"
WidgetDisplayType:
description: Type of display to use for the request.
enum:
Expand Down Expand Up @@ -24513,6 +24514,81 @@ components:
x-enum-varnames:
- TIMESERIES
- TOPLIST
WildcardWidgetDefinition:
description: >-
Custom visualization widget using Vega or Vega-Lite specifications. Combines standard Datadog data requests with a Vega or Vega-Lite JSON specification for flexible, custom visualizations.
properties:
custom_links:
description: List of custom links.
items:
$ref: "#/components/schemas/WidgetCustomLink"
type: array
requests:
description: List of data requests for the wildcard widget.
example: [{"formulas": ["formula": "query1"], "queries": [{"aggregator": "avg", "data_source": "metrics", "name": "query1", "query": "avg:system.cpu.user{*} by {env}"}], "response_format": "scalar"}]
items:
$ref: "#/components/schemas/WildcardWidgetRequest"
type: array
specification:
$ref: "#/components/schemas/WildcardWidgetSpecification"
time:
$ref: "#/components/schemas/WidgetTime"
title:
description: Title of the widget.
type: string
title_align:
$ref: "#/components/schemas/WidgetTextAlign"
title_size:
description: Size of the title.
type: string
type:
$ref: "#/components/schemas/WildcardWidgetDefinitionType"
required:
- type
- requests
- specification
type: object
WildcardWidgetDefinitionType:
default: wildcard
description: Type of the wildcard widget.
enum:
- wildcard
example: wildcard
type: string
x-enum-varnames:
- WILDCARD
WildcardWidgetRequest:
description: >-
Request object for the wildcard widget. Each variant represents a distinct data-fetching pattern: scalar formulas, timeseries formulas, list streams, and histograms.
oneOf:
- $ref: "#/components/schemas/TreeMapWidgetRequest"
- $ref: "#/components/schemas/TimeseriesWidgetRequest"
- $ref: "#/components/schemas/ListStreamWidgetRequest"
- $ref: "#/components/schemas/DistributionWidgetRequest"
WildcardWidgetSpecification:
description: >-
Vega or Vega-Lite specification for custom visualization rendering. See https://vega.github.io/vega-lite/ for the full grammar reference.
properties:
contents:
description: The Vega or Vega-Lite JSON specification object.
example: {"$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": {"name": "table1"}, "description": "A simple bar chart", "encoding": {"x": {"field": "env", "sort": "-y", "type": "nominal"}, "y": {"field": "query1", "type": "quantitative"}}, "mark": "bar"}
type: object
type:
$ref: "#/components/schemas/WildcardWidgetSpecificationType"
required:
- type
- contents
type: object
WildcardWidgetSpecificationType:
description: Type of specification used by the wildcard widget.
enum:
- vega
- vega-lite
example: vega-lite
type: string
x-enum-varnames:
- VEGA
- VEGA_LITE
securitySchemes:
AuthZ:
description: This API uses OAuth 2 with the implicit grant flow.
Expand Down
35 changes: 35 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7088,6 +7088,41 @@ datadog\_api\_client.v1.model.widget\_viz\_type module
:members:
:show-inheritance:

datadog\_api\_client.v1.model.wildcard\_widget\_definition module
-----------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.wildcard_widget_definition
:members:
:show-inheritance:

datadog\_api\_client.v1.model.wildcard\_widget\_definition\_type module
-----------------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.wildcard_widget_definition_type
:members:
:show-inheritance:

datadog\_api\_client.v1.model.wildcard\_widget\_request module
--------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.wildcard_widget_request
:members:
:show-inheritance:

datadog\_api\_client.v1.model.wildcard\_widget\_specification module
--------------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.wildcard_widget_specification
:members:
:show-inheritance:

datadog\_api\_client.v1.model.wildcard\_widget\_specification\_type module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.wildcard_widget_specification_type
:members:
:show-inheritance:

Module contents
---------------

Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v1/model/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from datadog_api_client.v1.model.toplist_widget_definition import ToplistWidgetDefinition
from datadog_api_client.v1.model.topology_map_widget_definition import TopologyMapWidgetDefinition
from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition
from datadog_api_client.v1.model.wildcard_widget_definition import WildcardWidgetDefinition


class Widget(ModelNormal):
Expand Down Expand Up @@ -110,6 +111,7 @@ def __init__(
ToplistWidgetDefinition,
TopologyMapWidgetDefinition,
TreeMapWidgetDefinition,
WildcardWidgetDefinition,
],
id: Union[int, UnsetType] = unset,
layout: Union[WidgetLayout, UnsetType] = unset,
Expand Down
5 changes: 5 additions & 0 deletions src/datadog_api_client/v1/model/widget_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ def __init__(self, **kwargs):

:param size_by: (deprecated) The attribute formerly used to determine size in the widget.
:type size_by: TreeMapSizeBy, optional

:param specification: Vega or Vega-Lite specification for custom visualization rendering. See https://vega.github.io/vega-lite/ for the full grammar reference.
:type specification: WildcardWidgetSpecification
"""
super().__init__(kwargs)

Expand Down Expand Up @@ -384,6 +387,7 @@ def _composed_schemas(_):
from datadog_api_client.v1.model.toplist_widget_definition import ToplistWidgetDefinition
from datadog_api_client.v1.model.topology_map_widget_definition import TopologyMapWidgetDefinition
from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition
from datadog_api_client.v1.model.wildcard_widget_definition import WildcardWidgetDefinition

return {
"oneOf": [
Expand Down Expand Up @@ -422,5 +426,6 @@ def _composed_schemas(_):
ToplistWidgetDefinition,
TopologyMapWidgetDefinition,
TreeMapWidgetDefinition,
WildcardWidgetDefinition,
],
}
125 changes: 125 additions & 0 deletions src/datadog_api_client/v1/model/wildcard_widget_definition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# 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.widget_custom_link import WidgetCustomLink
from datadog_api_client.v1.model.wildcard_widget_request import WildcardWidgetRequest
from datadog_api_client.v1.model.wildcard_widget_specification import WildcardWidgetSpecification
from datadog_api_client.v1.model.widget_time import WidgetTime
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
from datadog_api_client.v1.model.wildcard_widget_definition_type import WildcardWidgetDefinitionType
from datadog_api_client.v1.model.tree_map_widget_request import TreeMapWidgetRequest
from datadog_api_client.v1.model.timeseries_widget_request import TimeseriesWidgetRequest
from datadog_api_client.v1.model.list_stream_widget_request import ListStreamWidgetRequest
from datadog_api_client.v1.model.distribution_widget_request import DistributionWidgetRequest
from datadog_api_client.v1.model.widget_legacy_live_span import WidgetLegacyLiveSpan
from datadog_api_client.v1.model.widget_new_live_span import WidgetNewLiveSpan
from datadog_api_client.v1.model.widget_new_fixed_span import WidgetNewFixedSpan


class WildcardWidgetDefinition(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink
from datadog_api_client.v1.model.wildcard_widget_request import WildcardWidgetRequest
from datadog_api_client.v1.model.wildcard_widget_specification import WildcardWidgetSpecification
from datadog_api_client.v1.model.widget_time import WidgetTime
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
from datadog_api_client.v1.model.wildcard_widget_definition_type import WildcardWidgetDefinitionType

return {
"custom_links": ([WidgetCustomLink],),
"requests": ([WildcardWidgetRequest],),
"specification": (WildcardWidgetSpecification,),
"time": (WidgetTime,),
"title": (str,),
"title_align": (WidgetTextAlign,),
"title_size": (str,),
"type": (WildcardWidgetDefinitionType,),
}

attribute_map = {
"custom_links": "custom_links",
"requests": "requests",
"specification": "specification",
"time": "time",
"title": "title",
"title_align": "title_align",
"title_size": "title_size",
"type": "type",
}

def __init__(
self_,
requests: List[
Union[
WildcardWidgetRequest,
TreeMapWidgetRequest,
TimeseriesWidgetRequest,
ListStreamWidgetRequest,
DistributionWidgetRequest,
]
],
specification: WildcardWidgetSpecification,
type: WildcardWidgetDefinitionType,
custom_links: Union[List[WidgetCustomLink], UnsetType] = unset,
time: Union[WidgetTime, WidgetLegacyLiveSpan, WidgetNewLiveSpan, WidgetNewFixedSpan, UnsetType] = unset,
title: Union[str, UnsetType] = unset,
title_align: Union[WidgetTextAlign, UnsetType] = unset,
title_size: Union[str, UnsetType] = unset,
**kwargs,
):
"""
Custom visualization widget using Vega or Vega-Lite specifications. Combines standard Datadog data requests with a Vega or Vega-Lite JSON specification for flexible, custom visualizations.

:param custom_links: List of custom links.
:type custom_links: [WidgetCustomLink], optional

:param requests: List of data requests for the wildcard widget.
:type requests: [WildcardWidgetRequest]

:param specification: Vega or Vega-Lite specification for custom visualization rendering. See https://vega.github.io/vega-lite/ for the full grammar reference.
:type specification: WildcardWidgetSpecification

: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 wildcard widget.
:type type: WildcardWidgetDefinitionType
"""
if custom_links is not unset:
kwargs["custom_links"] = custom_links
if time is not unset:
kwargs["time"] = time
if title is not unset:
kwargs["title"] = title
if title_align is not unset:
kwargs["title_align"] = title_align
if title_size is not unset:
kwargs["title_size"] = title_size
super().__init__(kwargs)

self_.requests = requests
self_.specification = specification
self_.type = type
Original file line number Diff line number Diff line change
@@ -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 WildcardWidgetDefinitionType(ModelSimple):
"""
Type of the wildcard widget.

:param value: If omitted defaults to "wildcard". Must be one of ["wildcard"].
:type value: str
"""

allowed_values = {
"wildcard",
}
WILDCARD: ClassVar["WildcardWidgetDefinitionType"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


WildcardWidgetDefinitionType.WILDCARD = WildcardWidgetDefinitionType("wildcard")
Loading
Loading