Skip to content

Commit 4c96405

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6b491747 of spec repo
1 parent 5d0d184 commit 4c96405

14 files changed

+421
-4
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.4",
7-
"regenerated": "2023-01-27 19:05:38.484083",
8-
"spec_repo_commit": "e546294e"
7+
"regenerated": "2023-01-31 18:04:55.788187",
8+
"spec_repo_commit": "6b491747"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-01-27 19:05:38.496227",
13-
"spec_repo_commit": "e546294e"
12+
"regenerated": "2023-01-31 18:04:55.801386",
13+
"spec_repo_commit": "6b491747"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8719,6 +8719,65 @@ components:
87198719
page:
87208720
$ref: '#/components/schemas/Pagination'
87218721
type: object
8722+
RunWorkflowWidgetDefinition:
8723+
description: Run workflow is widget that allows you to run a workflow from a
8724+
dashboard.
8725+
properties:
8726+
custom_links:
8727+
description: List of custom links.
8728+
items:
8729+
$ref: '#/components/schemas/WidgetCustomLink'
8730+
type: array
8731+
inputs:
8732+
description: Array of workflow inputs to map to dashboard template variables.
8733+
items:
8734+
$ref: '#/components/schemas/RunWorkflowWidgetInput'
8735+
type: array
8736+
time:
8737+
$ref: '#/components/schemas/WidgetTime'
8738+
title:
8739+
description: Title of your widget.
8740+
type: string
8741+
title_align:
8742+
$ref: '#/components/schemas/WidgetTextAlign'
8743+
title_size:
8744+
description: Size of the title.
8745+
type: string
8746+
type:
8747+
$ref: '#/components/schemas/RunWorkflowWidgetDefinitionType'
8748+
workflow_id:
8749+
description: Workflow id.
8750+
example: <workflow_id>
8751+
type: string
8752+
required:
8753+
- type
8754+
- workflow_id
8755+
type: object
8756+
RunWorkflowWidgetDefinitionType:
8757+
default: run_workflow
8758+
description: Type of the run workflow widget.
8759+
enum:
8760+
- run_workflow
8761+
example: run_workflow
8762+
type: string
8763+
x-enum-varnames:
8764+
- RUN_WORKFLOW
8765+
RunWorkflowWidgetInput:
8766+
description: Object to map a dashboard template variable to a workflow input.
8767+
properties:
8768+
name:
8769+
description: Name of the workflow input.
8770+
example: Environment
8771+
type: string
8772+
value:
8773+
description: Dashboard template variable. Can be suffixed with '.value'
8774+
or '.key'.
8775+
example: $env.value
8776+
type: string
8777+
required:
8778+
- name
8779+
- value
8780+
type: object
87228781
SLOBulkDelete:
87238782
additionalProperties:
87248783
description: An array of all SLO timeframes.
@@ -18272,6 +18331,7 @@ components:
1827218331
- $ref: '#/components/schemas/MonitorSummaryWidgetDefinition'
1827318332
- $ref: '#/components/schemas/NoteWidgetDefinition'
1827418333
- $ref: '#/components/schemas/QueryValueWidgetDefinition'
18334+
- $ref: '#/components/schemas/RunWorkflowWidgetDefinition'
1827518335
- $ref: '#/components/schemas/ScatterPlotWidgetDefinition'
1827618336
- $ref: '#/components/schemas/SLOWidgetDefinition'
1827718337
- $ref: '#/components/schemas/SLOListWidgetDefinition'

docs/datadog_api_client.v1.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,6 +2570,27 @@ response\_meta\_attributes
25702570
:members:
25712571
:show-inheritance:
25722572

2573+
run\_workflow\_widget\_definition
2574+
---------------------------------
2575+
2576+
.. automodule:: datadog_api_client.v1.model.run_workflow_widget_definition
2577+
:members:
2578+
:show-inheritance:
2579+
2580+
run\_workflow\_widget\_definition\_type
2581+
---------------------------------------
2582+
2583+
.. automodule:: datadog_api_client.v1.model.run_workflow_widget_definition_type
2584+
:members:
2585+
:show-inheritance:
2586+
2587+
run\_workflow\_widget\_input
2588+
----------------------------
2589+
2590+
.. automodule:: datadog_api_client.v1.model.run_workflow_widget_input
2591+
:members:
2592+
:show-inheritance:
2593+
25732594
scatter\_plot\_request
25742595
----------------------
25752596

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""
2+
Create a new dashboard with run-workflow widget
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.run_workflow_widget_definition import RunWorkflowWidgetDefinition
10+
from datadog_api_client.v1.model.run_workflow_widget_definition_type import RunWorkflowWidgetDefinitionType
11+
from datadog_api_client.v1.model.run_workflow_widget_input import RunWorkflowWidgetInput
12+
from datadog_api_client.v1.model.widget import Widget
13+
from datadog_api_client.v1.model.widget_layout import WidgetLayout
14+
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
15+
from datadog_api_client.v1.model.widget_time import WidgetTime
16+
17+
body = Dashboard(
18+
title="Example-Create_a_new_dashboard_with_run_workflow_widget",
19+
description="",
20+
widgets=[
21+
Widget(
22+
layout=WidgetLayout(
23+
x=0,
24+
y=0,
25+
width=47,
26+
height=15,
27+
),
28+
definition=RunWorkflowWidgetDefinition(
29+
title="Run workflow title",
30+
title_size="16",
31+
title_align=WidgetTextAlign.LEFT,
32+
time=WidgetTime(),
33+
type=RunWorkflowWidgetDefinitionType.RUN_WORKFLOW,
34+
workflow_id="2e055f16-8b6a-4cdd-b452-17a34c44b160",
35+
inputs=[
36+
RunWorkflowWidgetInput(
37+
name="environment",
38+
value="$env.value",
39+
),
40+
],
41+
),
42+
),
43+
],
44+
template_variables=[],
45+
layout_type=DashboardLayoutType.FREE,
46+
is_read_only=False,
47+
notify_list=[],
48+
)
49+
50+
configuration = Configuration()
51+
with ApiClient(configuration) as api_client:
52+
api_instance = DashboardsApi(api_client)
53+
response = api_instance.create_dashboard(body=body)
54+
55+
print(response)
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink
18+
from datadog_api_client.v1.model.run_workflow_widget_input import RunWorkflowWidgetInput
19+
from datadog_api_client.v1.model.widget_time import WidgetTime
20+
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
21+
from datadog_api_client.v1.model.run_workflow_widget_definition_type import RunWorkflowWidgetDefinitionType
22+
23+
24+
class RunWorkflowWidgetDefinition(ModelNormal):
25+
@cached_property
26+
def openapi_types(_):
27+
from datadog_api_client.v1.model.widget_custom_link import WidgetCustomLink
28+
from datadog_api_client.v1.model.run_workflow_widget_input import RunWorkflowWidgetInput
29+
from datadog_api_client.v1.model.widget_time import WidgetTime
30+
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
31+
from datadog_api_client.v1.model.run_workflow_widget_definition_type import RunWorkflowWidgetDefinitionType
32+
33+
return {
34+
"custom_links": ([WidgetCustomLink],),
35+
"inputs": ([RunWorkflowWidgetInput],),
36+
"time": (WidgetTime,),
37+
"title": (str,),
38+
"title_align": (WidgetTextAlign,),
39+
"title_size": (str,),
40+
"type": (RunWorkflowWidgetDefinitionType,),
41+
"workflow_id": (str,),
42+
}
43+
44+
attribute_map = {
45+
"custom_links": "custom_links",
46+
"inputs": "inputs",
47+
"time": "time",
48+
"title": "title",
49+
"title_align": "title_align",
50+
"title_size": "title_size",
51+
"type": "type",
52+
"workflow_id": "workflow_id",
53+
}
54+
55+
def __init__(
56+
self_,
57+
type: RunWorkflowWidgetDefinitionType,
58+
workflow_id: str,
59+
custom_links: Union[List[WidgetCustomLink], UnsetType] = unset,
60+
inputs: Union[List[RunWorkflowWidgetInput], UnsetType] = unset,
61+
time: Union[WidgetTime, UnsetType] = unset,
62+
title: Union[str, UnsetType] = unset,
63+
title_align: Union[WidgetTextAlign, UnsetType] = unset,
64+
title_size: Union[str, UnsetType] = unset,
65+
**kwargs,
66+
):
67+
"""
68+
Run workflow is widget that allows you to run a workflow from a dashboard.
69+
70+
:param custom_links: List of custom links.
71+
:type custom_links: [WidgetCustomLink], optional
72+
73+
:param inputs: Array of workflow inputs to map to dashboard template variables.
74+
:type inputs: [RunWorkflowWidgetInput], optional
75+
76+
:param time: Time setting for the widget.
77+
:type time: WidgetTime, optional
78+
79+
:param title: Title of your widget.
80+
:type title: str, optional
81+
82+
:param title_align: How to align the text on the widget.
83+
:type title_align: WidgetTextAlign, optional
84+
85+
:param title_size: Size of the title.
86+
:type title_size: str, optional
87+
88+
:param type: Type of the run workflow widget.
89+
:type type: RunWorkflowWidgetDefinitionType
90+
91+
:param workflow_id: Workflow id.
92+
:type workflow_id: str
93+
"""
94+
if custom_links is not unset:
95+
kwargs["custom_links"] = custom_links
96+
if inputs is not unset:
97+
kwargs["inputs"] = inputs
98+
if time is not unset:
99+
kwargs["time"] = time
100+
if title is not unset:
101+
kwargs["title"] = title
102+
if title_align is not unset:
103+
kwargs["title_align"] = title_align
104+
if title_size is not unset:
105+
kwargs["title_size"] = title_size
106+
super().__init__(kwargs)
107+
108+
self_.type = type
109+
self_.workflow_id = workflow_id
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class RunWorkflowWidgetDefinitionType(ModelSimple):
16+
"""
17+
Type of the run workflow widget.
18+
19+
:param value: If omitted defaults to "run_workflow". Must be one of ["run_workflow"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"run_workflow",
25+
}
26+
RUN_WORKFLOW: ClassVar["RunWorkflowWidgetDefinitionType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
RunWorkflowWidgetDefinitionType.RUN_WORKFLOW = RunWorkflowWidgetDefinitionType("run_workflow")
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelNormal,
9+
cached_property,
10+
)
11+
12+
13+
class RunWorkflowWidgetInput(ModelNormal):
14+
@cached_property
15+
def openapi_types(_):
16+
return {
17+
"name": (str,),
18+
"value": (str,),
19+
}
20+
21+
attribute_map = {
22+
"name": "name",
23+
"value": "value",
24+
}
25+
26+
def __init__(self_, name: str, value: str, **kwargs):
27+
"""
28+
Object to map a dashboard template variable to a workflow input.
29+
30+
:param name: Name of the workflow input.
31+
:type name: str
32+
33+
:param value: Dashboard template variable. Can be suffixed with '.value' or '.key'.
34+
:type value: str
35+
"""
36+
super().__init__(kwargs)
37+
38+
self_.name = name
39+
self_.value = value

src/datadog_api_client/v1/model/widget.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from datadog_api_client.v1.model.monitor_summary_widget_definition import MonitorSummaryWidgetDefinition
3535
from datadog_api_client.v1.model.note_widget_definition import NoteWidgetDefinition
3636
from datadog_api_client.v1.model.query_value_widget_definition import QueryValueWidgetDefinition
37+
from datadog_api_client.v1.model.run_workflow_widget_definition import RunWorkflowWidgetDefinition
3738
from datadog_api_client.v1.model.scatter_plot_widget_definition import ScatterPlotWidgetDefinition
3839
from datadog_api_client.v1.model.slo_widget_definition import SLOWidgetDefinition
3940
from datadog_api_client.v1.model.slo_list_widget_definition import SLOListWidgetDefinition
@@ -89,6 +90,7 @@ def __init__(
8990
MonitorSummaryWidgetDefinition,
9091
NoteWidgetDefinition,
9192
QueryValueWidgetDefinition,
93+
RunWorkflowWidgetDefinition,
9294
ScatterPlotWidgetDefinition,
9395
SLOWidgetDefinition,
9496
SLOListWidgetDefinition,

0 commit comments

Comments
 (0)