Skip to content

Commit 27cd733

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8f2d39c3 of spec repo
1 parent 7e47a7a commit 27cd733

13 files changed

+416
-5
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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-20 18:33:33.220649",
8-
"spec_repo_commit": "d3fcdb89"
7+
"regenerated": "2025-02-21 08:00:33.138734",
8+
"spec_repo_commit": "8f2d39c3"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-20 18:33:33.236028",
13-
"spec_repo_commit": "d3fcdb89"
12+
"regenerated": "2025-02-21 08:00:33.154333",
13+
"spec_repo_commit": "8f2d39c3"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17396,11 +17396,13 @@ components:
1739617396
enum:
1739717397
- number
1739817398
- bar
17399+
- trend
1739917400
example: number
1740017401
type: string
1740117402
x-enum-varnames:
1740217403
- NUMBER
1740317404
- BAR
17405+
- TREND
1740417406
TableWidgetDefinition:
1740517407
description: The table visualization is available on timeboards and screenboards.
1740617408
It displays columns of metrics grouped by tag key.
@@ -23089,6 +23091,8 @@ components:
2308923091
type: string
2309023092
cell_display_mode:
2309123093
$ref: '#/components/schemas/TableWidgetCellDisplayMode'
23094+
cell_display_mode_options:
23095+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptions'
2309223096
conditional_formats:
2309323097
description: List of conditional formats.
2309423098
items:
@@ -23107,6 +23111,37 @@ components:
2310723111
required:
2310823112
- formula
2310923113
type: object
23114+
WidgetFormulaCellDisplayModeOptions:
23115+
description: Cell display mode options for the widget formula. (only if `cell_display_mode`
23116+
is set to `trend`).
23117+
properties:
23118+
trend_type:
23119+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptionsTrendType'
23120+
y_scale:
23121+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptionsYScale'
23122+
type: object
23123+
WidgetFormulaCellDisplayModeOptionsTrendType:
23124+
description: Trend type for the cell display mode options.
23125+
enum:
23126+
- area
23127+
- line
23128+
- bars
23129+
example: area
23130+
type: string
23131+
x-enum-varnames:
23132+
- AREA
23133+
- LINE
23134+
- BARS
23135+
WidgetFormulaCellDisplayModeOptionsYScale:
23136+
description: Y scale for the cell display mode options.
23137+
enum:
23138+
- shared
23139+
- independent
23140+
example: shared
23141+
type: string
23142+
x-enum-varnames:
23143+
- SHARED
23144+
- INDEPENDENT
2311023145
WidgetFormulaLimit:
2311123146
description: Options for limiting results returned.
2311223147
properties:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-02-14T13:36:57.006Z

cassettes/features/v1/dashboards/Create-a-new-dashboard-with-query-table-widget-and-cell-display-mode-is-trend.yml

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Create a new dashboard with query_table widget and cell_display_mode is trend
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: "",
9+
widgets: [
10+
DatadogAPIClient::V1::Widget.new({
11+
layout: DatadogAPIClient::V1::WidgetLayout.new({
12+
x: 0,
13+
y: 0,
14+
width: 54,
15+
height: 32,
16+
}),
17+
definition: DatadogAPIClient::V1::TableWidgetDefinition.new({
18+
title: "",
19+
title_size: "16",
20+
title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT,
21+
time: DatadogAPIClient::V1::WidgetLegacyLiveSpan.new({}),
22+
type: DatadogAPIClient::V1::TableWidgetDefinitionType::QUERY_TABLE,
23+
requests: [
24+
DatadogAPIClient::V1::TableWidgetRequest.new({
25+
queries: [
26+
DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({
27+
data_source: DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS,
28+
name: "query1",
29+
query: "avg:system.cpu.user{*} by {host}",
30+
aggregator: DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation::AVG,
31+
}),
32+
],
33+
formulas: [
34+
DatadogAPIClient::V1::WidgetFormula.new({
35+
formula: "query1",
36+
conditional_formats: [],
37+
cell_display_mode: DatadogAPIClient::V1::TableWidgetCellDisplayMode::TREND,
38+
cell_display_mode_options: DatadogAPIClient::V1::WidgetFormulaCellDisplayModeOptions.new({
39+
trend_type: DatadogAPIClient::V1::WidgetFormulaCellDisplayModeOptionsTrendType::LINE,
40+
y_scale: DatadogAPIClient::V1::WidgetFormulaCellDisplayModeOptionsYScale::SHARED,
41+
}),
42+
}),
43+
],
44+
sort: DatadogAPIClient::V1::WidgetSortBy.new({
45+
count: 500,
46+
order_by: [
47+
DatadogAPIClient::V1::WidgetFormulaSort.new({
48+
type: DatadogAPIClient::V1::FormulaType::FORMULA,
49+
index: 0,
50+
order: DatadogAPIClient::V1::WidgetSort::DESCENDING,
51+
}),
52+
],
53+
}),
54+
response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR,
55+
}),
56+
],
57+
has_search_bar: DatadogAPIClient::V1::TableWidgetHasSearchBar::AUTO,
58+
}),
59+
}),
60+
],
61+
template_variables: [],
62+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE,
63+
notify_list: [],
64+
})
65+
p api_instance.create_dashboard(body)

features/v1/dashboards.feature

Lines changed: 11 additions & 0 deletions
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
Lines changed: 67 additions & 0 deletions
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+
}

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,9 @@ def overrides
874874
"v1.widget_event_size" => "WidgetEventSize",
875875
"v1.widget_field_sort" => "WidgetFieldSort",
876876
"v1.widget_formula" => "WidgetFormula",
877+
"v1.widget_formula_cell_display_mode_options" => "WidgetFormulaCellDisplayModeOptions",
878+
"v1.widget_formula_cell_display_mode_options_trend_type" => "WidgetFormulaCellDisplayModeOptionsTrendType",
879+
"v1.widget_formula_cell_display_mode_options_y_scale" => "WidgetFormulaCellDisplayModeOptionsYScale",
877880
"v1.widget_formula_limit" => "WidgetFormulaLimit",
878881
"v1.widget_formula_sort" => "WidgetFormulaSort",
879882
"v1.widget_formula_style" => "WidgetFormulaStyle",

lib/datadog_api_client/v1/models/table_widget_cell_display_mode.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ class TableWidgetCellDisplayMode
2323

2424
NUMBER = "number".freeze
2525
BAR = "bar".freeze
26+
TREND = "trend".freeze
2627
end
2728
end

lib/datadog_api_client/v1/models/widget_formula.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class WidgetFormula
2727
# Define a display mode for the table cell.
2828
attr_accessor :cell_display_mode
2929

30+
# Cell display mode options for the widget formula. (only if `cell_display_mode` is set to `trend`).
31+
attr_accessor :cell_display_mode_options
32+
3033
# List of conditional formats.
3134
attr_accessor :conditional_formats
3235

@@ -50,6 +53,7 @@ def self.attribute_map
5053
{
5154
:'_alias' => :'alias',
5255
:'cell_display_mode' => :'cell_display_mode',
56+
:'cell_display_mode_options' => :'cell_display_mode_options',
5357
:'conditional_formats' => :'conditional_formats',
5458
:'formula' => :'formula',
5559
:'limit' => :'limit',
@@ -64,6 +68,7 @@ def self.openapi_types
6468
{
6569
:'_alias' => :'String',
6670
:'cell_display_mode' => :'TableWidgetCellDisplayMode',
71+
:'cell_display_mode_options' => :'WidgetFormulaCellDisplayModeOptions',
6772
:'conditional_formats' => :'Array<WidgetConditionalFormat>',
6873
:'formula' => :'String',
6974
:'limit' => :'WidgetFormulaLimit',
@@ -98,6 +103,10 @@ def initialize(attributes = {})
98103
self.cell_display_mode = attributes[:'cell_display_mode']
99104
end
100105

106+
if attributes.key?(:'cell_display_mode_options')
107+
self.cell_display_mode_options = attributes[:'cell_display_mode_options']
108+
end
109+
101110
if attributes.key?(:'conditional_formats')
102111
if (value = attributes[:'conditional_formats']).is_a?(Array)
103112
self.conditional_formats = value
@@ -167,6 +176,7 @@ def ==(o)
167176
self.class == o.class &&
168177
_alias == o._alias &&
169178
cell_display_mode == o.cell_display_mode &&
179+
cell_display_mode_options == o.cell_display_mode_options &&
170180
conditional_formats == o.conditional_formats &&
171181
formula == o.formula &&
172182
limit == o.limit &&
@@ -179,7 +189,7 @@ def ==(o)
179189
# @return [Integer] Hash code
180190
# @!visibility private
181191
def hash
182-
[_alias, cell_display_mode, conditional_formats, formula, limit, number_format, style, additional_properties].hash
192+
[_alias, cell_display_mode, cell_display_mode_options, conditional_formats, formula, limit, number_format, style, additional_properties].hash
183193
end
184194
end
185195
end

0 commit comments

Comments
 (0)