Skip to content

Commit b62c997

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

File tree

10 files changed

+359
-15
lines changed

10 files changed

+359
-15
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.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-12-08T10:46:15.353Z

cassettes/features/v1/dashboards/Create-a-geomap-widget-with-conditional-formats-and-text-formats.yml

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Create a geomap widget with conditional formats and text formats
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5+
6+
body = DatadogAPIClient::V1::Dashboard.new({
7+
title: "Example-Dashboard",
8+
description: "Example-Dashboard",
9+
widgets: [
10+
DatadogAPIClient::V1::Widget.new({
11+
definition: DatadogAPIClient::V1::GeomapWidgetDefinition.new({
12+
title: "Log Count by Service and Source",
13+
type: DatadogAPIClient::V1::GeomapWidgetDefinitionType::GEOMAP,
14+
requests: [
15+
DatadogAPIClient::V1::GeomapWidgetRequest.new({
16+
response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
17+
queries: [
18+
DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({
19+
data_source: DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::RUM,
20+
name: "query1",
21+
search: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({
22+
query: "@type:session",
23+
}),
24+
indexes: [
25+
"*",
26+
],
27+
compute: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({
28+
aggregation: DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::COUNT,
29+
}),
30+
group_by: [],
31+
}),
32+
],
33+
conditional_formats: [
34+
DatadogAPIClient::V1::WidgetConditionalFormat.new({
35+
comparator: DatadogAPIClient::V1::WidgetComparator::GREATER_THAN,
36+
value: 1000,
37+
palette: DatadogAPIClient::V1::WidgetPalette::WHITE_ON_GREEN,
38+
}),
39+
],
40+
formulas: [
41+
DatadogAPIClient::V1::WidgetFormula.new({
42+
formula: "query1",
43+
}),
44+
],
45+
sort: DatadogAPIClient::V1::WidgetSortBy.new({
46+
count: 250,
47+
order_by: [
48+
DatadogAPIClient::V1::WidgetFormulaSort.new({
49+
type: DatadogAPIClient::V1::FormulaType::FORMULA,
50+
index: 0,
51+
order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
52+
}),
53+
],
54+
}),
55+
}),
56+
DatadogAPIClient::V1::GeomapWidgetRequest.new({
57+
response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::EVENT_LIST,
58+
query: DatadogAPIClient::V1::ListStreamQuery.new({
59+
data_source: DatadogAPIClient::V1::ListStreamSource::LOGS_STREAM,
60+
query_string: "",
61+
indexes: [],
62+
storage: "hot",
63+
}),
64+
columns: [
65+
DatadogAPIClient::V1::ListStreamColumn.new({
66+
field: "@network.client.geoip.location.latitude",
67+
width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO,
68+
}),
69+
DatadogAPIClient::V1::ListStreamColumn.new({
70+
field: "@network.client.geoip.location.longitude",
71+
width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO,
72+
}),
73+
DatadogAPIClient::V1::ListStreamColumn.new({
74+
field: "@network.client.geoip.country.iso_code",
75+
width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO,
76+
}),
77+
DatadogAPIClient::V1::ListStreamColumn.new({
78+
field: "@network.client.geoip.subdivision.name",
79+
width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO,
80+
}),
81+
],
82+
style: DatadogAPIClient::V1::GeomapWidgetRequestStyle.new({
83+
color_by: "status",
84+
}),
85+
text_formats: [
86+
DatadogAPIClient::V1::TableWidgetTextFormatRule.new({
87+
match: DatadogAPIClient::V1::TableWidgetTextFormatMatch.new({
88+
type: DatadogAPIClient::V1::TableWidgetTextFormatMatchType::IS,
89+
value: "error",
90+
}),
91+
palette: DatadogAPIClient::V1::TableWidgetTextFormatPalette::WHITE_ON_RED,
92+
}),
93+
],
94+
}),
95+
],
96+
style: DatadogAPIClient::V1::GeomapWidgetDefinitionStyle.new({
97+
palette: "hostmap_blues",
98+
palette_flip: false,
99+
}),
100+
view: DatadogAPIClient::V1::GeomapWidgetDefinitionView.new({
101+
focus: "NORTH_AMERICA",
102+
}),
103+
}),
104+
layout: DatadogAPIClient::V1::WidgetLayout.new({
105+
x: 0,
106+
y: 0,
107+
width: 12,
108+
height: 6,
109+
}),
110+
}),
111+
],
112+
template_variables: [],
113+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
114+
notify_list: [],
115+
reflow_type: DatadogAPIClient::V1::DashboardReflowType::FIXED,
116+
tags: [],
117+
})
118+
p api_instance.create_dashboard(body)

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

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def overrides
162162
"v1.geomap_widget_definition_type" => "GeomapWidgetDefinitionType",
163163
"v1.geomap_widget_definition_view" => "GeomapWidgetDefinitionView",
164164
"v1.geomap_widget_request" => "GeomapWidgetRequest",
165+
"v1.geomap_widget_request_style" => "GeomapWidgetRequestStyle",
165166
"v1.graph_snapshot" => "GraphSnapshot",
166167
"v1.group_type" => "GroupType",
167168
"v1.group_widget_definition" => "GroupWidgetDefinition",

lib/datadog_api_client/v1/models/geomap_widget_definition.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ class GeomapWidgetDefinition
2424
# A list of custom links.
2525
attr_accessor :custom_links
2626

27-
# 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.
28-
#
27+
# 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.
2928
# See the [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json)
3029
# for information about building the `REQUEST_SCHEMA`.
3130
attr_reader :requests
@@ -149,7 +148,7 @@ def initialize(attributes = {})
149148
# @!visibility private
150149
def valid?
151150
return false if @requests.nil?
152-
return false if @requests.length > 1
151+
return false if @requests.length > 2
153152
return false if @requests.length < 1
154153
return false if @style.nil?
155154
return false if @type.nil?
@@ -164,8 +163,8 @@ def requests=(requests)
164163
if requests.nil?
165164
fail ArgumentError, 'invalid value for "requests", requests cannot be nil.'
166165
end
167-
if requests.length > 1
168-
fail ArgumentError, 'invalid value for "requests", number of items must be less than or equal to 1.'
166+
if requests.length > 2
167+
fail ArgumentError, 'invalid value for "requests", number of items must be less than or equal to 2.'
169168
end
170169
if requests.length < 1
171170
fail ArgumentError, 'invalid value for "requests", number of items must be greater than or equal to 1.'

lib/datadog_api_client/v1/models/geomap_widget_definition_view.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module DatadogAPIClient::V1
2121
class GeomapWidgetDefinitionView
2222
include BaseGenericModel
2323

24-
# The 2-letter ISO code of a country to focus the map on. Or `WORLD`.
24+
# 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`).
2525
attr_reader :focus
2626

2727
attr_accessor :additional_properties

0 commit comments

Comments
 (0)