Skip to content

Commit d37c85d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 442428b of spec repo
1 parent ba14c4f commit d37c85d

File tree

7 files changed

+192
-0
lines changed

7 files changed

+192
-0
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,6 +2875,7 @@ components:
28752875
- ci_tests
28762876
- ci_pipelines
28772877
- incident_analytics
2878+
- product_analytics
28782879
example: logs
28792880
type: string
28802881
x-enum-varnames:
@@ -2889,6 +2890,7 @@ components:
28892890
- CI_TESTS
28902891
- CI_PIPELINES
28912892
- INCIDENT_ANALYTICS
2893+
- PRODUCT_ANALYTICS
28922894
FormulaAndFunctionMetricAggregation:
28932895
description: The aggregation methods available for metrics queries.
28942896
enum:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-09-18T18:51:17.951Z"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new timeseries widget with product_analytics data source",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "8fcc4923c4ef8c94eabcb970afb3a8e2",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 678,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 559,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"layout_type\":\"ordered\",\"reflow_type\":\"auto\",\"title\":\"Test-Create_a_new_timeseries_widget_with_product_analytics_data_source-1758221477 with product_analytics datasource\",\"widgets\":[{\"definition\":{\"legend_columns\":[\"avg\",\"min\",\"max\",\"value\",\"sum\"],\"legend_layout\":\"auto\",\"requests\":[{\"display_type\":\"line\",\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"product_analytics\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"test_level:test\"}}],\"response_format\":\"timeseries\",\"style\":{\"line_type\":\"solid\",\"line_width\":\"normal\",\"palette\":\"dog_classic\"}}],\"show_legend\":true,\"time\":{},\"title\":\"\",\"type\":\"timeseries\"}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 1096,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1096,
45+
"text": "{\"id\":\"zvr-td5-ppm\",\"title\":\"Test-Create_a_new_timeseries_widget_with_product_analytics_data_source-1758221477 with product_analytics datasource\",\"description\":null,\"author_handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"author_name\":\"CI Account\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/zvr-td5-ppm/test-createanewtimeserieswidgetwithproductanalyticsdatasource-1758221477-with-pr\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"legend_columns\":[\"avg\",\"min\",\"max\",\"value\",\"sum\"],\"legend_layout\":\"auto\",\"requests\":[{\"display_type\":\"line\",\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"product_analytics\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"test_level:test\"}}],\"response_format\":\"timeseries\",\"style\":{\"line_type\":\"solid\",\"line_width\":\"normal\",\"palette\":\"dog_classic\"}}],\"show_legend\":true,\"time\":{},\"title\":\"\",\"type\":\"timeseries\"},\"id\":6058978575853641}],\"notify_list\":null,\"created_at\":\"2025-09-18T18:51:18.107135+00:00\",\"modified_at\":\"2025-09-18T18:51:18.107135+00:00\",\"reflow_type\":\"auto\",\"restricted_roles\":[]}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 381,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-09-18T18:51:17.959Z",
61+
"time": 209
62+
},
63+
{
64+
"_id": "b2bcdc4b8964a91c4df0a3bfb46ad9f5",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
}
76+
],
77+
"headersSize": 520,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/dashboard/zvr-td5-ppm"
82+
},
83+
"response": {
84+
"bodySize": 39,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 39,
88+
"text": "{\"deleted_dashboard_id\":\"zvr-td5-ppm\"}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 687,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2025-09-18T18:51:18.176Z",
104+
"time": 239
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* Create a new timeseries widget with product_analytics data source
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.DashboardsApi(configuration);
9+
10+
const params: v1.DashboardsApiCreateDashboardRequest = {
11+
body: {
12+
title: "Example-Dashboard with product_analytics datasource",
13+
widgets: [
14+
{
15+
definition: {
16+
title: "",
17+
showLegend: true,
18+
legendLayout: "auto",
19+
legendColumns: ["avg", "min", "max", "value", "sum"],
20+
time: {},
21+
type: "timeseries",
22+
requests: [
23+
{
24+
formulas: [
25+
{
26+
formula: "query1",
27+
},
28+
],
29+
queries: [
30+
{
31+
dataSource: "product_analytics",
32+
name: "query1",
33+
search: {
34+
query: "test_level:test",
35+
},
36+
indexes: ["*"],
37+
compute: {
38+
aggregation: "count",
39+
},
40+
groupBy: [],
41+
},
42+
],
43+
responseFormat: "timeseries",
44+
style: {
45+
palette: "dog_classic",
46+
lineType: "solid",
47+
lineWidth: "normal",
48+
},
49+
displayType: "line",
50+
},
51+
],
52+
},
53+
},
54+
],
55+
layoutType: "ordered",
56+
reflowType: "auto",
57+
},
58+
};
59+
60+
apiInstance
61+
.createDashboard(params)
62+
.then((data: v1.Dashboard) => {
63+
console.log(
64+
"API called successfully. Returned data: " + JSON.stringify(data)
65+
);
66+
})
67+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,15 @@ Feature: Dashboards
950950
And the response "widgets[0].definition.time.value" is equal to 8
951951
And the response "widgets[0].definition.time.hide_incomplete_cost_data" is equal to true
952952

953+
@team:DataDog/dashboards-backend
954+
Scenario: Create a new timeseries widget with product_analytics data source
955+
Given new "CreateDashboard" request
956+
And body with value {"title":"{{ unique }} with product_analytics datasource","widgets":[{"definition":{"title":"","show_legend":true,"legend_layout":"auto","legend_columns":["avg","min","max","value","sum"],"time":{},"type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"product_analytics","name":"query1","search":{"query":"test_level:test"},"indexes":["*"],"compute":{"aggregation":"count"},"group_by":[]}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"line"}]}}],"layout_type":"ordered","reflow_type":"auto"}
957+
When the request is sent
958+
Then the response status is 200 OK
959+
And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "product_analytics"
960+
And the response "widgets[0].definition.requests[0].queries[0].search.query" is equal to "test_level:test"
961+
953962
@generated @skip @team:DataDog/reporting-and-sharing
954963
Scenario: Create a shared dashboard returns "Bad Request" response
955964
Given new "CreatePublicDashboard" request

packages/datadog-api-client-v1/models/FormulaAndFunctionEventsDataSource.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export type FormulaAndFunctionEventsDataSource =
2222
| typeof CI_TESTS
2323
| typeof CI_PIPELINES
2424
| typeof INCIDENT_ANALYTICS
25+
| typeof PRODUCT_ANALYTICS
2526
| UnparsedObject;
2627
export const LOGS = "logs";
2728
export const SPANS = "spans";
@@ -34,3 +35,4 @@ export const EVENTS = "events";
3435
export const CI_TESTS = "ci_tests";
3536
export const CI_PIPELINES = "ci_pipelines";
3637
export const INCIDENT_ANALYTICS = "incident_analytics";
38+
export const PRODUCT_ANALYTICS = "product_analytics";

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ const enumsMap: { [key: string]: any[] } = {
773773
"ci_tests",
774774
"ci_pipelines",
775775
"incident_analytics",
776+
"product_analytics",
776777
],
777778
FormulaAndFunctionMetricAggregation: [
778779
"avg",

0 commit comments

Comments
 (0)