Skip to content

Commit

Permalink
Updated OpenAPI logs_pattern_query to support Patterns for any attrib…
Browse files Browse the repository at this point in the history
…ute (#1918)

Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Nov 20, 2024
1 parent 80aa3eb commit 9344011
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-11-20 20:14:26.200446",
"spec_repo_commit": "ebf27b5e"
"regenerated": "2024-11-20 21:48:41.670836",
"spec_repo_commit": "34905ccb"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-11-20 20:14:26.219169",
"spec_repo_commit": "ebf27b5e"
"regenerated": "2024-11-20 21:48:41.689729",
"spec_repo_commit": "34905ccb"
}
}
}
11 changes: 11 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2024-11-15T19:32:46.627Z"
"2024-11-20T19:43:46.485Z"
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"entries": [
{
"_id": "89e48bc526401ef49327462de1319fdf",
"_id": "efba31bdb3f1473fe30b1697b2cc04b1",
"_order": 0,
"cache": {},
"request": {
"bodySize": 384,
"bodySize": 501,
"cookies": [],
"headers": [
{
Expand All @@ -32,17 +32,17 @@
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"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\"}}]}"
"text": "{\"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\"}}]}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v1/dashboard"
},
"response": {
"bodySize": 798,
"bodySize": 941,
"content": {
"mimeType": "application/json",
"size": 798,
"text": "{\"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\":\"[email protected]\",\"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"
"size": 941,
"text": "{\"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"
},
"cookies": [],
"headers": [
Expand All @@ -57,11 +57,11 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2024-11-15T19:32:46.633Z",
"time": 214
"startedDateTime": "2024-11-20T19:43:46.494Z",
"time": 484
},
{
"_id": "b6052546b3c5ba3824b5c192fda2fb63",
"_id": "d71f08f76763c0e7e498162bb5fc9fea",
"_order": 0,
"cache": {},
"request": {
Expand All @@ -78,14 +78,14 @@
"httpVersion": "HTTP/1.1",
"method": "DELETE",
"queryString": [],
"url": "https://api.datadoghq.com/api/v1/dashboard/hem-inu-je6"
"url": "https://api.datadoghq.com/api/v1/dashboard/r75-hd7-sd9"
},
"response": {
"bodySize": 39,
"content": {
"mimeType": "application/json",
"size": 39,
"text": "{\"deleted_dashboard_id\":\"hem-inu-je6\"}\n"
"text": "{\"deleted_dashboard_id\":\"r75-hd7-sd9\"}\n"
},
"cookies": [],
"headers": [
Expand All @@ -100,8 +100,8 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2024-11-15T19:32:46.853Z",
"time": 167
"startedDateTime": "2024-11-20T19:43:46.987Z",
"time": 414
}
],
"pages": [],
Expand Down
6 changes: 6 additions & 0 deletions examples/v1/dashboards/CreateDashboard_1039800684.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ const params: v1.DashboardsApiCreateDashboardRequest = {
width: "auto",
field: "timestamp",
},
{
width: "auto",
field: "message",
isClusteringPatternFieldPath: true,
},
],
query: {
dataSource: "logs_pattern_stream",
queryString: "",
clusteringPatternFieldPath: "message",
groupBy: [
{
facet: "service",
Expand Down
3 changes: 2 additions & 1 deletion features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions packages/datadog-api-client-v1/models/ListStreamColumn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export class ListStreamColumn {
* Widget column field.
*/
"field": string;
/**
* Identifies the clustering pattern field column, usable only with logs_pattern_stream.
*/
"isClusteringPatternFieldPath"?: boolean;
/**
* Widget column width.
*/
Expand All @@ -41,6 +45,10 @@ export class ListStreamColumn {
type: "string",
required: true,
},
isClusteringPatternFieldPath: {
baseName: "is_clustering_pattern_field_path",
type: "boolean",
},
width: {
baseName: "width",
type: "ListStreamColumnWidth",
Expand Down
8 changes: 8 additions & 0 deletions packages/datadog-api-client-v1/models/ListStreamQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
* Updated list stream widget.
*/
export class ListStreamQuery {
/**
* Specifies the field for logs pattern clustering. Usable only with logs_pattern_stream.
*/
"clusteringPatternFieldPath"?: string;
/**
* 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.
*/
Expand Down Expand Up @@ -64,6 +68,10 @@ export class ListStreamQuery {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
clusteringPatternFieldPath: {
baseName: "clustering_pattern_field_path",
type: "string",
},
compute: {
baseName: "compute",
type: "Array<ListStreamComputeItems>",
Expand Down

0 comments on commit 9344011

Please sign in to comment.