Skip to content

Commit 4ccfa0c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 497f78f of spec repo (#3066)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 8b9ff11 commit 4ccfa0c

File tree

11 files changed

+374
-11
lines changed

11 files changed

+374
-11
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,9 +3448,10 @@ components:
34483448
$ref: '#/components/schemas/WidgetCustomLink'
34493449
type: array
34503450
requests:
3451-
description: 'Array of one request object to display in the widget. The
3452-
request must contain a `group-by` tag whose value is a country ISO code.
3453-
3451+
description: 'Array of request objects to display in the widget. May include
3452+
an optional request for the region layer and/or an optional request for
3453+
the points layer. Region layer requests must contain a `group-by` tag
3454+
whose value is a country ISO code.
34543455

34553456
See the [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json)
34563457

@@ -3461,7 +3462,7 @@ components:
34613462
query: <METRIC_1>{<SCOPE_1>}
34623463
items:
34633464
$ref: '#/components/schemas/GeomapWidgetRequest'
3464-
maxItems: 1
3465+
maxItems: 2
34653466
minItems: 1
34663467
type: array
34673468
style:
@@ -3519,8 +3520,9 @@ components:
35193520
focus: WORLD
35203521
properties:
35213522
focus:
3522-
description: The 2-letter ISO code of a country to focus the map on. Or
3523-
`WORLD`.
3523+
description: The 2-letter ISO code of a country to focus the map on, or
3524+
`WORLD` for global view, or a region (`EMEA`, `APAC`, `LATAM`), or a continent
3525+
(`NORTH_AMERICA`, `SOUTH_AMERICA`, `EUROPE`, `AFRICA`, `ASIA`, `OCEANIA`).
35243526
example: WORLD
35253527
type: string
35263528
required:
@@ -3539,6 +3541,12 @@ components:
35393541
items:
35403542
$ref: '#/components/schemas/ListStreamColumn'
35413543
type: array
3544+
conditional_formats:
3545+
description: Threshold (numeric) conditional formatting rules may be used
3546+
by a regions layer.
3547+
items:
3548+
$ref: '#/components/schemas/WidgetConditionalFormat'
3549+
type: array
35423550
formulas:
35433551
description: List of formulas that operate on queries.
35443552
items:
@@ -3564,6 +3572,23 @@ components:
35643572
$ref: '#/components/schemas/LogQueryDefinition'
35653573
sort:
35663574
$ref: '#/components/schemas/WidgetSortBy'
3575+
style:
3576+
$ref: '#/components/schemas/GeomapWidgetRequestStyle'
3577+
text_formats:
3578+
description: Text formatting rules may be used by a points layer.
3579+
items:
3580+
$ref: '#/components/schemas/TableWidgetTextFormatRule'
3581+
type: array
3582+
type: object
3583+
GeomapWidgetRequestStyle:
3584+
description: The style to apply to the request for points layer.
3585+
example:
3586+
color_by: status
3587+
properties:
3588+
color_by:
3589+
description: The category to color the points by.
3590+
example: status
3591+
type: string
35673592
type: object
35683593
GraphSnapshot:
35693594
description: Object representing a graph snapshot.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-12-08T10:46:15.353Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a geomap widget with conditional formats and text formats",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "d20ad35b9db2e5d7ed599e12c501ec3d",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 1403,
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": 560,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"description\":\"Test-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1765190775\",\"layout_type\":\"ordered\",\"notify_list\":[],\"reflow_type\":\"fixed\",\"tags\":[],\"template_variables\":[],\"title\":\"Test-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1765190775\",\"widgets\":[{\"definition\":{\"requests\":[{\"conditional_formats\":[{\"comparator\":\">\",\"palette\":\"white_on_green\",\"value\":1000}],\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"rum\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"@type:session\"}}],\"response_format\":\"scalar\",\"sort\":{\"count\":250,\"order_by\":[{\"index\":0,\"order\":\"desc\",\"type\":\"formula\"}]}},{\"columns\":[{\"field\":\"@network.client.geoip.location.latitude\",\"width\":\"auto\"},{\"field\":\"@network.client.geoip.location.longitude\",\"width\":\"auto\"},{\"field\":\"@network.client.geoip.country.iso_code\",\"width\":\"auto\"},{\"field\":\"@network.client.geoip.subdivision.name\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"logs_stream\",\"indexes\":[],\"query_string\":\"\",\"storage\":\"hot\"},\"response_format\":\"event_list\",\"style\":{\"color_by\":\"status\"},\"text_formats\":[{\"match\":{\"type\":\"is\",\"value\":\"error\"},\"palette\":\"white_on_red\"}]}],\"style\":{\"palette\":\"hostmap_blues\",\"palette_flip\":false},\"title\":\"Log Count by Service and Source\",\"type\":\"geomap\",\"view\":{\"focus\":\"NORTH_AMERICA\"}},\"layout\":{\"height\":6,\"width\":12,\"x\":0,\"y\":0}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 1736,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 1736,
45+
"text": "{\"id\":\"n2i-h6d-x6a\",\"title\":\"Test-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1765190775\",\"description\":\"Test-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1765190775\",\"author_handle\":\"[email protected]\",\"author_name\":\"Shishi Liu\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/n2i-h6d-x6a/test-createageomapwidgetwithconditionalformatsandtextformats-1765190775\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"conditional_formats\":[{\"comparator\":\">\",\"palette\":\"white_on_green\",\"value\":1000}],\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"rum\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"@type:session\"}}],\"response_format\":\"scalar\",\"sort\":{\"count\":250,\"order_by\":[{\"index\":0,\"order\":\"desc\",\"type\":\"formula\"}]}},{\"columns\":[{\"field\":\"@network.client.geoip.location.latitude\",\"width\":\"auto\"},{\"field\":\"@network.client.geoip.location.longitude\",\"width\":\"auto\"},{\"field\":\"@network.client.geoip.country.iso_code\",\"width\":\"auto\"},{\"field\":\"@network.client.geoip.subdivision.name\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"logs_stream\",\"indexes\":[],\"query_string\":\"\",\"storage\":\"hot\"},\"response_format\":\"event_list\",\"style\":{\"color_by\":\"status\"},\"text_formats\":[{\"match\":{\"type\":\"is\",\"value\":\"error\"},\"palette\":\"white_on_red\"}]}],\"style\":{\"palette\":\"hostmap_blues\",\"palette_flip\":false},\"title\":\"Log Count by Service and Source\",\"type\":\"geomap\",\"view\":{\"focus\":\"NORTH_AMERICA\"}},\"layout\":{\"height\":6,\"width\":12,\"x\":0,\"y\":0},\"id\":4916490421180340}],\"notify_list\":[],\"created_at\":\"2025-12-08T10:46:15.791396+00:00\",\"modified_at\":\"2025-12-08T10:46:15.791396+00:00\",\"reflow_type\":\"fixed\",\"tags\":[],\"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-12-08T10:46:15.368Z",
61+
"time": 540
62+
},
63+
{
64+
"_id": "47b9d68833554d5352921b2bc1461606",
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/n2i-h6d-x6a"
82+
},
83+
"response": {
84+
"bodySize": 38,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 38,
88+
"text": "{\"deleted_dashboard_id\":\"n2i-h6d-x6a\"}"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 379,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2025-12-08T10:46:15.943Z",
104+
"time": 640
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/**
2+
* Create a geomap widget with conditional formats and text formats
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: "Example-Dashboard",
14+
widgets: [
15+
{
16+
definition: {
17+
title: "Log Count by Service and Source",
18+
type: "geomap",
19+
requests: [
20+
{
21+
responseFormat: "scalar",
22+
queries: [
23+
{
24+
dataSource: "rum",
25+
name: "query1",
26+
search: {
27+
query: "@type:session",
28+
},
29+
indexes: ["*"],
30+
compute: {
31+
aggregation: "count",
32+
},
33+
groupBy: [],
34+
},
35+
],
36+
conditionalFormats: [
37+
{
38+
comparator: ">",
39+
value: 1000,
40+
palette: "white_on_green",
41+
},
42+
],
43+
formulas: [
44+
{
45+
formula: "query1",
46+
},
47+
],
48+
sort: {
49+
count: 250,
50+
orderBy: [
51+
{
52+
type: "formula",
53+
index: 0,
54+
order: "desc",
55+
},
56+
],
57+
},
58+
},
59+
{
60+
responseFormat: "event_list",
61+
query: {
62+
dataSource: "logs_stream",
63+
queryString: "",
64+
indexes: [],
65+
storage: "hot",
66+
},
67+
columns: [
68+
{
69+
field: "@network.client.geoip.location.latitude",
70+
width: "auto",
71+
},
72+
{
73+
field: "@network.client.geoip.location.longitude",
74+
width: "auto",
75+
},
76+
{
77+
field: "@network.client.geoip.country.iso_code",
78+
width: "auto",
79+
},
80+
{
81+
field: "@network.client.geoip.subdivision.name",
82+
width: "auto",
83+
},
84+
],
85+
style: {
86+
colorBy: "status",
87+
},
88+
textFormats: [
89+
{
90+
match: {
91+
type: "is",
92+
value: "error",
93+
},
94+
palette: "white_on_red",
95+
},
96+
],
97+
},
98+
],
99+
style: {
100+
palette: "hostmap_blues",
101+
paletteFlip: false,
102+
},
103+
view: {
104+
focus: "NORTH_AMERICA",
105+
},
106+
},
107+
layout: {
108+
x: 0,
109+
y: 0,
110+
width: 12,
111+
height: 6,
112+
},
113+
},
114+
],
115+
templateVariables: [],
116+
layoutType: "ordered",
117+
notifyList: [],
118+
reflowType: "fixed",
119+
tags: [],
120+
},
121+
};
122+
123+
apiInstance
124+
.createDashboard(params)
125+
.then((data: v1.Dashboard) => {
126+
console.log(
127+
"API called successfully. Returned data: " + JSON.stringify(data)
128+
);
129+
})
130+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ Feature: Dashboards
7272
And the response "widgets[0].definition.requests[0].response_format" is equal to "event_list"
7373
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_stream"
7474

75+
@team:DataDog/dashboards-backend
76+
Scenario: Create a geomap widget with conditional formats and text formats
77+
Given new "CreateDashboard" request
78+
And body with value {"title": "{{ unique }}","description": "{{ unique }}","widgets":[{"definition":{"title":"Log Count by Service and Source","type":"geomap","requests":[{"response_format":"scalar","queries":[{"data_source":"rum","name":"query1","search":{"query":"@type:session"},"indexes":["*"],"compute":{"aggregation":"count"},"group_by":[]}],"conditional_formats":[{"comparator":">","value":1000,"palette":"white_on_green"}],"formulas":[{"formula":"query1"}],"sort":{"count":250,"order_by":[{"type":"formula","index":0,"order":"desc"}]}},{"response_format":"event_list","query":{"data_source":"logs_stream","query_string":"","indexes":[],"storage":"hot"},"columns":[{"field":"@network.client.geoip.location.latitude","width":"auto"},{"field":"@network.client.geoip.location.longitude","width":"auto"},{"field":"@network.client.geoip.country.iso_code","width":"auto"},{"field":"@network.client.geoip.subdivision.name","width":"auto"}],"style":{"color_by":"status"},"text_formats":[{"match":{"type":"is","value":"error"},"palette":"white_on_red"}]}],"style":{"palette":"hostmap_blues","palette_flip":false},"view":{"focus":"NORTH_AMERICA"}},"layout":{"x":0,"y":0,"width":12,"height":6}}],"template_variables":[],"layout_type":"ordered","notify_list":[],"reflow_type":"fixed","tags":[]}
79+
When the request is sent
80+
Then the response status is 200 OK
81+
And the response "widgets[0].definition.type" is equal to "geomap"
82+
And the response "widgets[0].definition.title" is equal to "Log Count by Service and Source"
83+
And the response "widgets[0].definition.requests[0].conditional_formats[0].comparator" is equal to ">"
84+
And the response "widgets[0].definition.requests[0].conditional_formats[0].palette" is equal to "white_on_green"
85+
And the response "widgets[0].definition.requests[0].conditional_formats[0].value" is equal to 1000
86+
And the response "widgets[0].definition.requests[1].text_formats[0].match.type" is equal to "is"
87+
And the response "widgets[0].definition.requests[1].text_formats[0].match.value" is equal to "error"
88+
And the response "widgets[0].definition.requests[1].text_formats[0].palette" is equal to "white_on_red"
89+
And the response "widgets[0].definition.view.focus" is equal to "NORTH_AMERICA"
90+
7591
@generated @skip @team:DataDog/dashboards-backend
7692
Scenario: Create a new dashboard returns "Bad Request" response
7793
Given new "CreateDashboard" request

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ export { GeomapWidgetDefinitionStyle } from "./models/GeomapWidgetDefinitionStyl
485485
export { GeomapWidgetDefinitionType } from "./models/GeomapWidgetDefinitionType";
486486
export { GeomapWidgetDefinitionView } from "./models/GeomapWidgetDefinitionView";
487487
export { GeomapWidgetRequest } from "./models/GeomapWidgetRequest";
488+
export { GeomapWidgetRequestStyle } from "./models/GeomapWidgetRequestStyle";
488489
export { GraphSnapshot } from "./models/GraphSnapshot";
489490
export { GroupType } from "./models/GroupType";
490491
export { GroupWidgetDefinition } from "./models/GroupWidgetDefinition";

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ export class GeomapWidgetDefinition {
2222
*/
2323
"customLinks"?: Array<WidgetCustomLink>;
2424
/**
25-
* Array of one request object to display in the widget. The request must contain a `group-by` tag whose value is a country ISO code.
26-
*
25+
* 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.
2726
* See the [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json)
2827
* for information about building the `REQUEST_SCHEMA`.
2928
*/
30-
"requests": [GeomapWidgetRequest];
29+
"requests": Array<GeomapWidgetRequest>;
3130
/**
3231
* The style to apply to the widget.
3332
*/
@@ -79,7 +78,7 @@ export class GeomapWidgetDefinition {
7978
},
8079
requests: {
8180
baseName: "requests",
82-
type: "[GeomapWidgetRequest]",
81+
type: "Array<GeomapWidgetRequest>",
8382
required: true,
8483
},
8584
style: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1111
*/
1212
export class GeomapWidgetDefinitionView {
1313
/**
14-
* The 2-letter ISO code of a country to focus the map on. Or `WORLD`.
14+
* The 2-letter ISO code of a country to focus the map on, or `WORLD` for global view, or a region (`EMEA`, `APAC`, `LATAM`), or a continent (`NORTH_AMERICA`, `SOUTH_AMERICA`, `EUROPE`, `AFRICA`, `ASIA`, `OCEANIA`).
1515
*/
1616
"focus": string;
1717

0 commit comments

Comments
 (0)