Skip to content

Commit 48fcc02

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b1ac6a3 of spec repo
1 parent 072e71e commit 48fcc02

File tree

6 files changed

+118
-3
lines changed

6 files changed

+118
-3
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,13 @@ components:
13901390
description: A role UUID.
13911391
type: string
13921392
type: array
1393+
tabs:
1394+
description: List of tabs for organizing dashboard widgets into groups.
1395+
items:
1396+
$ref: '#/components/schemas/DashboardTab'
1397+
maxItems: 100
1398+
nullable: true
1399+
type: array
13931400
tags:
13941401
description: List of team names representing ownership of a dashboard.
13951402
items:
@@ -1681,6 +1688,38 @@ components:
16811688
description: URL of the dashboard.
16821689
type: string
16831690
type: object
1691+
DashboardTab:
1692+
description: Dashboard tab for organizing widgets.
1693+
properties:
1694+
id:
1695+
description: UUID of the tab.
1696+
example: ''
1697+
format: uuid
1698+
type: string
1699+
name:
1700+
description: Name of the tab.
1701+
example: L
1702+
maxLength: 100
1703+
minLength: 1
1704+
type: string
1705+
widget_ids:
1706+
description: List of widget IDs or positional references belonging to this
1707+
tab. Positional references use the format @N (1-indexed).
1708+
example:
1709+
- 0
1710+
items:
1711+
description: Widget ID (integer) or positional reference (@N string).
1712+
oneOf:
1713+
- format: int64
1714+
type: integer
1715+
- pattern: ^@[0-9]+$
1716+
type: string
1717+
type: array
1718+
required:
1719+
- id
1720+
- name
1721+
- widget_ids
1722+
type: object
16841723
DashboardTemplateVariable:
16851724
description: Template variable.
16861725
properties:

docs/datadog_api_client.v1.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,13 @@ datadog\_api\_client.v1.model.dashboard\_summary\_definition module
613613
:members:
614614
:show-inheritance:
615615

616+
datadog\_api\_client.v1.model.dashboard\_tab module
617+
---------------------------------------------------
618+
619+
.. automodule:: datadog_api_client.v1.model.dashboard_tab
620+
:members:
621+
:show-inheritance:
622+
616623
datadog\_api\_client.v1.model.dashboard\_template\_variable module
617624
------------------------------------------------------------------
618625

src/datadog_api_client/v1/model/dashboard.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@
1818
if TYPE_CHECKING:
1919
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
2020
from datadog_api_client.v1.model.dashboard_reflow_type import DashboardReflowType
21+
from datadog_api_client.v1.model.dashboard_tab import DashboardTab
2122
from datadog_api_client.v1.model.dashboard_template_variable_preset import DashboardTemplateVariablePreset
2223
from datadog_api_client.v1.model.dashboard_template_variable import DashboardTemplateVariable
2324
from datadog_api_client.v1.model.widget import Widget
2425

2526

2627
class Dashboard(ModelNormal):
2728
validations = {
29+
"tabs": {
30+
"max_items": 100,
31+
},
2832
"tags": {
2933
"max_items": 5,
3034
},
@@ -34,6 +38,7 @@ class Dashboard(ModelNormal):
3438
def openapi_types(_):
3539
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
3640
from datadog_api_client.v1.model.dashboard_reflow_type import DashboardReflowType
41+
from datadog_api_client.v1.model.dashboard_tab import DashboardTab
3742
from datadog_api_client.v1.model.dashboard_template_variable_preset import DashboardTemplateVariablePreset
3843
from datadog_api_client.v1.model.dashboard_template_variable import DashboardTemplateVariable
3944
from datadog_api_client.v1.model.widget import Widget
@@ -50,6 +55,7 @@ def openapi_types(_):
5055
"notify_list": ([str], none_type),
5156
"reflow_type": (DashboardReflowType,),
5257
"restricted_roles": ([str],),
58+
"tabs": ([DashboardTab], none_type),
5359
"tags": ([str], none_type),
5460
"template_variable_presets": ([DashboardTemplateVariablePreset], none_type),
5561
"template_variables": ([DashboardTemplateVariable], none_type),
@@ -70,6 +76,7 @@ def openapi_types(_):
7076
"notify_list": "notify_list",
7177
"reflow_type": "reflow_type",
7278
"restricted_roles": "restricted_roles",
79+
"tabs": "tabs",
7380
"tags": "tags",
7481
"template_variable_presets": "template_variable_presets",
7582
"template_variables": "template_variables",
@@ -101,6 +108,7 @@ def __init__(
101108
notify_list: Union[List[str], none_type, UnsetType] = unset,
102109
reflow_type: Union[DashboardReflowType, UnsetType] = unset,
103110
restricted_roles: Union[List[str], UnsetType] = unset,
111+
tabs: Union[List[DashboardTab], none_type, UnsetType] = unset,
104112
tags: Union[List[str], none_type, UnsetType] = unset,
105113
template_variable_presets: Union[List[DashboardTemplateVariablePreset], none_type, UnsetType] = unset,
106114
template_variables: Union[List[DashboardTemplateVariable], none_type, UnsetType] = unset,
@@ -148,6 +156,9 @@ def __init__(
148156
:param restricted_roles: A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
149157
:type restricted_roles: [str], optional
150158
159+
:param tabs: List of tabs for organizing dashboard widgets into groups.
160+
:type tabs: [DashboardTab], none_type, optional
161+
151162
:param tags: List of team names representing ownership of a dashboard.
152163
:type tags: [str], none_type, optional
153164
@@ -186,6 +197,8 @@ def __init__(
186197
kwargs["reflow_type"] = reflow_type
187198
if restricted_roles is not unset:
188199
kwargs["restricted_roles"] = restricted_roles
200+
if tabs is not unset:
201+
kwargs["tabs"] = tabs
189202
if tags is not unset:
190203
kwargs["tags"] = tags
191204
if template_variable_presets is not unset:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
UUID,
12+
)
13+
14+
15+
class DashboardTab(ModelNormal):
16+
validations = {
17+
"name": {
18+
"max_length": 100,
19+
"min_length": 1,
20+
},
21+
}
22+
23+
@cached_property
24+
def openapi_types(_):
25+
return {
26+
"id": (UUID,),
27+
"name": (str,),
28+
"widget_ids": ([int, str],),
29+
}
30+
31+
attribute_map = {
32+
"id": "id",
33+
"name": "name",
34+
"widget_ids": "widget_ids",
35+
}
36+
37+
def __init__(self_, id: UUID, name: str, widget_ids: List[Union[int, str]], **kwargs):
38+
"""
39+
Dashboard tab for organizing widgets.
40+
41+
:param id: UUID of the tab.
42+
:type id: UUID
43+
44+
:param name: Name of the tab.
45+
:type name: str
46+
47+
:param widget_ids: List of widget IDs or positional references belonging to this tab. Positional references use the format @N (1-indexed).
48+
:type widget_ids: [int, str]
49+
"""
50+
super().__init__(kwargs)
51+
52+
self_.id = id
53+
self_.name = name
54+
self_.widget_ids = widget_ids

src/datadog_api_client/v1/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
from datadog_api_client.v1.model.dashboard_share_type import DashboardShareType
8686
from datadog_api_client.v1.model.dashboard_summary import DashboardSummary
8787
from datadog_api_client.v1.model.dashboard_summary_definition import DashboardSummaryDefinition
88+
from datadog_api_client.v1.model.dashboard_tab import DashboardTab
8889
from datadog_api_client.v1.model.dashboard_template_variable import DashboardTemplateVariable
8990
from datadog_api_client.v1.model.dashboard_template_variable_preset import DashboardTemplateVariablePreset
9091
from datadog_api_client.v1.model.dashboard_template_variable_preset_value import DashboardTemplateVariablePresetValue
@@ -1238,6 +1239,7 @@
12381239
"DashboardShareType",
12391240
"DashboardSummary",
12401241
"DashboardSummaryDefinition",
1242+
"DashboardTab",
12411243
"DashboardTemplateVariable",
12421244
"DashboardTemplateVariablePreset",
12431245
"DashboardTemplateVariablePresetValue",

tests/v1/features/dashboards.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Feature: Dashboards
9191
@generated @skip @team:DataDog/dashboards-backend
9292
Scenario: Create a new dashboard returns "Bad Request" response
9393
Given new "CreateDashboard" request
94-
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"}}]}
94+
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "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"}}]}
9595
When the request is sent
9696
Then the response status is 400 Bad Request
9797

@@ -1342,15 +1342,15 @@ Feature: Dashboards
13421342
Scenario: Update a dashboard returns "Bad Request" response
13431343
Given new "UpdateDashboard" request
13441344
And request contains "dashboard_id" parameter from "REPLACE.ME"
1345-
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"}}]}
1345+
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "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"}}]}
13461346
When the request is sent
13471347
Then the response status is 400 Bad Request
13481348

13491349
@generated @skip @team:DataDog/dashboards-backend
13501350
Scenario: Update a dashboard returns "Item Not Found" response
13511351
Given new "UpdateDashboard" request
13521352
And request contains "dashboard_id" parameter from "REPLACE.ME"
1353-
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"}}]}
1353+
And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "tabs": [{"id": "", "name": "L", "widget_ids": [0]}], "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"}}]}
13541354
When the request is sent
13551355
Then the response status is 404 Item Not Found
13561356

0 commit comments

Comments
 (0)