Skip to content

Commit 42a6033

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add event_stream fields to dashboard list stream widget (#1230)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 8c6ef61 commit 42a6033

File tree

8 files changed

+113
-5
lines changed

8 files changed

+113
-5
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2023-02-08 15:58:24.499672",
8-
"spec_repo_commit": "7c0c43cc"
7+
"regenerated": "2023-02-08 16:22:44.829792",
8+
"spec_repo_commit": "c826f5c2"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-02-08 15:58:24.511994",
13-
"spec_repo_commit": "7c0c43cc"
12+
"regenerated": "2023-02-08 16:22:44.841610",
13+
"spec_repo_commit": "c826f5c2"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4078,6 +4078,8 @@ components:
40784078
type: array
40794079
data_source:
40804080
$ref: '#/components/schemas/ListStreamSource'
4081+
event_size:
4082+
$ref: '#/components/schemas/WidgetEventSize'
40814083
group_by:
40824084
description: Group by configuration for the List Stream Widget. Group by
40834085
can be used only with logs_pattern_stream (up to 3 items) or logs_transaction_stream
@@ -4122,6 +4124,7 @@ components:
41224124
- apm_issue_stream
41234125
- logs_pattern_stream
41244126
- logs_transaction_stream
4127+
- event_stream
41254128
example: apm_issue_stream
41264129
type: string
41274130
x-enum-varnames:
@@ -4131,6 +4134,7 @@ components:
41314134
- APM_ISSUE_STREAM
41324135
- LOGS_PATTERN_STREAM
41334136
- LOGS_TRANSACTION_STREAM
4137+
- EVENT_STREAM
41344138
ListStreamWidgetDefinition:
41354139
description: 'The list stream visualization displays a table of recent events
41364140
in your application that
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-02-08T16:18:06.266Z

cassettes/features/v1/dashboards/Create-a-new-dashboard-with-event-stream-list-stream-widget.yml

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Create a new dashboard with event_stream list_stream widget
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5+
6+
body = DatadogAPIClient::V1::Dashboard.new({
7+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
8+
title: "Example-Create_a_new_dashboard_with_event_stream_list_stream_widget with list_stream widget",
9+
widgets: [
10+
DatadogAPIClient::V1::Widget.new({
11+
definition: DatadogAPIClient::V1::ListStreamWidgetDefinition.new({
12+
type: DatadogAPIClient::V1::ListStreamWidgetDefinitionType::LIST_STREAM,
13+
requests: [
14+
DatadogAPIClient::V1::ListStreamWidgetRequest.new({
15+
columns: [
16+
DatadogAPIClient::V1::ListStreamColumn.new({
17+
width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO,
18+
field: "timestamp",
19+
}),
20+
],
21+
query: DatadogAPIClient::V1::ListStreamQuery.new({
22+
data_source: DatadogAPIClient::V1::ListStreamSource::EVENT_STREAM,
23+
query_string: "",
24+
event_size: DatadogAPIClient::V1::WidgetEventSize::LARGE,
25+
}),
26+
response_format: DatadogAPIClient::V1::ListStreamResponseFormat::EVENT_LIST,
27+
}),
28+
],
29+
}),
30+
}),
31+
],
32+
})
33+
p api_instance.create_dashboard(body)

features/v1/dashboards.feature

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@ Feature: Dashboards
204204
And the response "widgets[0].definition.requests[0].apm_stats_query.service" is equal to "cassandra"
205205
And the response "widgets[0].definition.requests[0].apm_stats_query.name" is equal to "cassandra.query"
206206

207+
@team:DataDog/dashboards
208+
Scenario: Create a new dashboard with event_stream list_stream widget
209+
Given new "CreateDashboard" request
210+
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": "event_stream","query_string": "","event_size": "l"},"response_format": "event_list"}]}}]}
211+
When the request is sent
212+
Then the response status is 200 OK
213+
And the response "widgets[0].definition.type" is equal to "list_stream"
214+
And the response "widgets[0].definition.requests[0].response_format" is equal to "event_list"
215+
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "event_stream"
216+
And the response "widgets[0].definition.requests[0].query.event_size" is equal to "l"
217+
207218
@team:DataDog/dashboards
208219
Scenario: Create a new dashboard with event_stream widget
209220
Given new "CreateDashboard" request

lib/datadog_api_client/v1/models/list_stream_query.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class ListStreamQuery
3131
# Source from which to query items to display in the stream.
3232
attr_reader :data_source
3333

34+
# Size to use to display an event.
35+
attr_accessor :event_size
36+
3437
# Group by configuration for the List Stream Widget. Group by can be used only with logs_pattern_stream (up to 3 items) or logs_transaction_stream (one group by item is required) list stream source.
3538
attr_reader :group_by
3639

@@ -49,6 +52,7 @@ def self.attribute_map
4952
{
5053
:'compute' => :'compute',
5154
:'data_source' => :'data_source',
55+
:'event_size' => :'event_size',
5256
:'group_by' => :'group_by',
5357
:'indexes' => :'indexes',
5458
:'query_string' => :'query_string',
@@ -62,6 +66,7 @@ def self.openapi_types
6266
{
6367
:'compute' => :'Array<ListStreamComputeItems>',
6468
:'data_source' => :'ListStreamSource',
69+
:'event_size' => :'WidgetEventSize',
6570
:'group_by' => :'Array<ListStreamGroupByItems>',
6671
:'indexes' => :'Array<String>',
6772
:'query_string' => :'String',
@@ -95,6 +100,10 @@ def initialize(attributes = {})
95100
self.data_source = attributes[:'data_source']
96101
end
97102

103+
if attributes.key?(:'event_size')
104+
self.event_size = attributes[:'event_size']
105+
end
106+
98107
if attributes.key?(:'group_by')
99108
if (value = attributes[:'group_by']).is_a?(Array)
100109
self.group_by = value
@@ -179,6 +188,7 @@ def ==(o)
179188
self.class == o.class &&
180189
compute == o.compute &&
181190
data_source == o.data_source &&
191+
event_size == o.event_size &&
182192
group_by == o.group_by &&
183193
indexes == o.indexes &&
184194
query_string == o.query_string &&
@@ -189,7 +199,7 @@ def ==(o)
189199
# @return [Integer] Hash code
190200
# @!visibility private
191201
def hash
192-
[compute, data_source, group_by, indexes, query_string, storage].hash
202+
[compute, data_source, event_size, group_by, indexes, query_string, storage].hash
193203
end
194204
end
195205
end

lib/datadog_api_client/v1/models/list_stream_source.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ class ListStreamSource
2727
APM_ISSUE_STREAM = "apm_issue_stream".freeze
2828
LOGS_PATTERN_STREAM = "logs_pattern_stream".freeze
2929
LOGS_TRANSACTION_STREAM = "logs_transaction_stream".freeze
30+
EVENT_STREAM = "event_stream".freeze
3031
end
3132
end

0 commit comments

Comments
 (0)