-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Toplist widget's stacked display style - remove legend as require…
…d field (#1838) Co-authored-by: ci.datadog-api-spec <[email protected]>
- Loading branch information
1 parent
9032786
commit 330aef7
Showing
7 changed files
with
209 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ard-with-a-toplist-widget-with-stacked-type-and-no-legend-specified_233038852/frozen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"2024-09-30T17:24:52.299Z" |
110 changes: 110 additions & 0 deletions
110
...d-with-a-toplist-widget-with-stacked-type-and-no-legend-specified_233038852/recording.har
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"log": { | ||
"_recordingName": "Dashboards/Create a new dashboard with a toplist widget with stacked type and no legend specified", | ||
"creator": { | ||
"comment": "persister:fs", | ||
"name": "Polly.JS", | ||
"version": "6.0.5" | ||
}, | ||
"entries": [ | ||
{ | ||
"_id": "1668edb0df4aa19bf3e773c89dbafdd3", | ||
"_order": 0, | ||
"cache": {}, | ||
"request": { | ||
"bodySize": 726, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"_fromType": "array", | ||
"name": "accept", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "content-type", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 557, | ||
"httpVersion": "HTTP/1.1", | ||
"method": "POST", | ||
"postData": { | ||
"mimeType": "application/json", | ||
"params": [], | ||
"text": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified-1727717092\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"name\":\"service\",\"order\":\"asc\",\"type\":\"group\"}]}}],\"style\":{\"display\":{\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"toplist\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" | ||
}, | ||
"queryString": [], | ||
"url": "https://api.datadoghq.com/api/v1/dashboard" | ||
}, | ||
"response": { | ||
"bodySize": 1082, | ||
"content": { | ||
"mimeType": "application/json", | ||
"size": 1082, | ||
"text": "{\"id\":\"2az-xeg-xar\",\"title\":\"Test-Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified-1727717092\",\"description\":\"\",\"author_handle\":\"[email protected]\",\"author_name\":null,\"layout_type\":\"free\",\"url\":\"/dashboard/2az-xeg-xar/test-createanewdashboardwithatoplistwidgetwithstackedtypeandnolegendspecified-17\",\"is_read_only\":false,\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"name\":\"service\",\"order\":\"asc\",\"type\":\"group\"}]}}],\"style\":{\"display\":{\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"toplist\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":688132644515996}],\"notify_list\":[],\"created_at\":\"2024-09-30T17:24:52.542207+00:00\",\"modified_at\":\"2024-09-30T17:24:52.542207+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}\n" | ||
}, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"name": "content-type", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 657, | ||
"httpVersion": "HTTP/1.1", | ||
"redirectURL": "", | ||
"status": 200, | ||
"statusText": "OK" | ||
}, | ||
"startedDateTime": "2024-09-30T17:24:52.306Z", | ||
"time": 295 | ||
}, | ||
{ | ||
"_id": "bf18df2e89763aab55ba5494d3060e55", | ||
"_order": 0, | ||
"cache": {}, | ||
"request": { | ||
"bodySize": 0, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"_fromType": "array", | ||
"name": "accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 518, | ||
"httpVersion": "HTTP/1.1", | ||
"method": "DELETE", | ||
"queryString": [], | ||
"url": "https://api.datadoghq.com/api/v1/dashboard/2az-xeg-xar" | ||
}, | ||
"response": { | ||
"bodySize": 39, | ||
"content": { | ||
"mimeType": "application/json", | ||
"size": 39, | ||
"text": "{\"deleted_dashboard_id\":\"2az-xeg-xar\"}\n" | ||
}, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"name": "content-type", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 655, | ||
"httpVersion": "HTTP/1.1", | ||
"redirectURL": "", | ||
"status": 200, | ||
"statusText": "OK" | ||
}, | ||
"startedDateTime": "2024-09-30T17:24:52.617Z", | ||
"time": 188 | ||
} | ||
], | ||
"pages": [], | ||
"version": "1.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* Create a new dashboard with a toplist widget with stacked type and no legend specified | ||
*/ | ||
|
||
import { client, v1 } from "@datadog/datadog-api-client"; | ||
|
||
const configuration = client.createConfiguration(); | ||
const apiInstance = new v1.DashboardsApi(configuration); | ||
|
||
const params: v1.DashboardsApiCreateDashboardRequest = { | ||
body: { | ||
title: "Example-Dashboard", | ||
description: "", | ||
widgets: [ | ||
{ | ||
layout: { | ||
x: 0, | ||
y: 0, | ||
width: 47, | ||
height: 15, | ||
}, | ||
definition: { | ||
title: "", | ||
titleSize: "16", | ||
titleAlign: "left", | ||
time: {}, | ||
style: { | ||
display: { | ||
type: "stacked", | ||
}, | ||
scaling: "relative", | ||
palette: "dog_classic", | ||
}, | ||
type: "toplist", | ||
requests: [ | ||
{ | ||
queries: [ | ||
{ | ||
dataSource: "metrics", | ||
name: "query1", | ||
query: "avg:system.cpu.user{*} by {service}", | ||
aggregator: "avg", | ||
}, | ||
], | ||
formulas: [ | ||
{ | ||
formula: "query1", | ||
}, | ||
], | ||
sort: { | ||
count: 10, | ||
orderBy: [ | ||
{ | ||
type: "group", | ||
name: "service", | ||
order: "asc", | ||
}, | ||
], | ||
}, | ||
responseFormat: "scalar", | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
templateVariables: [], | ||
layoutType: "free", | ||
isReadOnly: false, | ||
notifyList: [], | ||
}, | ||
}; | ||
|
||
apiInstance | ||
.createDashboard(params) | ||
.then((data: v1.Dashboard) => { | ||
console.log( | ||
"API called successfully. Returned data: " + JSON.stringify(data) | ||
); | ||
}) | ||
.catch((error: any) => console.error(error)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters