Skip to content

Commit 9be580a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1a2792a3 of spec repo
1 parent f3172fe commit 9be580a

File tree

14 files changed

+426
-5
lines changed

14 files changed

+426
-5
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-02-12 18:33:45.250628",
8-
"spec_repo_commit": "6a4cfb82"
7+
"regenerated": "2025-02-14 13:48:35.170531",
8+
"spec_repo_commit": "1a2792a3"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-12 18:33:45.266253",
13-
"spec_repo_commit": "6a4cfb82"
12+
"regenerated": "2025-02-14 13:48:35.186676",
13+
"spec_repo_commit": "1a2792a3"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -17340,11 +17340,13 @@ components:
1734017340
enum:
1734117341
- number
1734217342
- bar
17343+
- trend
1734317344
example: number
1734417345
type: string
1734517346
x-enum-varnames:
1734617347
- NUMBER
1734717348
- BAR
17349+
- TREND
1734817350
TableWidgetDefinition:
1734917351
description: The table visualization is available on timeboards and screenboards.
1735017352
It displays columns of metrics grouped by tag key.
@@ -23033,6 +23035,8 @@ components:
2303323035
type: string
2303423036
cell_display_mode:
2303523037
$ref: '#/components/schemas/TableWidgetCellDisplayMode'
23038+
cell_display_mode_options:
23039+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptions'
2303623040
conditional_formats:
2303723041
description: List of conditional formats.
2303823042
items:
@@ -23049,6 +23053,37 @@ components:
2304923053
required:
2305023054
- formula
2305123055
type: object
23056+
WidgetFormulaCellDisplayModeOptions:
23057+
description: Cell display mode options for the widget formula. (only if `cell_display_mode`
23058+
is set to `trend`).
23059+
properties:
23060+
trend_type:
23061+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptionsTrendType'
23062+
y_scale:
23063+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptionsYScale'
23064+
type: object
23065+
WidgetFormulaCellDisplayModeOptionsTrendType:
23066+
description: Trend type for the cell display mode options.
23067+
enum:
23068+
- area
23069+
- line
23070+
- bars
23071+
example: area
23072+
type: string
23073+
x-enum-varnames:
23074+
- AREA
23075+
- LINE
23076+
- BARS
23077+
WidgetFormulaCellDisplayModeOptionsYScale:
23078+
description: Y scale for the cell display mode options.
23079+
enum:
23080+
- shared
23081+
- independent
23082+
example: shared
23083+
type: string
23084+
x-enum-varnames:
23085+
- SHARED
23086+
- INDEPENDENT
2305223087
WidgetFormulaLimit:
2305323088
description: Options for limiting results returned.
2305423089
properties:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-02-14T13:36:57.006Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new dashboard with query_table widget and cell_display_mode is trend",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "9d4358ff728ac463b983e41258632fa2",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 756,
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": 557,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"description\":\"\",\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_query_table_widget_and_cell_display_mode_is_trend-1739540217\",\"widgets\":[{\"definition\":{\"has_search_bar\":\"auto\",\"requests\":[{\"formulas\":[{\"cell_display_mode\":\"trend\",\"cell_display_mode_options\":{\"trend_type\":\"line\",\"y_scale\":\"shared\"},\"conditional_formats\":[],\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":500,\"order_by\":[{\"index\":0,\"order\":\"desc\",\"type\":\"formula\"}]}}],\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"query_table\"},\"layout\":{\"height\":32,\"width\":54,\"x\":0,\"y\":0}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 1108,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1108,
45+
"text": "{\"id\":\"qw6-574-sem\",\"title\":\"Test-Create_a_new_dashboard_with_query_table_widget_and_cell_display_mode_is_trend-1739540217\",\"description\":\"\",\"author_handle\":\"frog@datadoghq.com\",\"author_name\":\"frog\",\"layout_type\":\"free\",\"url\":\"/dashboard/qw6-574-sem/test-createanewdashboardwithquerytablewidgetandcelldisplaymodeistrend-1739540217\",\"is_read_only\":false,\"template_variables\":[],\"widgets\":[{\"definition\":{\"has_search_bar\":\"auto\",\"requests\":[{\"formulas\":[{\"cell_display_mode\":\"trend\",\"cell_display_mode_options\":{\"trend_type\":\"line\",\"y_scale\":\"shared\"},\"conditional_formats\":[],\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":500,\"order_by\":[{\"index\":0,\"order\":\"desc\",\"type\":\"formula\"}]}}],\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"query_table\"},\"layout\":{\"height\":32,\"width\":54,\"x\":0,\"y\":0},\"id\":6048610427342909}],\"notify_list\":[],\"created_at\":\"2025-02-14T13:36:57.493950+00:00\",\"modified_at\":\"2025-02-14T13:36:57.493950+00:00\",\"restricted_roles\":[]}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 657,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-02-14T13:36:57.008Z",
61+
"time": 617
62+
},
63+
{
64+
"_id": "56170a3f6fdc72d7c9fd25036e59824a",
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": 518,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/dashboard/qw6-574-sem"
82+
},
83+
"response": {
84+
"bodySize": 39,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 39,
88+
"text": "{\"deleted_dashboard_id\":\"qw6-574-sem\"}\n"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 655,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2025-02-14T13:36:57.635Z",
104+
"time": 567
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/**
2+
* Create a new dashboard with query_table widget and cell_display_mode is trend
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",
13+
description: "",
14+
widgets: [
15+
{
16+
layout: {
17+
x: 0,
18+
y: 0,
19+
width: 54,
20+
height: 32,
21+
},
22+
definition: {
23+
title: "",
24+
titleSize: "16",
25+
titleAlign: "left",
26+
time: {},
27+
type: "query_table",
28+
requests: [
29+
{
30+
queries: [
31+
{
32+
dataSource: "metrics",
33+
name: "query1",
34+
query: "avg:system.cpu.user{*} by {host}",
35+
aggregator: "avg",
36+
},
37+
],
38+
formulas: [
39+
{
40+
formula: "query1",
41+
conditionalFormats: [],
42+
cellDisplayMode: "trend",
43+
cellDisplayModeOptions: {
44+
trendType: "line",
45+
yScale: "shared",
46+
},
47+
},
48+
],
49+
sort: {
50+
count: 500,
51+
orderBy: [
52+
{
53+
type: "formula",
54+
index: 0,
55+
order: "desc",
56+
},
57+
],
58+
},
59+
responseFormat: "scalar",
60+
},
61+
],
62+
hasSearchBar: "auto",
63+
},
64+
},
65+
],
66+
templateVariables: [],
67+
layoutType: "free",
68+
notifyList: [],
69+
},
70+
};
71+
72+
apiInstance
73+
.createDashboard(params)
74+
.then((data: v1.Dashboard) => {
75+
console.log(
76+
"API called successfully. Returned data: " + JSON.stringify(data)
77+
);
78+
})
79+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

+11
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,17 @@ Feature: Dashboards
610610
And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "formula"
611611
And the response "widgets[0].definition.requests[0].sort.order_by[0].index" is equal to 0
612612

613+
@team:DataDog/dashboards-backend
614+
Scenario: Create a new dashboard with query_table widget and cell_display_mode is trend
615+
Given new "CreateDashboard" request
616+
And body from file "dashboards_json_payload/query_table_widget_cell_display_mode_trend.json"
617+
When the request is sent
618+
Then the response status is 200 OK
619+
And the response "widgets[0].definition.type" is equal to "query_table"
620+
And the response "widgets[0].definition.requests[0].formulas[0].cell_display_mode" is equal to "trend"
621+
And the response "widgets[0].definition.requests[0].formulas[0].cell_display_mode_options.trend_type" is equal to "line"
622+
And the response "widgets[0].definition.requests[0].formulas[0].cell_display_mode_options.y_scale" is equal to "shared"
623+
613624
@team:DataDog/dashboards-backend
614625
Scenario: Create a new dashboard with query_table widget and text formatting
615626
Given new "CreateDashboard" request
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"title":"{{ unique }}",
3+
"description":"",
4+
"widgets":[
5+
{
6+
"layout":{
7+
"x":0,
8+
"y":0,
9+
"width":54,
10+
"height":32
11+
},
12+
"definition":{
13+
"title":"",
14+
"title_size":"16",
15+
"title_align":"left",
16+
"time":{
17+
18+
},
19+
"type":"query_table",
20+
"requests":[
21+
{
22+
"queries":[
23+
{
24+
"data_source":"metrics",
25+
"name":"query1",
26+
"query":"avg:system.cpu.user{*} by {host}",
27+
"aggregator":"avg"
28+
}
29+
],
30+
"formulas":[
31+
{
32+
"formula":"query1",
33+
"conditional_formats":[
34+
35+
],
36+
"cell_display_mode": "trend",
37+
"cell_display_mode_options": {
38+
"trend_type": "line",
39+
"y_scale": "shared"
40+
}
41+
}
42+
],
43+
"sort": {
44+
"count":500,
45+
"order_by":[
46+
{
47+
"type":"formula",
48+
"index":0,
49+
"order":"desc"
50+
}
51+
]
52+
},
53+
"response_format":"scalar"
54+
}
55+
],
56+
"has_search_bar":"auto"
57+
}
58+
}
59+
],
60+
"template_variables":[
61+
62+
],
63+
"layout_type":"free",
64+
"notify_list":[
65+
66+
]
67+
}

packages/datadog-api-client-v1/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,9 @@ export { WidgetEvent } from "./models/WidgetEvent";
11891189
export { WidgetEventSize } from "./models/WidgetEventSize";
11901190
export { WidgetFieldSort } from "./models/WidgetFieldSort";
11911191
export { WidgetFormula } from "./models/WidgetFormula";
1192+
export { WidgetFormulaCellDisplayModeOptions } from "./models/WidgetFormulaCellDisplayModeOptions";
1193+
export { WidgetFormulaCellDisplayModeOptionsTrendType } from "./models/WidgetFormulaCellDisplayModeOptionsTrendType";
1194+
export { WidgetFormulaCellDisplayModeOptionsYScale } from "./models/WidgetFormulaCellDisplayModeOptionsYScale";
11921195
export { WidgetFormulaLimit } from "./models/WidgetFormulaLimit";
11931196
export { WidgetFormulaSort } from "./models/WidgetFormulaSort";
11941197
export { WidgetFormulaStyle } from "./models/WidgetFormulaStyle";

0 commit comments

Comments
 (0)