Skip to content

Commit 09f6230

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 50cf827 of spec repo
1 parent 53be7d6 commit 09f6230

8 files changed

Lines changed: 149 additions & 0 deletions

File tree

.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:

.generator/schemas/v2/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64968,6 +64968,9 @@ components:
6496864968
description: The ID of a component whose output is used as input for this destination.
6496964969
type: string
6497064970
type: array
64971+
tls:
64972+
$ref: "#/components/schemas/ObservabilityPipelineTls"
64973+
description: Configuration for TLS encryption.
6497164974
type:
6497264975
$ref: "#/components/schemas/ObservabilityPipelineCloudPremDestinationType"
6497364976
required:
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",

src/datadog_api_client/v2/model/observability_pipeline_cloud_prem_destination.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
if TYPE_CHECKING:
1717
from datadog_api_client.v2.model.observability_pipeline_buffer_options import ObservabilityPipelineBufferOptions
18+
from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls
1819
from datadog_api_client.v2.model.observability_pipeline_cloud_prem_destination_type import (
1920
ObservabilityPipelineCloudPremDestinationType,
2021
)
@@ -33,6 +34,7 @@ class ObservabilityPipelineCloudPremDestination(ModelNormal):
3334
@cached_property
3435
def openapi_types(_):
3536
from datadog_api_client.v2.model.observability_pipeline_buffer_options import ObservabilityPipelineBufferOptions
37+
from datadog_api_client.v2.model.observability_pipeline_tls import ObservabilityPipelineTls
3638
from datadog_api_client.v2.model.observability_pipeline_cloud_prem_destination_type import (
3739
ObservabilityPipelineCloudPremDestinationType,
3840
)
@@ -42,6 +44,7 @@ def openapi_types(_):
4244
"endpoint_url_key": (str,),
4345
"id": (str,),
4446
"inputs": ([str],),
47+
"tls": (ObservabilityPipelineTls,),
4548
"type": (ObservabilityPipelineCloudPremDestinationType,),
4649
}
4750

@@ -50,6 +53,7 @@ def openapi_types(_):
5053
"endpoint_url_key": "endpoint_url_key",
5154
"id": "id",
5255
"inputs": "inputs",
56+
"tls": "tls",
5357
"type": "type",
5458
}
5559

@@ -66,6 +70,7 @@ def __init__(
6670
UnsetType,
6771
] = unset,
6872
endpoint_url_key: Union[str, UnsetType] = unset,
73+
tls: Union[ObservabilityPipelineTls, UnsetType] = unset,
6974
**kwargs,
7075
):
7176
"""
@@ -85,13 +90,18 @@ def __init__(
8590
:param inputs: A list of component IDs whose output is used as the ``input`` for this component.
8691
:type inputs: [str]
8792
93+
:param tls: Configuration for enabling TLS encryption between the pipeline component and external services.
94+
:type tls: ObservabilityPipelineTls, optional
95+
8896
:param type: The destination type. The value should always be ``cloud_prem``.
8997
:type type: ObservabilityPipelineCloudPremDestinationType
9098
"""
9199
if buffer is not unset:
92100
kwargs["buffer"] = buffer
93101
if endpoint_url_key is not unset:
94102
kwargs["endpoint_url_key"] = endpoint_url_key
103+
if tls is not unset:
104+
kwargs["tls"] = tls
95105
super().__init__(kwargs)
96106

97107
self_.id = id

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)