Skip to content

Commit 42f3f95

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add description field to widget definition schemas (#3652)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 3ec493c commit 42f3f95

File tree

41 files changed

+1089
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1089
-28
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ components:
481481
description: ID of the alert to use in the widget.
482482
example: ""
483483
type: string
484+
description:
485+
description: The description of the widget.
486+
type: string
484487
time:
485488
$ref: "#/components/schemas/WidgetTime"
486489
title:
@@ -516,6 +519,9 @@ components:
516519
description: ID of the alert to use in the widget.
517520
example: ""
518521
type: string
522+
description:
523+
description: The description of the widget.
524+
type: string
519525
precision:
520526
description: Number of decimal to show. If not defined, will use the raw value.
521527
format: int64
@@ -808,6 +814,9 @@ components:
808814
items:
809815
$ref: "#/components/schemas/WidgetCustomLink"
810816
type: array
817+
description:
818+
description: The description of the widget.
819+
type: string
811820
requests:
812821
description: List of bar chart widget requests.
813822
example: ["q": "system.load.1"]
@@ -1015,6 +1024,9 @@ components:
10151024
items:
10161025
$ref: "#/components/schemas/WidgetCustomLink"
10171026
type: array
1027+
description:
1028+
description: The description of the widget.
1029+
type: string
10181030
requests:
10191031
description: |-
10201032
Array of one request object to display in the widget.
@@ -1177,6 +1189,9 @@ components:
11771189
description: Name of the check to use in the widget.
11781190
example: ""
11791191
type: string
1192+
description:
1193+
description: The description of the widget.
1194+
type: string
11801195
group:
11811196
description: Group reporting a single check.
11821197
type: string
@@ -1815,6 +1830,9 @@ components:
18151830
items:
18161831
$ref: "#/components/schemas/WidgetCustomLink"
18171832
type: array
1833+
description:
1834+
description: The description of the widget.
1835+
type: string
18181836
legend_size:
18191837
deprecated: true
18201838
description: (Deprecated) The widget legend was replaced by a tooltip and sidebar.
@@ -2501,6 +2519,9 @@ components:
25012519
The event stream is a widget version of the stream of events
25022520
on the Event Stream view. Only available on FREE layout dashboards.
25032521
properties:
2522+
description:
2523+
description: The description of the widget.
2524+
type: string
25042525
event_size:
25052526
$ref: "#/components/schemas/WidgetEventSize"
25062527
query:
@@ -2538,6 +2559,9 @@ components:
25382559
EventTimelineWidgetDefinition:
25392560
description: The event timeline is a widget version of the timeline that appears at the top of the Event Stream view. Only available on FREE layout dashboards.
25402561
properties:
2562+
description:
2563+
description: The description of the widget.
2564+
type: string
25412565
query:
25422566
description: Query to filter the event timeline with.
25432567
example: ""
@@ -3273,6 +3297,9 @@ components:
32733297
description: |-
32743298
The funnel visualization displays a funnel of user sessions that maps a sequence of view navigation and user interaction in your application.
32753299
properties:
3300+
description:
3301+
description: The description of the widget.
3302+
type: string
32763303
requests:
32773304
description: Request payload used to query items.
32783305
example: [{"query": {"data_source": "rum", "query_string": "@browser.name:Chrome", "steps": [{"facet": "@view.name", "value": "/logs"}, {"facet": "@view.name", "value": "/apm/home"}]}, "request_type": "funnel"}]
@@ -3468,6 +3495,9 @@ components:
34683495
items:
34693496
$ref: "#/components/schemas/WidgetCustomLink"
34703497
type: array
3498+
description:
3499+
description: The description of the widget.
3500+
type: string
34713501
requests:
34723502
description: |-
34733503
Array of request objects to display in the widget. May include an optional request for the region layer and/or an optional request for the points layer. Region layer requests must contain a `group-by` tag whose value is a country ISO code.
@@ -3734,6 +3764,9 @@ components:
37343764
items:
37353765
$ref: "#/components/schemas/WidgetCustomLink"
37363766
type: array
3767+
description:
3768+
description: The description of the widget.
3769+
type: string
37373770
events:
37383771
deprecated: true
37393772
description: List of widget events. Deprecated - Use `overlay` request type instead.
@@ -3999,6 +4032,9 @@ components:
39994032
items:
40004033
$ref: "#/components/schemas/WidgetCustomLink"
40014034
type: array
4035+
description:
4036+
description: The description of the widget.
4037+
type: string
40024038
group:
40034039
description: List of tag prefixes to group by.
40044040
items:
@@ -4978,6 +5014,9 @@ components:
49785014
The list stream visualization displays a table of recent events in your application that
49795015
match a search criteria using user-defined columns.
49805016
properties:
5017+
description:
5018+
description: The description of the widget.
5019+
type: string
49815020
legend_size:
49825021
$ref: "#/components/schemas/WidgetLegendSize"
49835022
requests:
@@ -5159,6 +5198,9 @@ components:
51595198
description: Column name.
51605199
type: string
51615200
type: array
5201+
description:
5202+
description: The description of the widget.
5203+
type: string
51625204
indexes:
51635205
description: An array of index names to query in the stream. Use [] to query all indexes at once.
51645206
example: ["days-3", "days-7"]
@@ -8572,6 +8614,9 @@ components:
85728614
description: The number of monitors to display.
85738615
format: int64
85748616
type: integer
8617+
description:
8618+
description: The description of the widget.
8619+
type: string
85758620
display_format:
85768621
$ref: "#/components/schemas/WidgetMonitorSummaryDisplayFormat"
85778622
hide_zero_counts:
@@ -10960,6 +11005,9 @@ components:
1096011005
custom_unit:
1096111006
description: Display a unit of your choice on the widget.
1096211007
type: string
11008+
description:
11009+
description: The description of the widget.
11010+
type: string
1096311011
precision:
1096411012
description: Number of decimals to show. If not defined, the widget uses the raw value.
1096511013
format: int64
@@ -11129,6 +11177,9 @@ components:
1112911177
items:
1113011178
$ref: "#/components/schemas/WidgetCustomLink"
1113111179
type: array
11180+
description:
11181+
description: The description of the widget.
11182+
type: string
1113211183
inputs:
1113311184
description: Array of workflow inputs to map to dashboard template variables.
1113411185
items:
@@ -12091,6 +12142,9 @@ components:
1209112142
SLOListWidgetDefinition:
1209212143
description: Use the SLO List widget to track your SLOs (Service Level Objectives) on dashboards.
1209312144
properties:
12145+
description:
12146+
description: The description of the widget.
12147+
type: string
1209412148
requests:
1209512149
description: Array of one request object to display in the widget.
1209612150
items:
@@ -12638,6 +12692,9 @@ components:
1263812692
additional_query_filters:
1263912693
description: Additional filters applied to the SLO query.
1264012694
type: string
12695+
description:
12696+
description: The description of the widget.
12697+
type: string
1264112698
global_time_target:
1264212699
description: Defined global time target.
1264312700
type: string
@@ -12737,6 +12794,9 @@ components:
1273712794
items:
1273812795
$ref: "#/components/schemas/WidgetCustomLink"
1273912796
type: array
12797+
description:
12798+
description: The description of the widget.
12799+
type: string
1274012800
requests:
1274112801
$ref: "#/components/schemas/ScatterPlotWidgetDefinitionRequests"
1274212802
time:
@@ -13555,6 +13615,9 @@ components:
1355513615
items:
1355613616
$ref: "#/components/schemas/WidgetCustomLink"
1355713617
type: array
13618+
description:
13619+
description: The description of the widget.
13620+
type: string
1355813621
filters:
1355913622
description: Your environment and primary tag (or * if enabled for your account).
1356013623
example: ["*"]
@@ -13594,6 +13657,9 @@ components:
1359413657
ServiceSummaryWidgetDefinition:
1359513658
description: The service summary displays the graphs of a chosen service in your screenboard. Only available on FREE layout dashboards.
1359613659
properties:
13660+
description:
13661+
description: The description of the widget.
13662+
type: string
1359713663
display_format:
1359813664
$ref: "#/components/schemas/WidgetServiceSummaryDisplayFormat"
1359913665
env:
@@ -14200,6 +14266,9 @@ components:
1420014266
items:
1420114267
$ref: "#/components/schemas/WidgetCustomLink"
1420214268
type: array
14269+
description:
14270+
description: The description of the widget.
14271+
type: string
1420314272
hide_total:
1420414273
description: Show the total value in this widget.
1420514274
type: boolean
@@ -18142,6 +18211,9 @@ components:
1814218211
items:
1814318212
$ref: "#/components/schemas/WidgetCustomLink"
1814418213
type: array
18214+
description:
18215+
description: The description of the widget.
18216+
type: string
1814518217
has_search_bar:
1814618218
$ref: "#/components/schemas/TableWidgetHasSearchBar"
1814718219
requests:
@@ -18487,6 +18559,9 @@ components:
1848718559
items:
1848818560
$ref: "#/components/schemas/WidgetCustomLink"
1848918561
type: array
18562+
description:
18563+
description: The description of the widget.
18564+
type: string
1849018565
events:
1849118566
deprecated: true
1849218567
description: List of widget events. Deprecated - Use `overlay` request type instead.
@@ -18661,6 +18736,9 @@ components:
1866118736
items:
1866218737
$ref: "#/components/schemas/WidgetCustomLink"
1866318738
type: array
18739+
description:
18740+
description: The description of the widget.
18741+
type: string
1866418742
requests:
1866518743
description: List of top list widget requests.
1866618744
example: ["q": "system.load.1"]
@@ -18842,6 +18920,9 @@ components:
1884218920
items:
1884318921
$ref: "#/components/schemas/WidgetCustomLink"
1884418922
type: array
18923+
description:
18924+
description: The description of the widget.
18925+
type: string
1884518926
requests:
1884618927
description: One or more Topology requests.
1884718928
items:
@@ -18957,6 +19038,9 @@ components:
1895719038
items:
1895819039
$ref: "#/components/schemas/WidgetCustomLink"
1895919040
type: array
19041+
description:
19042+
description: The description of the widget.
19043+
type: string
1896019044
group_by:
1896119045
$ref: "#/components/schemas/TreeMapGroupBy"
1896219046
requests:

examples/v1/dashboards/CreateDashboard_2349863258.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public static void main(String[] args) {
4040
.title("")
4141
.titleSize("16")
4242
.titleAlign(WidgetTextAlign.LEFT)
43+
.description("Example widget description")
4344
.time(new WidgetTime(new WidgetLegacyLiveSpan()))
4445
.type(QueryValueWidgetDefinitionType.QUERY_VALUE)
4546
.requests(

examples/v1/dashboards/CreateDashboard_3520534424.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public static void main(String[] args) {
4747
.title("")
4848
.titleSize("16")
4949
.titleAlign(WidgetTextAlign.LEFT)
50+
.description("Example widget description")
5051
.showLegend(true)
5152
.legendLayout(TimeseriesWidgetLegendLayout.AUTO)
5253
.time(new WidgetTime(new WidgetLegacyLiveSpan()))
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Create a new dashboard with a query_value widget containing a description
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v1.api.DashboardsApi;
6+
import com.datadog.api.client.v1.model.Dashboard;
7+
import com.datadog.api.client.v1.model.DashboardLayoutType;
8+
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricAggregation;
9+
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricDataSource;
10+
import com.datadog.api.client.v1.model.FormulaAndFunctionMetricQueryDefinition;
11+
import com.datadog.api.client.v1.model.FormulaAndFunctionQueryDefinition;
12+
import com.datadog.api.client.v1.model.FormulaAndFunctionResponseFormat;
13+
import com.datadog.api.client.v1.model.QueryValueWidgetDefinition;
14+
import com.datadog.api.client.v1.model.QueryValueWidgetDefinitionType;
15+
import com.datadog.api.client.v1.model.QueryValueWidgetRequest;
16+
import com.datadog.api.client.v1.model.Widget;
17+
import com.datadog.api.client.v1.model.WidgetDefinition;
18+
import com.datadog.api.client.v1.model.WidgetLayout;
19+
import com.datadog.api.client.v1.model.WidgetLegacyLiveSpan;
20+
import com.datadog.api.client.v1.model.WidgetTextAlign;
21+
import com.datadog.api.client.v1.model.WidgetTime;
22+
import java.util.Collections;
23+
24+
public class Example {
25+
public static void main(String[] args) {
26+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
27+
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
28+
29+
Dashboard body =
30+
new Dashboard()
31+
.title("Example-Dashboard")
32+
.description("")
33+
.widgets(
34+
Collections.singletonList(
35+
new Widget()
36+
.layout(new WidgetLayout().x(0L).y(0L).width(47L).height(15L))
37+
.definition(
38+
new WidgetDefinition(
39+
new QueryValueWidgetDefinition()
40+
.title("")
41+
.titleSize("16")
42+
.titleAlign(WidgetTextAlign.LEFT)
43+
.description("Example widget description")
44+
.time(new WidgetTime(new WidgetLegacyLiveSpan()))
45+
.type(QueryValueWidgetDefinitionType.QUERY_VALUE)
46+
.requests(
47+
Collections.singletonList(
48+
new QueryValueWidgetRequest()
49+
.responseFormat(
50+
FormulaAndFunctionResponseFormat.SCALAR)
51+
.queries(
52+
Collections.singletonList(
53+
new FormulaAndFunctionQueryDefinition(
54+
new FormulaAndFunctionMetricQueryDefinition()
55+
.name("query1")
56+
.dataSource(
57+
FormulaAndFunctionMetricDataSource
58+
.METRICS)
59+
.query("avg:system.cpu.user{*}")
60+
.aggregator(
61+
FormulaAndFunctionMetricAggregation
62+
.AVG))))))
63+
.autoscale(true)
64+
.precision(2L)))))
65+
.layoutType(DashboardLayoutType.FREE);
66+
67+
try {
68+
Dashboard result = apiInstance.createDashboard(body);
69+
System.out.println(result);
70+
} catch (ApiException e) {
71+
System.err.println("Exception when calling DashboardsApi#createDashboard");
72+
System.err.println("Status code: " + e.getCode());
73+
System.err.println("Reason: " + e.getResponseBody());
74+
System.err.println("Response headers: " + e.getResponseHeaders());
75+
e.printStackTrace();
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)