Skip to content

Commit 62969d2

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c7f66d5e of spec repo
1 parent f09b11b commit 62969d2

File tree

8 files changed

+183
-11
lines changed

8 files changed

+183
-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 20:35:06.522324",
8+
"spec_repo_commit": "c7f66d5e"
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 20:35:06.538785",
13+
"spec_repo_commit": "c7f66d5e"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 13 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
@@ -12578,6 +12585,12 @@ components:
1257812585
prefix:
1257912586
description: The tag/attribute key associated with the template variable.
1258012587
type: string
12588+
type:
12589+
description: The type of variable. This is to differentiate between filter
12590+
variables (interpolated in query) and group by variables (interpolated
12591+
into group by).
12592+
nullable: true
12593+
type: string
1258112594
visible_tags:
1258212595
description: List of visible tag values on the shared dashboard.
1258312596
items:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
"service",
16+
"datacenter",
17+
"env",
18+
],
19+
default: "service",
20+
defaults: [
21+
"service",
22+
"datacenter",
23+
],
24+
name: "group_by_var",
25+
type: "group",
26+
}),
27+
],
28+
title: "",
29+
widgets: [
30+
DatadogAPIClient::V1::Widget.new({
31+
definition: DatadogAPIClient::V1::HostMapWidgetDefinition.new({
32+
requests: DatadogAPIClient::V1::HostMapWidgetDefinitionRequests.new({
33+
fill: DatadogAPIClient::V1::HostMapRequest.new({
34+
q: "avg:system.cpu.user{*}",
35+
}),
36+
}),
37+
type: DatadogAPIClient::V1::HostMapWidgetDefinitionType::HOSTMAP,
38+
}),
39+
}),
40+
],
41+
})
42+
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: 43 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": ["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 "group_by_var"
817+
And the response "template_variables[0].available_values[0]" is equal to "service"
818+
And the response "template_variables[0].defaults[0]" is equal to "service"
819+
And the response "template_variables[0].type" is equal to "group"
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,18 @@ 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+
And the response "selectable_template_vars[0].name" is equal to "group_by_var"
984+
And the response "selectable_template_vars[0].type" is equal to "group"
985+
963986
@generated @skip @team:DataDog/dashboards-backend
964987
Scenario: Delete a dashboard returns "Dashboards Not Found" response
965988
Given new "DeleteDashboard" request
@@ -1172,15 +1195,15 @@ Feature: Dashboards
11721195
Scenario: Update a dashboard returns "Bad Request" response
11731196
Given new "UpdateDashboard" request
11741197
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"}}]}
1198+
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"}}]}
11761199
When the request is sent
11771200
Then the response status is 400 Bad Request
11781201

11791202
@generated @skip @team:DataDog/dashboards-backend
11801203
Scenario: Update a dashboard returns "Item Not Found" response
11811204
Given new "UpdateDashboard" request
11821205
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"}}]}
1206+
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"}}]}
11841207
When the request is sent
11851208
Then the response status is 404 Item Not Found
11861209

@@ -1234,3 +1257,20 @@ Feature: Dashboards
12341257
And the response "global_time.live_span" is equal to "15m"
12351258
And the response "share_type" is equal to "open"
12361259
And the response "share_list" has length 0
1260+
1261+
@team:DataDog/reporting-and-sharing
1262+
Scenario: Update a shared dashboard with selectable_template_vars returns "OK" response
1263+
Given there is a valid "dashboard" in the system
1264+
And there is a valid "shared_dashboard" in the system
1265+
And new "UpdatePublicDashboard" request
1266+
And request contains "token" parameter from "shared_dashboard.token"
1267+
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"]}]}
1268+
When the request is sent
1269+
Then the response status is 200 OK
1270+
And the response "dashboard_id" has the same value as "dashboard.id"
1271+
And the response "dashboard_type" is equal to "custom_timeboard"
1272+
And the response "global_time.live_span" is equal to "15m"
1273+
And the response "share_type" is equal to "open"
1274+
And the response "share_list" has length 0
1275+
And the response "selectable_template_vars[0].name" is equal to "group_by_var"
1276+
And the response "selectable_template_vars[0].type" is equal to "group"

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: 12 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 type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
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,7 @@ def self.openapi_types
6166
# @!visibility private
6267
def self.openapi_nullable
6368
Set.new([
69+
:'type',
6470
:'visible_tags',
6571
])
6672
end
@@ -95,6 +101,10 @@ def initialize(attributes = {})
95101
self.prefix = attributes[:'prefix']
96102
end
97103

104+
if attributes.key?(:'type')
105+
self.type = attributes[:'type']
106+
end
107+
98108
if attributes.key?(:'visible_tags')
99109
if (value = attributes[:'visible_tags']).is_a?(Array)
100110
self.visible_tags = value
@@ -131,6 +141,7 @@ def ==(o)
131141
default_value == o.default_value &&
132142
name == o.name &&
133143
prefix == o.prefix &&
144+
type == o.type &&
134145
visible_tags == o.visible_tags &&
135146
additional_properties == o.additional_properties
136147
end
@@ -139,7 +150,7 @@ def ==(o)
139150
# @return [Integer] Hash code
140151
# @!visibility private
141152
def hash
142-
[default_value, name, prefix, visible_tags, additional_properties].hash
153+
[default_value, name, prefix, type, visible_tags, additional_properties].hash
143154
end
144155
end
145156
end

0 commit comments

Comments
 (0)