Skip to content

Commit 33d9078

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 21274f0f of spec repo
1 parent f09b11b commit 33d9078

File tree

8 files changed

+191
-11
lines changed

8 files changed

+191
-11
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-06-26 17:56:17.204143",
8-
"spec_repo_commit": "76086f13"
7+
"regenerated": "2025-06-27 19:57:24.761554",
8+
"spec_repo_commit": "21274f0f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-26 17:56:17.219918",
13-
"spec_repo_commit": "76086f13"
12+
"regenerated": "2025-06-27 19:57:24.777295",
13+
"spec_repo_commit": "21274f0f"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,13 @@ components:
15501550
example: host
15511551
nullable: true
15521552
type: string
1553+
type:
1554+
description: The type of variable. This is to differentiate between filter
1555+
variables (interpolated in query) and group by variables (interpolated
1556+
into group by).
1557+
example: group
1558+
nullable: true
1559+
type: string
15531560
required:
15541561
- name
15551562
type: object
@@ -12577,6 +12584,11 @@ components:
1257712584
type: string
1257812585
prefix:
1257912586
description: The tag/attribute key associated with the template variable.
12587+
nullable: true
12588+
type: string
12589+
type:
12590+
description: The default value of the template variable.
12591+
nullable: true
1258012592
type: string
1258112593
visible_tags:
1258212594
description: List of visible tag values on the shared dashboard.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Create a new dashboard with template variable type field returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5+
6+
body = DatadogAPIClient::V1::Dashboard.new({
7+
description: nil,
8+
layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED,
9+
notify_list: [],
10+
reflow_type: DatadogAPIClient::V1::DashboardReflowType::AUTO,
11+
restricted_roles: [],
12+
template_variables: [
13+
DatadogAPIClient::V1::DashboardTemplateVariable.new({
14+
available_values: [
15+
"my-host",
16+
"host1",
17+
"host2",
18+
],
19+
defaults: [
20+
"my-host",
21+
],
22+
name: "host1",
23+
prefix: "host",
24+
}),
25+
DatadogAPIClient::V1::DashboardTemplateVariable.new({
26+
available_values: [
27+
"service",
28+
"datacenter",
29+
"env",
30+
],
31+
default: "service",
32+
defaults: [
33+
"service",
34+
"datacenter",
35+
],
36+
name: "group_by_var",
37+
type: "group",
38+
}),
39+
],
40+
title: "",
41+
widgets: [
42+
DatadogAPIClient::V1::Widget.new({
43+
definition: DatadogAPIClient::V1::HostMapWidgetDefinition.new({
44+
requests: DatadogAPIClient::V1::HostMapWidgetDefinitionRequests.new({
45+
fill: DatadogAPIClient::V1::HostMapRequest.new({
46+
q: "avg:system.cpu.user{*}",
47+
}),
48+
}),
49+
type: DatadogAPIClient::V1::HostMapWidgetDefinitionType::HOSTMAP,
50+
}),
51+
}),
52+
],
53+
})
54+
p api_instance.create_dashboard(body)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Create a shared dashboard with a group template variable returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5+
6+
# there is a valid "dashboard" in the system
7+
DASHBOARD_ID = ENV["DASHBOARD_ID"]
8+
9+
body = DatadogAPIClient::V1::SharedDashboard.new({
10+
dashboard_id: DASHBOARD_ID,
11+
dashboard_type: DatadogAPIClient::V1::DashboardType::CUSTOM_TIMEBOARD,
12+
share_type: DatadogAPIClient::V1::DashboardShareType::OPEN,
13+
global_time: DatadogAPIClient::V1::DashboardGlobalTime.new({
14+
live_span: DatadogAPIClient::V1::DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR,
15+
}),
16+
selectable_template_vars: [
17+
DatadogAPIClient::V1::SelectableTemplateVariableItems.new({
18+
default_value: "*",
19+
name: "group_by_var",
20+
type: "group",
21+
visible_tags: [
22+
"selectableValue1",
23+
"selectableValue2",
24+
],
25+
}),
26+
],
27+
})
28+
p api_instance.create_public_dashboard(body)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Update a shared dashboard with selectable_template_vars returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
5+
6+
# there is a valid "shared_dashboard" in the system
7+
SHARED_DASHBOARD_TOKEN = ENV["SHARED_DASHBOARD_TOKEN"]
8+
9+
body = DatadogAPIClient::V1::SharedDashboardUpdateRequest.new({
10+
global_time: DatadogAPIClient::V1::SharedDashboardUpdateRequestGlobalTime.new({
11+
live_span: DatadogAPIClient::V1::DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES,
12+
}),
13+
share_list: [],
14+
share_type: DatadogAPIClient::V1::DashboardShareType::OPEN,
15+
selectable_template_vars: [
16+
DatadogAPIClient::V1::SelectableTemplateVariableItems.new({
17+
default_value: "*",
18+
name: "group_by_var",
19+
type: "group",
20+
visible_tags: [
21+
"selectableValue1",
22+
"selectableValue2",
23+
],
24+
}),
25+
],
26+
})
27+
p api_instance.update_public_dashboard(SHARED_DASHBOARD_TOKEN, body)

features/v1/dashboards.feature

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Feature: Dashboards
7575
@generated @skip @team:DataDog/dashboards-backend
7676
Scenario: Create a new dashboard returns "Bad Request" response
7777
Given new "CreateDashboard" request
78-
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
78+
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
7979
When the request is sent
8080
Then the response status is 400 Bad Request
8181

@@ -807,6 +807,17 @@ Feature: Dashboards
807807
And the response "template_variable_presets[0].template_variables[0].name" is equal to "datacenter"
808808
And the response "template_variable_presets[0].template_variables[0].values[0]" is equal to "*"
809809

810+
@team:DataDog/dashboards-backend
811+
Scenario: Create a new dashboard with template variable type field returns "OK" response
812+
Given new "CreateDashboard" request
813+
And body with value {"description": null, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "defaults": ["my-host"], "name": "host1", "prefix": "host"}, {"available_values": ["service", "datacenter", "env"], "default": "service", "defaults": ["service", "datacenter"], "name": "group_by_var", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
814+
When the request is sent
815+
Then the response status is 200 OK
816+
And the response "template_variables[0].name" is equal to "host1"
817+
And the response "template_variables[0].available_values[0]" is equal to "my-host"
818+
And the response "template_variables[0].defaults[0]" is equal to "my-host"
819+
And the response "template_variables[0].type" is equal to "filter"
820+
810821
@team:DataDog/dashboards-backend
811822
Scenario: Create a new dashboard with timeseries widget and formula style attributes
812823
Given new "CreateDashboard" request
@@ -960,6 +971,16 @@ Feature: Dashboards
960971
And the response "dashboard_id" has the same value as "dashboard.id"
961972
And the response "dashboard_type" is equal to "custom_timeboard"
962973

974+
@team:DataDog/reporting-and-sharing
975+
Scenario: Create a shared dashboard with a group template variable returns "OK" response
976+
Given there is a valid "dashboard" in the system
977+
And new "CreatePublicDashboard" request
978+
And body with value {"dashboard_id": "{{dashboard.id}}", "dashboard_type": "custom_timeboard", "share_type": "open", "global_time": {"live_span": "1h"}, "selectable_template_vars": [{"default_value": "*", "name": "group_by_var", "type": "group", "visible_tags": ["selectableValue1", "selectableValue2"]}]}
979+
When the request is sent
980+
Then the response status is 200 OK
981+
And the response "dashboard_id" has the same value as "dashboard.id"
982+
And the response "dashboard_type" is equal to "custom_timeboard"
983+
963984
@generated @skip @team:DataDog/dashboards-backend
964985
Scenario: Delete a dashboard returns "Dashboards Not Found" response
965986
Given new "DeleteDashboard" request
@@ -1172,15 +1193,15 @@ Feature: Dashboards
11721193
Scenario: Update a dashboard returns "Bad Request" response
11731194
Given new "UpdateDashboard" request
11741195
And request contains "dashboard_id" parameter from "REPLACE.ME"
1175-
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
1196+
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
11761197
When the request is sent
11771198
Then the response status is 400 Bad Request
11781199

11791200
@generated @skip @team:DataDog/dashboards-backend
11801201
Scenario: Update a dashboard returns "Item Not Found" response
11811202
Given new "UpdateDashboard" request
11821203
And request contains "dashboard_id" parameter from "REPLACE.ME"
1183-
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
1204+
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tags": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host", "type": "group"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]}
11841205
When the request is sent
11851206
Then the response status is 404 Item Not Found
11861207

@@ -1234,3 +1255,18 @@ Feature: Dashboards
12341255
And the response "global_time.live_span" is equal to "15m"
12351256
And the response "share_type" is equal to "open"
12361257
And the response "share_list" has length 0
1258+
1259+
@team:DataDog/reporting-and-sharing
1260+
Scenario: Update a shared dashboard with selectable_template_vars returns "OK" response
1261+
Given there is a valid "dashboard" in the system
1262+
And there is a valid "shared_dashboard" in the system
1263+
And new "UpdatePublicDashboard" request
1264+
And request contains "token" parameter from "shared_dashboard.token"
1265+
And body with value {"global_time": {"live_span": "15m"}, "share_list": [], "share_type": "open", "selectable_template_vars": [{"default_value": "*", "name": "group_by_var", "type": "group", "visible_tags": ["selectableValue1", "selectableValue2"]}]}
1266+
When the request is sent
1267+
Then the response status is 200 OK
1268+
And the response "dashboard_id" has the same value as "dashboard.id"
1269+
And the response "dashboard_type" is equal to "custom_timeboard"
1270+
And the response "global_time.live_span" is equal to "15m"
1271+
And the response "share_type" is equal to "open"
1272+
And the response "share_list" has length 0

lib/datadog_api_client/v1/models/dashboard_template_variable.rb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class DashboardTemplateVariable
3636
# The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
3737
attr_accessor :prefix
3838

39+
# The type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
40+
attr_accessor :type
41+
3942
attr_accessor :additional_properties
4043

4144
# Attribute mapping from ruby-style variable name to JSON key.
@@ -46,7 +49,8 @@ def self.attribute_map
4649
:'default' => :'default',
4750
:'defaults' => :'defaults',
4851
:'name' => :'name',
49-
:'prefix' => :'prefix'
52+
:'prefix' => :'prefix',
53+
:'type' => :'type'
5054
}
5155
end
5256

@@ -58,7 +62,8 @@ def self.openapi_types
5862
:'default' => :'String',
5963
:'defaults' => :'Array<String>',
6064
:'name' => :'String',
61-
:'prefix' => :'String'
65+
:'prefix' => :'String',
66+
:'type' => :'String'
6267
}
6368
end
6469

@@ -69,6 +74,7 @@ def self.openapi_nullable
6974
:'available_values',
7075
:'default',
7176
:'prefix',
77+
:'type',
7278
])
7379
end
7480

@@ -113,6 +119,10 @@ def initialize(attributes = {})
113119
if attributes.key?(:'prefix')
114120
self.prefix = attributes[:'prefix']
115121
end
122+
123+
if attributes.key?(:'type')
124+
self.type = attributes[:'type']
125+
end
116126
end
117127

118128
# Check to see if the all the properties in the model are valid
@@ -164,14 +174,15 @@ def ==(o)
164174
defaults == o.defaults &&
165175
name == o.name &&
166176
prefix == o.prefix &&
177+
type == o.type &&
167178
additional_properties == o.additional_properties
168179
end
169180

170181
# Calculates hash code according to all attributes.
171182
# @return [Integer] Hash code
172183
# @!visibility private
173184
def hash
174-
[available_values, default, defaults, name, prefix, additional_properties].hash
185+
[available_values, default, defaults, name, prefix, type, additional_properties].hash
175186
end
176187
end
177188
end

lib/datadog_api_client/v1/models/selectable_template_variable_items.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class SelectableTemplateVariableItems
3030
# The tag/attribute key associated with the template variable.
3131
attr_accessor :prefix
3232

33+
# The default value of the template variable.
34+
attr_accessor :type
35+
3336
# List of visible tag values on the shared dashboard.
3437
attr_accessor :visible_tags
3538

@@ -42,6 +45,7 @@ def self.attribute_map
4245
:'default_value' => :'default_value',
4346
:'name' => :'name',
4447
:'prefix' => :'prefix',
48+
:'type' => :'type',
4549
:'visible_tags' => :'visible_tags'
4650
}
4751
end
@@ -53,6 +57,7 @@ def self.openapi_types
5357
:'default_value' => :'String',
5458
:'name' => :'String',
5559
:'prefix' => :'String',
60+
:'type' => :'String',
5661
:'visible_tags' => :'Array<String>'
5762
}
5863
end
@@ -61,6 +66,8 @@ def self.openapi_types
6166
# @!visibility private
6267
def self.openapi_nullable
6368
Set.new([
69+
:'prefix',
70+
:'type',
6471
:'visible_tags',
6572
])
6673
end
@@ -95,6 +102,10 @@ def initialize(attributes = {})
95102
self.prefix = attributes[:'prefix']
96103
end
97104

105+
if attributes.key?(:'type')
106+
self.type = attributes[:'type']
107+
end
108+
98109
if attributes.key?(:'visible_tags')
99110
if (value = attributes[:'visible_tags']).is_a?(Array)
100111
self.visible_tags = value
@@ -131,6 +142,7 @@ def ==(o)
131142
default_value == o.default_value &&
132143
name == o.name &&
133144
prefix == o.prefix &&
145+
type == o.type &&
134146
visible_tags == o.visible_tags &&
135147
additional_properties == o.additional_properties
136148
end
@@ -139,7 +151,7 @@ def ==(o)
139151
# @return [Integer] Hash code
140152
# @!visibility private
141153
def hash
142-
[default_value, name, prefix, visible_tags, additional_properties].hash
154+
[default_value, name, prefix, type, visible_tags, additional_properties].hash
143155
end
144156
end
145157
end

0 commit comments

Comments
 (0)