Skip to content

Commit c116400

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Updated OpenAPI logs_pattern_query to support Patterns for any attribute (#2111)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2995758 commit c116400

File tree

8 files changed

+55
-16
lines changed

8 files changed

+55
-16
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.6",
7-
"regenerated": "2024-11-20 20:14:17.376953",
8-
"spec_repo_commit": "ebf27b5e"
7+
"regenerated": "2024-11-20 21:48:38.093015",
8+
"spec_repo_commit": "34905ccb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-11-20 20:14:17.395595",
13-
"spec_repo_commit": "ebf27b5e"
12+
"regenerated": "2024-11-20 21:48:38.111701",
13+
"spec_repo_commit": "34905ccb"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4654,6 +4654,11 @@ components:
46544654
description: Widget column field.
46554655
example: content
46564656
type: string
4657+
is_clustering_pattern_field_path:
4658+
description: Identifies the clustering pattern field column, usable only
4659+
with logs_pattern_stream.
4660+
example: true
4661+
type: boolean
46574662
width:
46584663
$ref: '#/components/schemas/ListStreamColumnWidth'
46594664
required:
@@ -4733,6 +4738,12 @@ components:
47334738
ListStreamQuery:
47344739
description: Updated list stream widget.
47354740
properties:
4741+
clustering_pattern_field_path:
4742+
default: message
4743+
description: Specifies the field for logs pattern clustering. Usable only
4744+
with logs_pattern_stream.
4745+
example: message
4746+
type: string
47364747
compute:
47374748
description: Compute configuration for the List Stream Widget. Compute can
47384749
be used only with the logs_transaction_stream (from 1 to 5 items) list
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-11-15T19:32:46.627Z
1+
2024-11-20T19:43:46.485Z

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

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/v1/dashboards/CreateDashboard_1039800684.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@
1717
width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO,
1818
field: "timestamp",
1919
}),
20+
DatadogAPIClient::V1::ListStreamColumn.new({
21+
width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO,
22+
field: "message",
23+
is_clustering_pattern_field_path: true,
24+
}),
2025
],
2126
query: DatadogAPIClient::V1::ListStreamQuery.new({
2227
data_source: DatadogAPIClient::V1::ListStreamSource::LOGS_PATTERN_STREAM,
2328
query_string: "",
29+
clustering_pattern_field_path: "message",
2430
group_by: [
2531
DatadogAPIClient::V1::ListStreamGroupByItems.new({
2632
facet: "service",

features/v1/dashboards.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,11 +534,12 @@ Feature: Dashboards
534534
@team:DataDog/dashboards-backend
535535
Scenario: Create a new dashboard with logs_pattern_stream list_stream widget
536536
Given new "CreateDashboard" request
537-
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_pattern_stream","query_string":"","group_by":[{"facet":"service"}]},"response_format":"event_list"}]}}]}
537+
And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"},{"width":"auto","field":"message", "is_clustering_pattern_field_path": true}],"query":{"data_source":"logs_pattern_stream","query_string":"","clustering_pattern_field_path":"message","group_by":[{"facet":"service"}]}, "response_format":"event_list"}]}}]}
538538
When the request is sent
539539
Then the response status is 200 OK
540540
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_pattern_stream"
541541
And the response "widgets[0].definition.requests[0].query.group_by[0].facet" is equal to "service"
542+
And the response "widgets[0].definition.requests[0].query.clustering_pattern_field_path" is equal to "message"
542543

543544
@team:DataDog/dashboards-backend
544545
Scenario: Create a new dashboard with logs_stream list_stream widget and storage parameter

lib/datadog_api_client/v1/models/list_stream_column.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class ListStreamColumn
2424
# Widget column field.
2525
attr_reader :field
2626

27+
# Identifies the clustering pattern field column, usable only with logs_pattern_stream.
28+
attr_accessor :is_clustering_pattern_field_path
29+
2730
# Widget column width.
2831
attr_reader :width
2932

@@ -34,6 +37,7 @@ class ListStreamColumn
3437
def self.attribute_map
3538
{
3639
:'field' => :'field',
40+
:'is_clustering_pattern_field_path' => :'is_clustering_pattern_field_path',
3741
:'width' => :'width'
3842
}
3943
end
@@ -43,6 +47,7 @@ def self.attribute_map
4347
def self.openapi_types
4448
{
4549
:'field' => :'String',
50+
:'is_clustering_pattern_field_path' => :'Boolean',
4651
:'width' => :'ListStreamColumnWidth'
4752
}
4853
end
@@ -69,6 +74,10 @@ def initialize(attributes = {})
6974
self.field = attributes[:'field']
7075
end
7176

77+
if attributes.key?(:'is_clustering_pattern_field_path')
78+
self.is_clustering_pattern_field_path = attributes[:'is_clustering_pattern_field_path']
79+
end
80+
7281
if attributes.key?(:'width')
7382
self.width = attributes[:'width']
7483
end
@@ -130,6 +139,7 @@ def ==(o)
130139
return true if self.equal?(o)
131140
self.class == o.class &&
132141
field == o.field &&
142+
is_clustering_pattern_field_path == o.is_clustering_pattern_field_path &&
133143
width == o.width
134144
additional_properties == o.additional_properties
135145
end
@@ -138,7 +148,7 @@ def ==(o)
138148
# @return [Integer] Hash code
139149
# @!visibility private
140150
def hash
141-
[field, width].hash
151+
[field, is_clustering_pattern_field_path, width].hash
142152
end
143153
end
144154
end

lib/datadog_api_client/v1/models/list_stream_query.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ module DatadogAPIClient::V1
2121
class ListStreamQuery
2222
include BaseGenericModel
2323

24+
# Specifies the field for logs pattern clustering. Usable only with logs_pattern_stream.
25+
attr_accessor :clustering_pattern_field_path
26+
2427
# Compute configuration for the List Stream Widget. Compute can be used only with the logs_transaction_stream (from 1 to 5 items) list stream source.
2528
attr_reader :compute
2629

@@ -51,6 +54,7 @@ class ListStreamQuery
5154
# @!visibility private
5255
def self.attribute_map
5356
{
57+
:'clustering_pattern_field_path' => :'clustering_pattern_field_path',
5458
:'compute' => :'compute',
5559
:'data_source' => :'data_source',
5660
:'event_size' => :'event_size',
@@ -66,6 +70,7 @@ def self.attribute_map
6670
# @!visibility private
6771
def self.openapi_types
6872
{
73+
:'clustering_pattern_field_path' => :'String',
6974
:'compute' => :'Array<ListStreamComputeItems>',
7075
:'data_source' => :'ListStreamSource',
7176
:'event_size' => :'WidgetEventSize',
@@ -95,6 +100,10 @@ def initialize(attributes = {})
95100
end
96101
}
97102

103+
if attributes.key?(:'clustering_pattern_field_path')
104+
self.clustering_pattern_field_path = attributes[:'clustering_pattern_field_path']
105+
end
106+
98107
if attributes.key?(:'compute')
99108
if (value = attributes[:'compute']).is_a?(Array)
100109
self.compute = value
@@ -215,6 +224,7 @@ def to_hash
215224
def ==(o)
216225
return true if self.equal?(o)
217226
self.class == o.class &&
227+
clustering_pattern_field_path == o.clustering_pattern_field_path &&
218228
compute == o.compute &&
219229
data_source == o.data_source &&
220230
event_size == o.event_size &&
@@ -230,7 +240,7 @@ def ==(o)
230240
# @return [Integer] Hash code
231241
# @!visibility private
232242
def hash
233-
[compute, data_source, event_size, group_by, indexes, query_string, sort, storage].hash
243+
[clustering_pattern_field_path, compute, data_source, event_size, group_by, indexes, query_string, sort, storage].hash
234244
end
235245
end
236246
end

0 commit comments

Comments
 (0)