Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5807,10 +5807,21 @@ components:
description: Team handle.
type: string
type: array
version:
$ref: "#/components/schemas/ListStreamQueryVersion"
required:
- query_string
- data_source
type: object
ListStreamQueryVersion:
description: |-
Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
preserved. Set to `sequential_query` to use v2 behavior. **This feature is in Preview.**
enum:
- sequential_query
type: string
x-enum-varnames:
- SEQUENTIAL_QUERY
ListStreamResponseFormat:
description: Widget response format.
enum:
Expand Down
82 changes: 82 additions & 0 deletions examples/v1/dashboards/CreateDashboard_153558925.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Create a new dashboard with logs_transaction_stream list_stream widget and version

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.DashboardsApi;
import com.datadog.api.client.v1.model.Dashboard;
import com.datadog.api.client.v1.model.DashboardLayoutType;
import com.datadog.api.client.v1.model.ListStreamColumn;
import com.datadog.api.client.v1.model.ListStreamColumnWidth;
import com.datadog.api.client.v1.model.ListStreamComputeAggregation;
import com.datadog.api.client.v1.model.ListStreamComputeItems;
import com.datadog.api.client.v1.model.ListStreamGroupByItems;
import com.datadog.api.client.v1.model.ListStreamQuery;
import com.datadog.api.client.v1.model.ListStreamQueryVersion;
import com.datadog.api.client.v1.model.ListStreamResponseFormat;
import com.datadog.api.client.v1.model.ListStreamSource;
import com.datadog.api.client.v1.model.ListStreamWidgetDefinition;
import com.datadog.api.client.v1.model.ListStreamWidgetDefinitionType;
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.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
DashboardsApi apiInstance = new DashboardsApi(defaultClient);

Dashboard body =
new Dashboard()
.layoutType(DashboardLayoutType.ORDERED)
.title("Example-Dashboard with list_stream widget")
.widgets(
Collections.singletonList(
new Widget()
.definition(
new WidgetDefinition(
new ListStreamWidgetDefinition()
.type(ListStreamWidgetDefinitionType.LIST_STREAM)
.requests(
Collections.singletonList(
new ListStreamWidgetRequest()
.columns(
Collections.singletonList(
new ListStreamColumn()
.width(ListStreamColumnWidth.AUTO)
.field("timestamp")))
.query(
new ListStreamQuery()
.dataSource(
ListStreamSource
.LOGS_TRANSACTION_STREAM)
.queryString("")
.groupBy(
Collections.singletonList(
new ListStreamGroupByItems()
.facet("service")))
.compute(
Collections.singletonList(
new ListStreamComputeItems()
.facet("service")
.aggregation(
ListStreamComputeAggregation
.COUNT)))
.version(
ListStreamQueryVersion
.SEQUENTIAL_QUERY))
.responseFormat(
ListStreamResponseFormat.EVENT_LIST)))))));

try {
Dashboard result = apiInstance.createDashboard(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DashboardsApi#createDashboard");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
ListStreamQuery.JSON_PROPERTY_STATES,
ListStreamQuery.JSON_PROPERTY_STORAGE,
ListStreamQuery.JSON_PROPERTY_SUSPECTED_CAUSES,
ListStreamQuery.JSON_PROPERTY_TEAM_HANDLES
ListStreamQuery.JSON_PROPERTY_TEAM_HANDLES,
ListStreamQuery.JSON_PROPERTY_VERSION
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
Expand Down Expand Up @@ -83,6 +84,9 @@ public class ListStreamQuery {
public static final String JSON_PROPERTY_TEAM_HANDLES = "team_handles";
private List<String> teamHandles = null;

public static final String JSON_PROPERTY_VERSION = "version";
private ListStreamQueryVersion version;

public ListStreamQuery() {}

@JsonCreator
Expand Down Expand Up @@ -468,6 +472,33 @@ public void setTeamHandles(List<String> teamHandles) {
this.teamHandles = teamHandles;
}

public ListStreamQuery version(ListStreamQueryVersion version) {
this.version = version;
this.unparsed |= !version.isValid();
return this;
}

/**
* Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
* preserved. Set to <code>sequential_query</code> to use v2 behavior. <strong>This feature is in
* Preview.</strong>
*
* @return version
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_VERSION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public ListStreamQueryVersion getVersion() {
return version;
}

public void setVersion(ListStreamQueryVersion version) {
if (!version.isValid()) {
this.unparsed = true;
}
this.version = version;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -539,6 +570,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.storage, listStreamQuery.storage)
&& Objects.equals(this.suspectedCauses, listStreamQuery.suspectedCauses)
&& Objects.equals(this.teamHandles, listStreamQuery.teamHandles)
&& Objects.equals(this.version, listStreamQuery.version)
&& Objects.equals(this.additionalProperties, listStreamQuery.additionalProperties);
}

Expand All @@ -559,6 +591,7 @@ public int hashCode() {
storage,
suspectedCauses,
teamHandles,
version,
additionalProperties);
}

Expand All @@ -582,6 +615,7 @@ public String toString() {
sb.append(" storage: ").append(toIndentedString(storage)).append("\n");
sb.append(" suspectedCauses: ").append(toIndentedString(suspectedCauses)).append("\n");
sb.append(" teamHandles: ").append(toIndentedString(teamHandles)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-Present Datadog, Inc.
*/

package com.datadog.api.client.v1.model;

import com.datadog.api.client.ModelEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
* Version of the query for the logs transaction stream widget. When omitted, v1 query behavior is
* preserved. Set to <code>sequential_query</code> to use v2 behavior. <strong>This feature is in
* Preview.</strong>
*/
@JsonSerialize(using = ListStreamQueryVersion.ListStreamQueryVersionSerializer.class)
public class ListStreamQueryVersion extends ModelEnum<String> {

private static final Set<String> allowedValues =
new HashSet<String>(Arrays.asList("sequential_query"));

public static final ListStreamQueryVersion SEQUENTIAL_QUERY =
new ListStreamQueryVersion("sequential_query");

ListStreamQueryVersion(String value) {
super(value, allowedValues);
}

public static class ListStreamQueryVersionSerializer
extends StdSerializer<ListStreamQueryVersion> {
public ListStreamQueryVersionSerializer(Class<ListStreamQueryVersion> t) {
super(t);
}

public ListStreamQueryVersionSerializer() {
this(null);
}

@Override
public void serialize(
ListStreamQueryVersion value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonProcessingException {
jgen.writeObject(value.value);
}
}

@JsonCreator
public static ListStreamQueryVersion fromValue(String value) {
return new ListStreamQueryVersion(value);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-06-30T18:19:26.621Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[
{
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_logs_transaction_stream_list_stream_widget_and_version-1782843566 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"compute\":[{\"aggregation\":\"count\",\"facet\":\"service\"}],\"data_source\":\"logs_transaction_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\",\"version\":\"sequential_query\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}"
},
"headers": {},
"method": "POST",
"path": "/api/v1/dashboard",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"id\":\"72a-q2p-zau\",\"title\":\"Test-Create_a_new_dashboard_with_logs_transaction_stream_list_stream_widget_and_version-1782843566 with list_stream widget\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/72a-q2p-zau/test-createanewdashboardwithlogstransactionstreamliststreamwidgetandversion-1782\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"compute\":[{\"aggregation\":\"count\",\"facet\":\"service\"}],\"data_source\":\"logs_transaction_stream\",\"group_by\":[{\"facet\":\"service\"}],\"query_string\":\"\",\"version\":\"sequential_query\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"},\"id\":7740630869906828}],\"notify_list\":null,\"created_at\":\"2026-06-30T18:19:26.794909+00:00\",\"modified_at\":\"2026-06-30T18:19:26.794909+00:00\",\"restricted_roles\":[]}",
"headers": {
"Content-Type": [
"application/json"
]
},
"statusCode": 200,
"reasonPhrase": "OK"
},
"times": {
"remainingTimes": 1
},
"timeToLive": {
"unlimited": true
},
"id": "7d2dcbfd-4f25-70cd-30d2-db347a6251ab"
},
{
"httpRequest": {
"headers": {},
"method": "DELETE",
"path": "/api/v1/dashboard/72a-q2p-zau",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"deleted_dashboard_id\":\"72a-q2p-zau\"}",
"headers": {
"Content-Type": [
"application/json"
]
},
"statusCode": 200,
"reasonPhrase": "OK"
},
"times": {
"remainingTimes": 1
},
"timeToLive": {
"unlimited": true
},
"id": "6ad9f4e6-a510-1411-4aa4-81cf0551672f"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,15 @@ Feature: Dashboards
And the response "widgets[0].definition.requests[0].query.compute[0].facet" is equal to "service"
And the response "widgets[0].definition.requests[0].query.compute[0].aggregation" is equal to "count"

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with logs_transaction_stream list_stream widget and version
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_transaction_stream","query_string":"","group_by":[{"facet":"service"}],"compute":[{"facet":"service","aggregation":"count"}],"version":"sequential_query"},"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_transaction_stream"
And the response "widgets[0].definition.requests[0].query.version" is equal to "sequential_query"

@team:DataDog/dashboards-backend
Scenario: Create a new dashboard with manage_status widget
Given new "CreateDashboard" request
Expand Down
Loading