Skip to content
Merged
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
11 changes: 11 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5807,10 +5807,21 @@ components:
description: Team handle.
type: string
type: array
version:
$ref: "#/components/schemas/ListStreamQueryVersion"
required:
- query_string
- data_source
type: object
ListStreamQueryVersion:
description: |-
Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
preserved. Set to `sequential_query` to use v2 behavior. **This feature is in Preview.**
enum:
- sequential_query
type: string
x-enum-varnames:
- SEQUENTIAL_QUERY
ListStreamResponseFormat:
description: Widget response format.
enum:
Expand Down
67 changes: 67 additions & 0 deletions examples/v1/dashboards/CreateDashboard_153558925.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"""
Create a new dashboard with logs_transaction_stream list_stream widget and version
"""

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.list_stream_column import ListStreamColumn
from datadog_api_client.v1.model.list_stream_column_width import ListStreamColumnWidth
from datadog_api_client.v1.model.list_stream_compute_aggregation import ListStreamComputeAggregation
from datadog_api_client.v1.model.list_stream_compute_items import ListStreamComputeItems
from datadog_api_client.v1.model.list_stream_group_by_items import ListStreamGroupByItems
from datadog_api_client.v1.model.list_stream_query import ListStreamQuery
from datadog_api_client.v1.model.list_stream_query_version import ListStreamQueryVersion
from datadog_api_client.v1.model.list_stream_response_format import ListStreamResponseFormat
from datadog_api_client.v1.model.list_stream_source import ListStreamSource
from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition
from datadog_api_client.v1.model.list_stream_widget_definition_type import ListStreamWidgetDefinitionType
from datadog_api_client.v1.model.list_stream_widget_request import ListStreamWidgetRequest
from datadog_api_client.v1.model.widget import Widget

body = Dashboard(
layout_type=DashboardLayoutType.ORDERED,
title="Example-Dashboard with list_stream widget",
widgets=[
Widget(
definition=ListStreamWidgetDefinition(
type=ListStreamWidgetDefinitionType.LIST_STREAM,
requests=[
ListStreamWidgetRequest(
columns=[
ListStreamColumn(
width=ListStreamColumnWidth.AUTO,
field="timestamp",
),
],
query=ListStreamQuery(
data_source=ListStreamSource.LOGS_TRANSACTION_STREAM,
query_string="",
group_by=[
ListStreamGroupByItems(
facet="service",
),
],
compute=[
ListStreamComputeItems(
facet="service",
aggregation=ListStreamComputeAggregation.COUNT,
),
],
version=ListStreamQueryVersion.SEQUENTIAL_QUERY,
),
response_format=ListStreamResponseFormat.EVENT_LIST,
),
],
),
),
],
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = DashboardsApi(api_client)
response = api_instance.create_dashboard(body=body)

print(response)
11 changes: 11 additions & 0 deletions src/datadog_api_client/v1/model/list_stream_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from datadog_api_client.v1.model.list_stream_issue_persona import ListStreamIssuePersona
from datadog_api_client.v1.model.widget_field_sort import WidgetFieldSort
from datadog_api_client.v1.model.list_stream_issue_state import ListStreamIssueState
from datadog_api_client.v1.model.list_stream_query_version import ListStreamQueryVersion


class ListStreamQuery(ModelNormal):
Expand All @@ -43,6 +44,7 @@ def openapi_types(_):
from datadog_api_client.v1.model.list_stream_issue_persona import ListStreamIssuePersona
from datadog_api_client.v1.model.widget_field_sort import WidgetFieldSort
from datadog_api_client.v1.model.list_stream_issue_state import ListStreamIssueState
from datadog_api_client.v1.model.list_stream_query_version import ListStreamQueryVersion

return {
"assignee_uuids": ([str],),
Expand All @@ -59,6 +61,7 @@ def openapi_types(_):
"storage": (str,),
"suspected_causes": ([str],),
"team_handles": ([str],),
"version": (ListStreamQueryVersion,),
}

attribute_map = {
Expand All @@ -76,6 +79,7 @@ def openapi_types(_):
"storage": "storage",
"suspected_causes": "suspected_causes",
"team_handles": "team_handles",
"version": "version",
}

def __init__(
Expand All @@ -94,6 +98,7 @@ def __init__(
storage: Union[str, UnsetType] = unset,
suspected_causes: Union[List[str], UnsetType] = unset,
team_handles: Union[List[str], UnsetType] = unset,
version: Union[ListStreamQueryVersion, UnsetType] = unset,
**kwargs,
):
"""
Expand Down Expand Up @@ -140,6 +145,10 @@ def __init__(

:param team_handles: Filter by team handles. Usable only with ``issue_stream``.
:type team_handles: [str], optional

:param version: Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
preserved. Set to ``sequential_query`` to use v2 behavior. **This feature is in Preview.**
:type version: ListStreamQueryVersion, optional
"""
if assignee_uuids is not unset:
kwargs["assignee_uuids"] = assignee_uuids
Expand All @@ -165,6 +174,8 @@ def __init__(
kwargs["suspected_causes"] = suspected_causes
if team_handles is not unset:
kwargs["team_handles"] = team_handles
if version is not unset:
kwargs["version"] = version
super().__init__(kwargs)

self_.data_source = data_source
Expand Down
36 changes: 36 additions & 0 deletions src/datadog_api_client/v1/model/list_stream_query_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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 ListStreamQueryVersion(ModelSimple):
"""
Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
preserved. Set to `sequential_query` to use v2 behavior. **This feature is in Preview.**

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

allowed_values = {
"sequential_query",
}
SEQUENTIAL_QUERY: ClassVar["ListStreamQueryVersion"]

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


ListStreamQueryVersion.SEQUENTIAL_QUERY = ListStreamQueryVersion("sequential_query")
2 changes: 2 additions & 0 deletions src/datadog_api_client/v1/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@
from datadog_api_client.v1.model.list_stream_issue_persona import ListStreamIssuePersona
from datadog_api_client.v1.model.list_stream_issue_state import ListStreamIssueState
from datadog_api_client.v1.model.list_stream_query import ListStreamQuery
from datadog_api_client.v1.model.list_stream_query_version import ListStreamQueryVersion
from datadog_api_client.v1.model.list_stream_response_format import ListStreamResponseFormat
from datadog_api_client.v1.model.list_stream_source import ListStreamSource
from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition
Expand Down Expand Up @@ -1665,6 +1666,7 @@
"ListStreamIssuePersona",
"ListStreamIssueState",
"ListStreamQuery",
"ListStreamQueryVersion",
"ListStreamResponseFormat",
"ListStreamSource",
"ListStreamWidgetDefinition",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-06-30T18:19:26.621Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
interactions:
- request:
body: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_logs_transaction_stream_list_stream_widget_and_version-1782843566
with list_stream widget","widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"}],"query":{"compute":[{"aggregation":"count","facet":"service"}],"data_source":"logs_transaction_stream","group_by":[{"facet":"service"}],"query_string":"","version":"sequential_query"},"response_format":"event_list"}],"type":"list_stream"}}]}'
headers:
accept:
- application/json
content-type:
- application/json
method: POST
uri: https://api.datadoghq.com/api/v1/dashboard
response:
body:
string: '{"id":"72a-q2p-zau","title":"Test-Create_a_new_dashboard_with_logs_transaction_stream_list_stream_widget_and_version-1782843566
with list_stream widget","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI
Account","layout_type":"ordered","url":"/dashboard/72a-q2p-zau/test-createanewdashboardwithlogstransactionstreamliststreamwidgetandversion-1782","template_variables":null,"widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"}],"query":{"compute":[{"aggregation":"count","facet":"service"}],"data_source":"logs_transaction_stream","group_by":[{"facet":"service"}],"query_string":"","version":"sequential_query"},"response_format":"event_list"}],"type":"list_stream"},"id":7740630869906828}],"notify_list":null,"created_at":"2026-06-30T18:19:26.794909+00:00","modified_at":"2026-06-30T18:19:26.794909+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/72a-q2p-zau
response:
body:
string: '{"deleted_dashboard_id":"72a-q2p-zau"}'
headers:
content-type:
- application/json
status:
code: 200
message: OK
version: 1
9 changes: 9 additions & 0 deletions tests/v1/features/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,15 @@ Feature: Dashboards
And the response "widgets[0].definition.requests[0].query.compute[0].facet" is equal to "service"
And the response "widgets[0].definition.requests[0].query.compute[0].aggregation" is equal to "count"

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with logs_transaction_stream list_stream widget and version
Given new "CreateDashboard" request
And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"}],"query":{"data_source":"logs_transaction_stream","query_string":"","group_by":[{"facet":"service"}],"compute":[{"facet":"service","aggregation":"count"}],"version":"sequential_query"},"response_format":"event_list"}]}}]}
When the request is sent
Then the response status is 200 OK
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_transaction_stream"
And the response "widgets[0].definition.requests[0].query.version" is equal to "sequential_query"

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with manage_status widget
Given new "CreateDashboard" request
Expand Down
Loading