Skip to content

Commit b575b7c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit d8e7ee77 of spec repo (#2659)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent d3826c9 commit b575b7c

14 files changed

+452
-7
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-30 10:29:34.075550",
8-
"spec_repo_commit": "be63084a"
7+
"regenerated": "2025-06-30 17:05:09.046861",
8+
"spec_repo_commit": "d8e7ee77"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-30 10:29:34.091510",
13-
"spec_repo_commit": "be63084a"
12+
"regenerated": "2025-06-30 17:05:09.202568",
13+
"spec_repo_commit": "d8e7ee77"
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: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
"""
2+
Create a new dashboard with template variable type field returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
7+
from datadog_api_client.v1.model.dashboard import Dashboard
8+
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
9+
from datadog_api_client.v1.model.dashboard_reflow_type import DashboardReflowType
10+
from datadog_api_client.v1.model.dashboard_template_variable import DashboardTemplateVariable
11+
from datadog_api_client.v1.model.host_map_request import HostMapRequest
12+
from datadog_api_client.v1.model.host_map_widget_definition import HostMapWidgetDefinition
13+
from datadog_api_client.v1.model.host_map_widget_definition_requests import HostMapWidgetDefinitionRequests
14+
from datadog_api_client.v1.model.host_map_widget_definition_type import HostMapWidgetDefinitionType
15+
from datadog_api_client.v1.model.widget import Widget
16+
17+
body = Dashboard(
18+
description=None,
19+
layout_type=DashboardLayoutType.ORDERED,
20+
notify_list=[],
21+
reflow_type=DashboardReflowType.AUTO,
22+
restricted_roles=[],
23+
template_variables=[
24+
DashboardTemplateVariable(
25+
available_values=[
26+
"service",
27+
"datacenter",
28+
"env",
29+
],
30+
defaults=[
31+
"service",
32+
"datacenter",
33+
],
34+
name="group_by_var",
35+
type="group",
36+
),
37+
],
38+
title="",
39+
widgets=[
40+
Widget(
41+
definition=HostMapWidgetDefinition(
42+
requests=HostMapWidgetDefinitionRequests(
43+
fill=HostMapRequest(
44+
q="avg:system.cpu.user{*}",
45+
),
46+
),
47+
type=HostMapWidgetDefinitionType.HOSTMAP,
48+
),
49+
),
50+
],
51+
)
52+
53+
configuration = Configuration()
54+
with ApiClient(configuration) as api_client:
55+
api_instance = DashboardsApi(api_client)
56+
response = api_instance.create_dashboard(body=body)
57+
58+
print(response)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""
2+
Create a shared dashboard with a group template variable returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
8+
from datadog_api_client.v1.model.dashboard_global_time import DashboardGlobalTime
9+
from datadog_api_client.v1.model.dashboard_global_time_live_span import DashboardGlobalTimeLiveSpan
10+
from datadog_api_client.v1.model.dashboard_share_type import DashboardShareType
11+
from datadog_api_client.v1.model.dashboard_type import DashboardType
12+
from datadog_api_client.v1.model.selectable_template_variable_items import SelectableTemplateVariableItems
13+
from datadog_api_client.v1.model.shared_dashboard import SharedDashboard
14+
15+
# there is a valid "dashboard" in the system
16+
DASHBOARD_ID = environ["DASHBOARD_ID"]
17+
18+
body = SharedDashboard(
19+
dashboard_id=DASHBOARD_ID,
20+
dashboard_type=DashboardType.CUSTOM_TIMEBOARD,
21+
share_type=DashboardShareType.OPEN,
22+
global_time=DashboardGlobalTime(
23+
live_span=DashboardGlobalTimeLiveSpan.PAST_ONE_HOUR,
24+
),
25+
selectable_template_vars=[
26+
SelectableTemplateVariableItems(
27+
default_value="*",
28+
name="group_by_var",
29+
type="group",
30+
visible_tags=[
31+
"selectableValue1",
32+
"selectableValue2",
33+
],
34+
),
35+
],
36+
)
37+
38+
configuration = Configuration()
39+
with ApiClient(configuration) as api_client:
40+
api_instance = DashboardsApi(api_client)
41+
response = api_instance.create_public_dashboard(body=body)
42+
43+
print(response)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""
2+
Update a shared dashboard with selectable_template_vars returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
8+
from datadog_api_client.v1.model.dashboard_global_time_live_span import DashboardGlobalTimeLiveSpan
9+
from datadog_api_client.v1.model.dashboard_share_type import DashboardShareType
10+
from datadog_api_client.v1.model.selectable_template_variable_items import SelectableTemplateVariableItems
11+
from datadog_api_client.v1.model.shared_dashboard_update_request import SharedDashboardUpdateRequest
12+
from datadog_api_client.v1.model.shared_dashboard_update_request_global_time import (
13+
SharedDashboardUpdateRequestGlobalTime,
14+
)
15+
16+
# there is a valid "shared_dashboard" in the system
17+
SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"]
18+
19+
body = SharedDashboardUpdateRequest(
20+
global_time=SharedDashboardUpdateRequestGlobalTime(
21+
live_span=DashboardGlobalTimeLiveSpan.PAST_FIFTEEN_MINUTES,
22+
),
23+
share_list=[],
24+
share_type=DashboardShareType.OPEN,
25+
selectable_template_vars=[
26+
SelectableTemplateVariableItems(
27+
default_value="*",
28+
name="group_by_var",
29+
type="group",
30+
visible_tags=[
31+
"selectableValue1",
32+
"selectableValue2",
33+
],
34+
),
35+
],
36+
)
37+
38+
configuration = Configuration()
39+
with ApiClient(configuration) as api_client:
40+
api_instance = DashboardsApi(api_client)
41+
response = api_instance.update_public_dashboard(token=SHARED_DASHBOARD_TOKEN, body=body)
42+
43+
print(response)

src/datadog_api_client/v1/model/dashboard_template_variable.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def openapi_types(_):
2323
"defaults": ([str],),
2424
"name": (str,),
2525
"prefix": (str, none_type),
26+
"type": (str, none_type),
2627
}
2728

2829
attribute_map = {
@@ -31,6 +32,7 @@ def openapi_types(_):
3132
"defaults": "defaults",
3233
"name": "name",
3334
"prefix": "prefix",
35+
"type": "type",
3436
}
3537

3638
def __init__(
@@ -40,6 +42,7 @@ def __init__(
4042
default: Union[str, none_type, UnsetType] = unset,
4143
defaults: Union[List[str], UnsetType] = unset,
4244
prefix: Union[str, none_type, UnsetType] = unset,
45+
type: Union[str, none_type, UnsetType] = unset,
4346
**kwargs,
4447
):
4548
"""
@@ -59,6 +62,9 @@ def __init__(
5962
6063
:param prefix: The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
6164
:type prefix: str, none_type, optional
65+
66+
:param type: The type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
67+
:type type: str, none_type, optional
6268
"""
6369
if available_values is not unset:
6470
kwargs["available_values"] = available_values
@@ -68,6 +74,8 @@ def __init__(
6874
kwargs["defaults"] = defaults
6975
if prefix is not unset:
7076
kwargs["prefix"] = prefix
77+
if type is not unset:
78+
kwargs["type"] = type
7179
super().__init__(kwargs)
7280

7381
self_.name = name

src/datadog_api_client/v1/model/selectable_template_variable_items.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ def openapi_types(_):
2121
"default_value": (str,),
2222
"name": (str,),
2323
"prefix": (str,),
24+
"type": (str, none_type),
2425
"visible_tags": ([str], none_type),
2526
}
2627

2728
attribute_map = {
2829
"default_value": "default_value",
2930
"name": "name",
3031
"prefix": "prefix",
32+
"type": "type",
3133
"visible_tags": "visible_tags",
3234
}
3335

@@ -36,6 +38,7 @@ def __init__(
3638
default_value: Union[str, UnsetType] = unset,
3739
name: Union[str, UnsetType] = unset,
3840
prefix: Union[str, UnsetType] = unset,
41+
type: Union[str, none_type, UnsetType] = unset,
3942
visible_tags: Union[List[str], none_type, UnsetType] = unset,
4043
**kwargs,
4144
):
@@ -51,6 +54,9 @@ def __init__(
5154
:param prefix: The tag/attribute key associated with the template variable.
5255
:type prefix: str, optional
5356
57+
:param type: The type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
58+
:type type: str, none_type, optional
59+
5460
:param visible_tags: List of visible tag values on the shared dashboard.
5561
:type visible_tags: [str], none_type, optional
5662
"""
@@ -60,6 +66,8 @@ def __init__(
6066
kwargs["name"] = name
6167
if prefix is not unset:
6268
kwargs["prefix"] = prefix
69+
if type is not unset:
70+
kwargs["type"] = type
6371
if visible_tags is not unset:
6472
kwargs["visible_tags"] = visible_tags
6573
super().__init__(kwargs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-06-30T15:47:16.966Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
interactions:
2+
- request:
3+
body: '{"description":null,"layout_type":"ordered","notify_list":[],"reflow_type":"auto","restricted_roles":[],"template_variables":[{"available_values":["service","datacenter","env"],"defaults":["service","datacenter"],"name":"group_by_var","type":"group"}],"title":"","widgets":[{"definition":{"requests":{"fill":{"q":"avg:system.cpu.user{*}"}},"type":"hostmap"}}]}'
4+
headers:
5+
accept:
6+
- application/json
7+
content-type:
8+
- application/json
9+
method: POST
10+
uri: https://api.datadoghq.com/api/v1/dashboard
11+
response:
12+
body:
13+
string: '{"id":"zb6-rsj-zej","title":"","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI
14+
Account","layout_type":"ordered","url":"/dashboard/zb6-rsj-zej/","template_variables":[{"available_values":["service","datacenter","env"],"defaults":["service","datacenter"],"name":"group_by_var","type":"group"}],"widgets":[{"definition":{"requests":{"fill":{"q":"avg:system.cpu.user{*}"}},"type":"hostmap"},"id":2230877325217406}],"notify_list":[],"created_at":"2025-06-30T15:47:17.444093+00:00","modified_at":"2025-06-30T15:47:17.444093+00:00","reflow_type":"auto","restricted_roles":[]}
15+
16+
'
17+
headers:
18+
content-type:
19+
- application/json
20+
status:
21+
code: 200
22+
message: OK
23+
- request:
24+
body: null
25+
headers:
26+
accept:
27+
- application/json
28+
method: DELETE
29+
uri: https://api.datadoghq.com/api/v1/dashboard/zb6-rsj-zej
30+
response:
31+
body:
32+
string: '{"deleted_dashboard_id":"zb6-rsj-zej"}
33+
34+
'
35+
headers:
36+
content-type:
37+
- application/json
38+
status:
39+
code: 200
40+
message: OK
41+
version: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-06-30T15:47:18.224Z

0 commit comments

Comments
 (0)