Skip to content

Commit f6ce8cd

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit a73640a of spec repo (#3732)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 30908d7 commit f6ce8cd

8 files changed

Lines changed: 176 additions & 0 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5807,10 +5807,21 @@ components:
58075807
description: Team handle.
58085808
type: string
58095809
type: array
5810+
version:
5811+
$ref: "#/components/schemas/ListStreamQueryVersion"
58105812
required:
58115813
- query_string
58125814
- data_source
58135815
type: object
5816+
ListStreamQueryVersion:
5817+
description: |-
5818+
Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
5819+
preserved. Set to `sequential_query` to use v2 behavior. **This feature is in Preview.**
5820+
enum:
5821+
- sequential_query
5822+
type: string
5823+
x-enum-varnames:
5824+
- SEQUENTIAL_QUERY
58145825
ListStreamResponseFormat:
58155826
description: Widget response format.
58165827
enum:
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
"""
2+
Create a new dashboard with logs_transaction_stream list_stream widget and version
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
7+
from datadog_api_client.v1.model.dashboard import Dashboard
8+
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
9+
from datadog_api_client.v1.model.list_stream_column import ListStreamColumn
10+
from datadog_api_client.v1.model.list_stream_column_width import ListStreamColumnWidth
11+
from datadog_api_client.v1.model.list_stream_compute_aggregation import ListStreamComputeAggregation
12+
from datadog_api_client.v1.model.list_stream_compute_items import ListStreamComputeItems
13+
from datadog_api_client.v1.model.list_stream_group_by_items import ListStreamGroupByItems
14+
from datadog_api_client.v1.model.list_stream_query import ListStreamQuery
15+
from datadog_api_client.v1.model.list_stream_query_version import ListStreamQueryVersion
16+
from datadog_api_client.v1.model.list_stream_response_format import ListStreamResponseFormat
17+
from datadog_api_client.v1.model.list_stream_source import ListStreamSource
18+
from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition
19+
from datadog_api_client.v1.model.list_stream_widget_definition_type import ListStreamWidgetDefinitionType
20+
from datadog_api_client.v1.model.list_stream_widget_request import ListStreamWidgetRequest
21+
from datadog_api_client.v1.model.widget import Widget
22+
23+
body = Dashboard(
24+
layout_type=DashboardLayoutType.ORDERED,
25+
title="Example-Dashboard with list_stream widget",
26+
widgets=[
27+
Widget(
28+
definition=ListStreamWidgetDefinition(
29+
type=ListStreamWidgetDefinitionType.LIST_STREAM,
30+
requests=[
31+
ListStreamWidgetRequest(
32+
columns=[
33+
ListStreamColumn(
34+
width=ListStreamColumnWidth.AUTO,
35+
field="timestamp",
36+
),
37+
],
38+
query=ListStreamQuery(
39+
data_source=ListStreamSource.LOGS_TRANSACTION_STREAM,
40+
query_string="",
41+
group_by=[
42+
ListStreamGroupByItems(
43+
facet="service",
44+
),
45+
],
46+
compute=[
47+
ListStreamComputeItems(
48+
facet="service",
49+
aggregation=ListStreamComputeAggregation.COUNT,
50+
),
51+
],
52+
version=ListStreamQueryVersion.SEQUENTIAL_QUERY,
53+
),
54+
response_format=ListStreamResponseFormat.EVENT_LIST,
55+
),
56+
],
57+
),
58+
),
59+
],
60+
)
61+
62+
configuration = Configuration()
63+
with ApiClient(configuration) as api_client:
64+
api_instance = DashboardsApi(api_client)
65+
response = api_instance.create_dashboard(body=body)
66+
67+
print(response)

src/datadog_api_client/v1/model/list_stream_query.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from datadog_api_client.v1.model.list_stream_issue_persona import ListStreamIssuePersona
2222
from datadog_api_client.v1.model.widget_field_sort import WidgetFieldSort
2323
from datadog_api_client.v1.model.list_stream_issue_state import ListStreamIssueState
24+
from datadog_api_client.v1.model.list_stream_query_version import ListStreamQueryVersion
2425

2526

2627
class ListStreamQuery(ModelNormal):
@@ -43,6 +44,7 @@ def openapi_types(_):
4344
from datadog_api_client.v1.model.list_stream_issue_persona import ListStreamIssuePersona
4445
from datadog_api_client.v1.model.widget_field_sort import WidgetFieldSort
4546
from datadog_api_client.v1.model.list_stream_issue_state import ListStreamIssueState
47+
from datadog_api_client.v1.model.list_stream_query_version import ListStreamQueryVersion
4648

4749
return {
4850
"assignee_uuids": ([str],),
@@ -59,6 +61,7 @@ def openapi_types(_):
5961
"storage": (str,),
6062
"suspected_causes": ([str],),
6163
"team_handles": ([str],),
64+
"version": (ListStreamQueryVersion,),
6265
}
6366

6467
attribute_map = {
@@ -76,6 +79,7 @@ def openapi_types(_):
7679
"storage": "storage",
7780
"suspected_causes": "suspected_causes",
7881
"team_handles": "team_handles",
82+
"version": "version",
7983
}
8084

8185
def __init__(
@@ -94,6 +98,7 @@ def __init__(
9498
storage: Union[str, UnsetType] = unset,
9599
suspected_causes: Union[List[str], UnsetType] = unset,
96100
team_handles: Union[List[str], UnsetType] = unset,
101+
version: Union[ListStreamQueryVersion, UnsetType] = unset,
97102
**kwargs,
98103
):
99104
"""
@@ -140,6 +145,10 @@ def __init__(
140145
141146
:param team_handles: Filter by team handles. Usable only with ``issue_stream``.
142147
:type team_handles: [str], optional
148+
149+
:param version: Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
150+
preserved. Set to ``sequential_query`` to use v2 behavior. **This feature is in Preview.**
151+
:type version: ListStreamQueryVersion, optional
143152
"""
144153
if assignee_uuids is not unset:
145154
kwargs["assignee_uuids"] = assignee_uuids
@@ -165,6 +174,8 @@ def __init__(
165174
kwargs["suspected_causes"] = suspected_causes
166175
if team_handles is not unset:
167176
kwargs["team_handles"] = team_handles
177+
if version is not unset:
178+
kwargs["version"] = version
168179
super().__init__(kwargs)
169180

170181
self_.data_source = data_source
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class ListStreamQueryVersion(ModelSimple):
16+
"""
17+
Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
18+
preserved. Set to `sequential_query` to use v2 behavior. **This feature is in Preview.**
19+
20+
:param value: If omitted defaults to "sequential_query". Must be one of ["sequential_query"].
21+
:type value: str
22+
"""
23+
24+
allowed_values = {
25+
"sequential_query",
26+
}
27+
SEQUENTIAL_QUERY: ClassVar["ListStreamQueryVersion"]
28+
29+
@cached_property
30+
def openapi_types(_):
31+
return {
32+
"value": (str,),
33+
}
34+
35+
36+
ListStreamQueryVersion.SEQUENTIAL_QUERY = ListStreamQueryVersion("sequential_query")

src/datadog_api_client/v1/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@
315315
from datadog_api_client.v1.model.list_stream_issue_persona import ListStreamIssuePersona
316316
from datadog_api_client.v1.model.list_stream_issue_state import ListStreamIssueState
317317
from datadog_api_client.v1.model.list_stream_query import ListStreamQuery
318+
from datadog_api_client.v1.model.list_stream_query_version import ListStreamQueryVersion
318319
from datadog_api_client.v1.model.list_stream_response_format import ListStreamResponseFormat
319320
from datadog_api_client.v1.model.list_stream_source import ListStreamSource
320321
from datadog_api_client.v1.model.list_stream_widget_definition import ListStreamWidgetDefinition
@@ -1665,6 +1666,7 @@
16651666
"ListStreamIssuePersona",
16661667
"ListStreamIssueState",
16671668
"ListStreamQuery",
1669+
"ListStreamQueryVersion",
16681670
"ListStreamResponseFormat",
16691671
"ListStreamSource",
16701672
"ListStreamWidgetDefinition",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-06-30T18:19:26.621Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
interactions:
2+
- request:
3+
body: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_logs_transaction_stream_list_stream_widget_and_version-1782843566
4+
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"}}]}'
5+
headers:
6+
accept:
7+
- application/json
8+
content-type:
9+
- application/json
10+
method: POST
11+
uri: https://api.datadoghq.com/api/v1/dashboard
12+
response:
13+
body:
14+
string: '{"id":"72a-q2p-zau","title":"Test-Create_a_new_dashboard_with_logs_transaction_stream_list_stream_widget_and_version-1782843566
15+
with list_stream widget","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI
16+
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":[]}'
17+
headers:
18+
content-type:
19+
- application/json
20+
status:
21+
code: 200
22+
message: OK
23+
- request:
24+
body: null
25+
headers:
26+
accept:
27+
- application/json
28+
method: DELETE
29+
uri: https://api.datadoghq.com/api/v1/dashboard/72a-q2p-zau
30+
response:
31+
body:
32+
string: '{"deleted_dashboard_id":"72a-q2p-zau"}'
33+
headers:
34+
content-type:
35+
- application/json
36+
status:
37+
code: 200
38+
message: OK
39+
version: 1

tests/v1/features/dashboards.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,15 @@ Feature: Dashboards
721721
And the response "widgets[0].definition.requests[0].query.compute[0].facet" is equal to "service"
722722
And the response "widgets[0].definition.requests[0].query.compute[0].aggregation" is equal to "count"
723723

724+
@team:DataDog/dashboards-backend
725+
Scenario: Create a new dashboard with logs_transaction_stream list_stream widget and version
726+
Given new "CreateDashboard" request
727+
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"}]}}]}
728+
When the request is sent
729+
Then the response status is 200 OK
730+
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_transaction_stream"
731+
And the response "widgets[0].definition.requests[0].query.version" is equal to "sequential_query"
732+
724733
@team:DataDog/dashboards-backend
725734
Scenario: Create a new dashboard with manage_status widget
726735
Given new "CreateDashboard" request

0 commit comments

Comments
 (0)