diff --git a/.apigentools-info b/.apigentools-info index 08e6c7216d46..53d724952aac 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-20 20:14:17.376953", - "spec_repo_commit": "ebf27b5e" + "regenerated": "2024-11-20 21:48:38.093015", + "spec_repo_commit": "34905ccb" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-20 20:14:17.395595", - "spec_repo_commit": "ebf27b5e" + "regenerated": "2024-11-20 21:48:38.111701", + "spec_repo_commit": "34905ccb" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 4dc36090defb..9f928e0266a0 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4654,6 +4654,11 @@ components: description: Widget column field. example: content type: string + is_clustering_pattern_field_path: + description: Identifies the clustering pattern field column, usable only + with logs_pattern_stream. + example: true + type: boolean width: $ref: '#/components/schemas/ListStreamColumnWidth' required: @@ -4733,6 +4738,12 @@ components: ListStreamQuery: description: Updated list stream widget. properties: + clustering_pattern_field_path: + default: message + description: Specifies the field for logs pattern clustering. Usable only + with logs_pattern_stream. + example: message + type: string compute: description: Compute configuration for the List Stream Widget. Compute can be used only with the logs_transaction_stream (from 1 to 5 items) list diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.frozen index d64ee9657a52..f275079feea0 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.frozen +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.frozen @@ -1 +1 @@ -2024-11-15T19:32:46.627Z \ No newline at end of file +2024-11-20T19:43:46.485Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.yml index 706b10284d3d..c34ecf6cbc02 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.yml +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-logs-pattern-stream-list-stream-widget.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Fri, 15 Nov 2024 19:32:46 GMT +- recorded_at: Wed, 20 Nov 2024 19:43:46 GMT request: body: encoding: UTF-8 - string: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1731699166 - with list_stream widget","widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"}],"query":{"data_source":"logs_pattern_stream","group_by":[{"facet":"service"}],"query_string":""},"response_format":"event_list"}],"type":"list_stream"}}]}' + string: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1732131826 + with list_stream widget","widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"},{"field":"message","is_clustering_pattern_field_path":true,"width":"auto"}],"query":{"clustering_pattern_field_path":"message","data_source":"logs_pattern_stream","group_by":[{"facet":"service"}],"query_string":""},"response_format":"event_list"}],"type":"list_stream"}}]}' headers: Accept: - application/json @@ -15,8 +15,9 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":"hem-inu-je6","title":"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1731699166 - with list_stream widget","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/hem-inu-je6/test-createanewdashboardwithlogspatternstreamliststreamwidget-1731699166-with-li","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"}],"query":{"data_source":"logs_pattern_stream","group_by":[{"facet":"service"}],"query_string":""},"response_format":"event_list"}],"type":"list_stream"},"id":4012469646916199}],"notify_list":null,"created_at":"2024-11-15T19:32:46.772627+00:00","modified_at":"2024-11-15T19:32:46.772627+00:00","restricted_roles":[]} + string: '{"id":"r75-hd7-sd9","title":"Test-Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget-1732131826 + with list_stream widget","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"ordered","url":"/dashboard/r75-hd7-sd9/test-createanewdashboardwithlogspatternstreamliststreamwidget-1732131826-with-li","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"requests":[{"columns":[{"field":"timestamp","width":"auto"},{"field":"message","is_clustering_pattern_field_path":true,"width":"auto"}],"query":{"clustering_pattern_field_path":"message","data_source":"logs_pattern_stream","group_by":[{"facet":"service"}],"query_string":""},"response_format":"event_list"}],"type":"list_stream"},"id":6154246442450384}],"notify_list":null,"created_at":"2024-11-20T19:43:46.871965+00:00","modified_at":"2024-11-20T19:43:46.871965+00:00","restricted_roles":[]} ' headers: @@ -25,18 +26,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 15 Nov 2024 19:32:46 GMT +- recorded_at: Wed, 20 Nov 2024 19:43:46 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/hem-inu-je6 + uri: https://api.datadoghq.com/api/v1/dashboard/r75-hd7-sd9 response: body: encoding: UTF-8 - string: '{"deleted_dashboard_id":"hem-inu-je6"} + string: '{"deleted_dashboard_id":"r75-hd7-sd9"} ' headers: diff --git a/examples/v1/dashboards/CreateDashboard_1039800684.rb b/examples/v1/dashboards/CreateDashboard_1039800684.rb index 294cd211d154..67eadd072359 100644 --- a/examples/v1/dashboards/CreateDashboard_1039800684.rb +++ b/examples/v1/dashboards/CreateDashboard_1039800684.rb @@ -17,10 +17,16 @@ width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, field: "timestamp", }), + DatadogAPIClient::V1::ListStreamColumn.new({ + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + field: "message", + is_clustering_pattern_field_path: true, + }), ], query: DatadogAPIClient::V1::ListStreamQuery.new({ data_source: DatadogAPIClient::V1::ListStreamSource::LOGS_PATTERN_STREAM, query_string: "", + clustering_pattern_field_path: "message", group_by: [ DatadogAPIClient::V1::ListStreamGroupByItems.new({ facet: "service", diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 8d1a1bb8aca3..208a4dd39662 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -534,11 +534,12 @@ Feature: Dashboards @team:DataDog/dashboards-backend Scenario: Create a new dashboard with logs_pattern_stream list_stream widget 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_pattern_stream","query_string":"","group_by":[{"facet":"service"}]},"response_format":"event_list"}]}}]} + 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"}]}}]} 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_pattern_stream" And the response "widgets[0].definition.requests[0].query.group_by[0].facet" is equal to "service" + And the response "widgets[0].definition.requests[0].query.clustering_pattern_field_path" is equal to "message" @team:DataDog/dashboards-backend Scenario: Create a new dashboard with logs_stream list_stream widget and storage parameter diff --git a/lib/datadog_api_client/v1/models/list_stream_column.rb b/lib/datadog_api_client/v1/models/list_stream_column.rb index 3b6b75de166a..9be98b39228e 100644 --- a/lib/datadog_api_client/v1/models/list_stream_column.rb +++ b/lib/datadog_api_client/v1/models/list_stream_column.rb @@ -24,6 +24,9 @@ class ListStreamColumn # Widget column field. attr_reader :field + # Identifies the clustering pattern field column, usable only with logs_pattern_stream. + attr_accessor :is_clustering_pattern_field_path + # Widget column width. attr_reader :width @@ -34,6 +37,7 @@ class ListStreamColumn def self.attribute_map { :'field' => :'field', + :'is_clustering_pattern_field_path' => :'is_clustering_pattern_field_path', :'width' => :'width' } end @@ -43,6 +47,7 @@ def self.attribute_map def self.openapi_types { :'field' => :'String', + :'is_clustering_pattern_field_path' => :'Boolean', :'width' => :'ListStreamColumnWidth' } end @@ -69,6 +74,10 @@ def initialize(attributes = {}) self.field = attributes[:'field'] end + if attributes.key?(:'is_clustering_pattern_field_path') + self.is_clustering_pattern_field_path = attributes[:'is_clustering_pattern_field_path'] + end + if attributes.key?(:'width') self.width = attributes[:'width'] end @@ -130,6 +139,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && field == o.field && + is_clustering_pattern_field_path == o.is_clustering_pattern_field_path && width == o.width additional_properties == o.additional_properties end @@ -138,7 +148,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [field, width].hash + [field, is_clustering_pattern_field_path, width].hash end end end diff --git a/lib/datadog_api_client/v1/models/list_stream_query.rb b/lib/datadog_api_client/v1/models/list_stream_query.rb index 626085f1d4ef..52b409dbede0 100644 --- a/lib/datadog_api_client/v1/models/list_stream_query.rb +++ b/lib/datadog_api_client/v1/models/list_stream_query.rb @@ -21,6 +21,9 @@ module DatadogAPIClient::V1 class ListStreamQuery include BaseGenericModel + # Specifies the field for logs pattern clustering. Usable only with logs_pattern_stream. + attr_accessor :clustering_pattern_field_path + # 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. attr_reader :compute @@ -51,6 +54,7 @@ class ListStreamQuery # @!visibility private def self.attribute_map { + :'clustering_pattern_field_path' => :'clustering_pattern_field_path', :'compute' => :'compute', :'data_source' => :'data_source', :'event_size' => :'event_size', @@ -66,6 +70,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'clustering_pattern_field_path' => :'String', :'compute' => :'Array', :'data_source' => :'ListStreamSource', :'event_size' => :'WidgetEventSize', @@ -95,6 +100,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'clustering_pattern_field_path') + self.clustering_pattern_field_path = attributes[:'clustering_pattern_field_path'] + end + if attributes.key?(:'compute') if (value = attributes[:'compute']).is_a?(Array) self.compute = value @@ -215,6 +224,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + clustering_pattern_field_path == o.clustering_pattern_field_path && compute == o.compute && data_source == o.data_source && event_size == o.event_size && @@ -230,7 +240,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [compute, data_source, event_size, group_by, indexes, query_string, sort, storage].hash + [clustering_pattern_field_path, compute, data_source, event_size, group_by, indexes, query_string, sort, storage].hash end end end