diff --git a/.apigentools-info b/.apigentools-info index e479caec58d..2efee786cef 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:20.566230", - "spec_repo_commit": "ebf27b5e" + "regenerated": "2024-11-20 21:48:31.822376", + "spec_repo_commit": "34905ccb" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-20 20:14:20.584628", - "spec_repo_commit": "ebf27b5e" + "regenerated": "2024-11-20 21:48:31.841834", + "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 4dc36090def..9f928e0266a 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/examples/v1/dashboards/CreateDashboard_1039800684.java b/examples/v1/dashboards/CreateDashboard_1039800684.java index fd0c684e45a..c8b75fc4a1d 100644 --- a/examples/v1/dashboards/CreateDashboard_1039800684.java +++ b/examples/v1/dashboards/CreateDashboard_1039800684.java @@ -16,6 +16,7 @@ import com.datadog.api.client.v1.model.ListStreamWidgetRequest; import com.datadog.api.client.v1.model.Widget; import com.datadog.api.client.v1.model.WidgetDefinition; +import java.util.Arrays; import java.util.Collections; public class Example { @@ -38,15 +39,20 @@ public static void main(String[] args) { Collections.singletonList( new ListStreamWidgetRequest() .columns( - Collections.singletonList( + Arrays.asList( new ListStreamColumn() .width(ListStreamColumnWidth.AUTO) - .field("timestamp"))) + .field("timestamp"), + new ListStreamColumn() + .width(ListStreamColumnWidth.AUTO) + .field("message") + .isClusteringPatternFieldPath(true))) .query( new ListStreamQuery() .dataSource( ListStreamSource.LOGS_PATTERN_STREAM) .queryString("") + .clusteringPatternFieldPath("message") .groupBy( Collections.singletonList( new ListStreamGroupByItems() diff --git a/src/main/java/com/datadog/api/client/v1/model/ListStreamColumn.java b/src/main/java/com/datadog/api/client/v1/model/ListStreamColumn.java index 278f1c50107..49a867f91e7 100644 --- a/src/main/java/com/datadog/api/client/v1/model/ListStreamColumn.java +++ b/src/main/java/com/datadog/api/client/v1/model/ListStreamColumn.java @@ -18,7 +18,11 @@ import java.util.Objects; /** Widget column. */ -@JsonPropertyOrder({ListStreamColumn.JSON_PROPERTY_FIELD, ListStreamColumn.JSON_PROPERTY_WIDTH}) +@JsonPropertyOrder({ + ListStreamColumn.JSON_PROPERTY_FIELD, + ListStreamColumn.JSON_PROPERTY_IS_CLUSTERING_PATTERN_FIELD_PATH, + ListStreamColumn.JSON_PROPERTY_WIDTH +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class ListStreamColumn { @@ -26,6 +30,10 @@ public class ListStreamColumn { public static final String JSON_PROPERTY_FIELD = "field"; private String field; + public static final String JSON_PROPERTY_IS_CLUSTERING_PATTERN_FIELD_PATH = + "is_clustering_pattern_field_path"; + private Boolean isClusteringPatternFieldPath; + public static final String JSON_PROPERTY_WIDTH = "width"; private ListStreamColumnWidth width; @@ -60,6 +68,27 @@ public void setField(String field) { this.field = field; } + public ListStreamColumn isClusteringPatternFieldPath(Boolean isClusteringPatternFieldPath) { + this.isClusteringPatternFieldPath = isClusteringPatternFieldPath; + return this; + } + + /** + * Identifies the clustering pattern field column, usable only with logs_pattern_stream. + * + * @return isClusteringPatternFieldPath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_CLUSTERING_PATTERN_FIELD_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsClusteringPatternFieldPath() { + return isClusteringPatternFieldPath; + } + + public void setIsClusteringPatternFieldPath(Boolean isClusteringPatternFieldPath) { + this.isClusteringPatternFieldPath = isClusteringPatternFieldPath; + } + public ListStreamColumn width(ListStreamColumnWidth width) { this.width = width; this.unparsed |= !width.isValid(); @@ -141,13 +170,15 @@ public boolean equals(Object o) { } ListStreamColumn listStreamColumn = (ListStreamColumn) o; return Objects.equals(this.field, listStreamColumn.field) + && Objects.equals( + this.isClusteringPatternFieldPath, listStreamColumn.isClusteringPatternFieldPath) && Objects.equals(this.width, listStreamColumn.width) && Objects.equals(this.additionalProperties, listStreamColumn.additionalProperties); } @Override public int hashCode() { - return Objects.hash(field, width, additionalProperties); + return Objects.hash(field, isClusteringPatternFieldPath, width, additionalProperties); } @Override @@ -155,6 +186,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ListStreamColumn {\n"); sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" isClusteringPatternFieldPath: ") + .append(toIndentedString(isClusteringPatternFieldPath)) + .append("\n"); sb.append(" width: ").append(toIndentedString(width)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v1/model/ListStreamQuery.java b/src/main/java/com/datadog/api/client/v1/model/ListStreamQuery.java index e446d39379f..784ba22f7c5 100644 --- a/src/main/java/com/datadog/api/client/v1/model/ListStreamQuery.java +++ b/src/main/java/com/datadog/api/client/v1/model/ListStreamQuery.java @@ -21,6 +21,7 @@ /** Updated list stream widget. */ @JsonPropertyOrder({ + ListStreamQuery.JSON_PROPERTY_CLUSTERING_PATTERN_FIELD_PATH, ListStreamQuery.JSON_PROPERTY_COMPUTE, ListStreamQuery.JSON_PROPERTY_DATA_SOURCE, ListStreamQuery.JSON_PROPERTY_EVENT_SIZE, @@ -34,6 +35,10 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class ListStreamQuery { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLUSTERING_PATTERN_FIELD_PATH = + "clustering_pattern_field_path"; + private String clusteringPatternFieldPath = "message"; + public static final String JSON_PROPERTY_COMPUTE = "compute"; private List compute = null; @@ -69,6 +74,27 @@ public ListStreamQuery( this.queryString = queryString; } + public ListStreamQuery clusteringPatternFieldPath(String clusteringPatternFieldPath) { + this.clusteringPatternFieldPath = clusteringPatternFieldPath; + return this; + } + + /** + * Specifies the field for logs pattern clustering. Usable only with logs_pattern_stream. + * + * @return clusteringPatternFieldPath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLUSTERING_PATTERN_FIELD_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClusteringPatternFieldPath() { + return clusteringPatternFieldPath; + } + + public void setClusteringPatternFieldPath(String clusteringPatternFieldPath) { + this.clusteringPatternFieldPath = clusteringPatternFieldPath; + } + public ListStreamQuery compute(List compute) { this.compute = compute; for (ListStreamComputeItems item : compute) { @@ -335,7 +361,9 @@ public boolean equals(Object o) { return false; } ListStreamQuery listStreamQuery = (ListStreamQuery) o; - return Objects.equals(this.compute, listStreamQuery.compute) + return Objects.equals( + this.clusteringPatternFieldPath, listStreamQuery.clusteringPatternFieldPath) + && Objects.equals(this.compute, listStreamQuery.compute) && Objects.equals(this.dataSource, listStreamQuery.dataSource) && Objects.equals(this.eventSize, listStreamQuery.eventSize) && Objects.equals(this.groupBy, listStreamQuery.groupBy) @@ -349,6 +377,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + clusteringPatternFieldPath, compute, dataSource, eventSize, @@ -364,6 +393,9 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ListStreamQuery {\n"); + sb.append(" clusteringPatternFieldPath: ") + .append(toIndentedString(clusteringPatternFieldPath)) + .append("\n"); sb.append(" compute: ").append(toIndentedString(compute)).append("\n"); sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); sb.append(" eventSize: ").append(toIndentedString(eventSize)).append("\n"); diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget.freeze b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget.freeze index d64ee9657a5..f275079feea 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget.freeze +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget.freeze @@ -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/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget.json b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget.json index 0466ff6b0ed..ba7caff75cf 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget.json +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_logs_pattern_stream_list_stream_widget.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}}]}" + "json": "{\"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": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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\":[]}\n", + "body": "{\"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\":[]}\n", "headers": { "Content-Type": [ "application/json" @@ -27,18 +27,18 @@ "timeToLive": { "unlimited": true }, - "id": "89e48bc5-2640-1ef4-9327-462de1319fdf" + "id": "efba31bd-b3f1-473f-e30b-1697b2cc04b1" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v1/dashboard/hem-inu-je6", + "path": "/api/v1/dashboard/r75-hd7-sd9", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"deleted_dashboard_id\":\"hem-inu-je6\"}\n", + "body": "{\"deleted_dashboard_id\":\"r75-hd7-sd9\"}\n", "headers": { "Content-Type": [ "application/json" @@ -53,6 +53,6 @@ "timeToLive": { "unlimited": true }, - "id": "b6052546-b3c5-ba38-24b5-c192fda2fb63" + "id": "d71f08f7-6763-c0e7-e498-162bb5fc9fea" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature b/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature index 8d1a1bb8aca..208a4dd3966 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/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