Skip to content

Commit 4945359

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1a2792a3 of spec repo
1 parent 9da23c9 commit 4945359

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-12 18:33:48.053303",
8-
"spec_repo_commit": "6a4cfb82"
7+
"regenerated": "2025-02-14 13:48:37.479615",
8+
"spec_repo_commit": "1a2792a3"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-12 18:33:48.069553",
13-
"spec_repo_commit": "6a4cfb82"
12+
"regenerated": "2025-02-14 13:48:37.498990",
13+
"spec_repo_commit": "1a2792a3"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17340,11 +17340,13 @@ components:
1734017340
enum:
1734117341
- number
1734217342
- bar
17343+
- trend
1734317344
example: number
1734417345
type: string
1734517346
x-enum-varnames:
1734617347
- NUMBER
1734717348
- BAR
17349+
- TREND
1734817350
TableWidgetDefinition:
1734917351
description: The table visualization is available on timeboards and screenboards.
1735017352
It displays columns of metrics grouped by tag key.
@@ -23033,6 +23035,8 @@ components:
2303323035
type: string
2303423036
cell_display_mode:
2303523037
$ref: '#/components/schemas/TableWidgetCellDisplayMode'
23038+
cell_display_mode_options:
23039+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptions'
2303623040
conditional_formats:
2303723041
description: List of conditional formats.
2303823042
items:
@@ -23049,6 +23053,37 @@ components:
2304923053
required:
2305023054
- formula
2305123055
type: object
23056+
WidgetFormulaCellDisplayModeOptions:
23057+
description: Cell display mode options for the widget formula. (only if `cell_display_mode`
23058+
is set to `trend`).
23059+
properties:
23060+
trend_type:
23061+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptionsTrendType'
23062+
y_scale:
23063+
$ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptionsYScale'
23064+
type: object
23065+
WidgetFormulaCellDisplayModeOptionsTrendType:
23066+
description: Trend type for the cell display mode options.
23067+
enum:
23068+
- area
23069+
- line
23070+
- bars
23071+
example: area
23072+
type: string
23073+
x-enum-varnames:
23074+
- AREA
23075+
- LINE
23076+
- BARS
23077+
WidgetFormulaCellDisplayModeOptionsYScale:
23078+
description: Y scale for the cell display mode options.
23079+
enum:
23080+
- shared
23081+
- independent
23082+
example: shared
23083+
type: string
23084+
x-enum-varnames:
23085+
- SHARED
23086+
- INDEPENDENT
2305223087
WidgetFormulaLimit:
2305323088
description: Options for limiting results returned.
2305423089
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
@@ -868,6 +868,9 @@ def overrides
868868
"v1.widget_event_size" => "WidgetEventSize",
869869
"v1.widget_field_sort" => "WidgetFieldSort",
870870
"v1.widget_formula" => "WidgetFormula",
871+
"v1.widget_formula_cell_display_mode_options" => "WidgetFormulaCellDisplayModeOptions",
872+
"v1.widget_formula_cell_display_mode_options_trend_type" => "WidgetFormulaCellDisplayModeOptionsTrendType",
873+
"v1.widget_formula_cell_display_mode_options_y_scale" => "WidgetFormulaCellDisplayModeOptionsYScale",
871874
"v1.widget_formula_limit" => "WidgetFormulaLimit",
872875
"v1.widget_formula_sort" => "WidgetFormulaSort",
873876
"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

@@ -47,6 +50,7 @@ def self.attribute_map
4750
{
4851
:'_alias' => :'alias',
4952
:'cell_display_mode' => :'cell_display_mode',
53+
:'cell_display_mode_options' => :'cell_display_mode_options',
5054
:'conditional_formats' => :'conditional_formats',
5155
:'formula' => :'formula',
5256
:'limit' => :'limit',
@@ -60,6 +64,7 @@ def self.openapi_types
6064
{
6165
:'_alias' => :'String',
6266
:'cell_display_mode' => :'TableWidgetCellDisplayMode',
67+
:'cell_display_mode_options' => :'WidgetFormulaCellDisplayModeOptions',
6368
:'conditional_formats' => :'Array<WidgetConditionalFormat>',
6469
:'formula' => :'String',
6570
:'limit' => :'WidgetFormulaLimit',
@@ -93,6 +98,10 @@ def initialize(attributes = {})
9398
self.cell_display_mode = attributes[:'cell_display_mode']
9499
end
95100

101+
if attributes.key?(:'cell_display_mode_options')
102+
self.cell_display_mode_options = attributes[:'cell_display_mode_options']
103+
end
104+
96105
if attributes.key?(:'conditional_formats')
97106
if (value = attributes[:'conditional_formats']).is_a?(Array)
98107
self.conditional_formats = value
@@ -158,6 +167,7 @@ def ==(o)
158167
self.class == o.class &&
159168
_alias == o._alias &&
160169
cell_display_mode == o.cell_display_mode &&
170+
cell_display_mode_options == o.cell_display_mode_options &&
161171
conditional_formats == o.conditional_formats &&
162172
formula == o.formula &&
163173
limit == o.limit &&
@@ -169,7 +179,7 @@ def ==(o)
169179
# @return [Integer] Hash code
170180
# @!visibility private
171181
def hash
172-
[_alias, cell_display_mode, conditional_formats, formula, limit, style, additional_properties].hash
182+
[_alias, cell_display_mode, cell_display_mode_options, conditional_formats, formula, limit, style, additional_properties].hash
173183
end
174184
end
175185
end

0 commit comments

Comments
 (0)