Skip to content

Commit faa4373

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 9f3c740 of spec repo (#782)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent cf38a28 commit faa4373

11 files changed

+172
-29
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.5.1.dev2",
7-
"regenerated": "2022-01-12 15:42:27.276817",
8-
"spec_repo_commit": "9a4c69f"
7+
"regenerated": "2022-01-12 16:36:57.460339",
8+
"spec_repo_commit": "9f3c740"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2022-01-12 15:42:27.797360",
13-
"spec_repo_commit": "9a4c69f"
12+
"regenerated": "2022-01-12 16:36:57.916544",
13+
"spec_repo_commit": "9f3c740"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12260,9 +12260,6 @@ components:
1226012260
required:
1226112261
- type
1226212262
- requests
12263-
- size_by
12264-
- color_by
12265-
- group_by
1226612263
type: object
1226712264
TreeMapWidgetDefinitionType:
1226812265
default: treemap
@@ -12276,9 +12273,23 @@ components:
1227612273
TreeMapWidgetRequest:
1227712274
description: An updated treemap widget.
1227812275
properties:
12276+
formulas:
12277+
description: List of formulas that operate on queries. **This feature is
12278+
currently in beta.**
12279+
items:
12280+
$ref: '#/components/schemas/WidgetFormula'
12281+
type: array
1227912282
q:
1228012283
description: The widget metrics query.
1228112284
type: string
12285+
queries:
12286+
description: List of queries that can be returned directly or used in formulas.
12287+
**This feature is currently in beta.**
12288+
items:
12289+
$ref: '#/components/schemas/FormulaAndFunctionQueryDefinition'
12290+
type: array
12291+
response_format:
12292+
$ref: '#/components/schemas/FormulaAndFunctionResponseFormat'
1228212293
type: object
1228312294
UsageAnalyzedLogsHour:
1228412295
description: The number of analyzed logs for each hour for a given organization.

docs/v1/TreeMapWidgetDefinition.md

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v1/TreeMapWidgetRequest.md

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
"""
2+
Create a new dashboard with a formulas and functions treemap widget
3+
"""
4+
5+
from datadog_api_client.v1 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.formula_and_function_event_aggregation import FormulaAndFunctionEventAggregation
10+
from datadog_api_client.v1.model.formula_and_function_event_query_definition import (
11+
FormulaAndFunctionEventQueryDefinition,
12+
)
13+
from datadog_api_client.v1.model.formula_and_function_event_query_definition_compute import (
14+
FormulaAndFunctionEventQueryDefinitionCompute,
15+
)
16+
from datadog_api_client.v1.model.formula_and_function_event_query_definition_search import (
17+
FormulaAndFunctionEventQueryDefinitionSearch,
18+
)
19+
from datadog_api_client.v1.model.formula_and_function_events_data_source import FormulaAndFunctionEventsDataSource
20+
from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat
21+
from datadog_api_client.v1.model.tree_map_widget_definition import TreeMapWidgetDefinition
22+
from datadog_api_client.v1.model.tree_map_widget_definition_type import TreeMapWidgetDefinitionType
23+
from datadog_api_client.v1.model.tree_map_widget_request import TreeMapWidgetRequest
24+
from datadog_api_client.v1.model.widget import Widget
25+
from datadog_api_client.v1.model.widget_formula import WidgetFormula
26+
from datadog_api_client.v1.model.widget_layout import WidgetLayout
27+
28+
body = Dashboard(
29+
title="Example-Create_a_new_dashboard_with_a_formulas_and_functions_treemap_widget",
30+
widgets=[
31+
Widget(
32+
definition=TreeMapWidgetDefinition(
33+
title="",
34+
type=TreeMapWidgetDefinitionType("treemap"),
35+
requests=[
36+
TreeMapWidgetRequest(
37+
formulas=[WidgetFormula(formula="hour_before(query1)"), WidgetFormula(formula="query1")],
38+
queries=[
39+
FormulaAndFunctionEventQueryDefinition(
40+
data_source=FormulaAndFunctionEventsDataSource("logs"),
41+
name="query1",
42+
search=FormulaAndFunctionEventQueryDefinitionSearch(query=""),
43+
indexes=["*"],
44+
compute=FormulaAndFunctionEventQueryDefinitionCompute(
45+
aggregation=FormulaAndFunctionEventAggregation("count")
46+
),
47+
group_by=[],
48+
)
49+
],
50+
response_format=FormulaAndFunctionResponseFormat("scalar"),
51+
)
52+
],
53+
),
54+
layout=WidgetLayout(x=0, y=0, width=4, height=4),
55+
)
56+
],
57+
layout_type=DashboardLayoutType("ordered"),
58+
)
59+
60+
configuration = Configuration()
61+
with ApiClient(configuration) as api_client:
62+
api_instance = DashboardsApi(api_client)
63+
response = api_instance.create_dashboard(body=body)
64+
65+
print(response)

src/datadog_api_client/v1/model/tree_map_widget_definition.py

Lines changed: 7 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datadog_api_client/v1/model/tree_map_widget_request.py

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datadog_api_client/v1/model/widget_definition.py

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-01-12T10:11:31.394Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
interactions:
2+
- request:
3+
body: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_a_formulas_and_functions_treemap_widget-1641982291","widgets":[{"definition":{"requests":[{"formulas":[{"formula":"hour_before(query1)"},{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count"},"data_source":"logs","group_by":[],"indexes":["*"],"name":"query1","search":{"query":""}}],"response_format":"scalar"}],"title":"","type":"treemap"},"layout":{"height":4,"width":4,"x":0,"y":0}}]}'
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: '{"notify_list":null,"description":null,"restricted_roles":[],"author_name":null,"template_variables":null,"is_read_only":false,"id":"2ar-acj-hxc","title":"Test-Create_a_new_dashboard_with_a_formulas_and_functions_treemap_widget-1641982291","url":"/dashboard/2ar-acj-hxc/test-createanewdashboardwithaformulasandfunctionstreemapwidget-1641982291","created_at":"2022-01-12T10:11:31.601485+00:00","modified_at":"2022-01-12T10:11:31.601485+00:00","author_handle":"[email protected]","widgets":[{"definition":{"requests":[{"formulas":[{"formula":"hour_before(query1)"},{"formula":"query1"}],"response_format":"scalar","queries":[{"search":{"query":""},"data_source":"logs","compute":{"aggregation":"count"},"name":"query1","indexes":["*"],"group_by":[]}]}],"type":"treemap","title":""},"layout":{"y":0,"width":4,"x":0,"height":4},"id":2836171994664464}],"layout_type":"ordered"}'
14+
headers:
15+
content-type:
16+
- application/json
17+
status:
18+
code: 200
19+
message: OK
20+
- request:
21+
body: null
22+
headers:
23+
accept:
24+
- application/json
25+
method: DELETE
26+
uri: https://api.datadoghq.com/api/v1/dashboard/2ar-acj-hxc
27+
response:
28+
body:
29+
string: '{"deleted_dashboard_id":"2ar-acj-hxc"}'
30+
headers:
31+
content-type:
32+
- application/json
33+
status:
34+
code: 200
35+
message: OK
36+
version: 1

0 commit comments

Comments
 (0)