Skip to content

Commit ddac78b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5d589d4 of spec repo
1 parent 0004175 commit ddac78b

18 files changed

+685
-11
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,9 @@ components:
17411741
type: string
17421742
markers:
17431743
description: List of markers.
1744+
example:
1745+
- display_type: percentile
1746+
value: '90'
17441747
items:
17451748
$ref: '#/components/schemas/WidgetMarker'
17461749
type: array
@@ -1816,6 +1819,11 @@ components:
18161819
$ref: '#/components/schemas/ApmStatsQueryDefinition'
18171820
event_query:
18181821
$ref: '#/components/schemas/LogQueryDefinition'
1822+
formulas:
1823+
description: List of formulas that operate on queries.
1824+
items:
1825+
$ref: '#/components/schemas/WidgetFormula'
1826+
type: array
18191827
log_query:
18201828
$ref: '#/components/schemas/LogQueryDefinition'
18211829
network_query:
@@ -1827,10 +1835,17 @@ components:
18271835
q:
18281836
description: Widget query.
18291837
type: string
1838+
queries:
1839+
description: List of queries that can be returned directly or used in formulas.
1840+
items:
1841+
$ref: '#/components/schemas/FormulaAndFunctionQueryDefinition'
1842+
type: array
18301843
query:
18311844
$ref: '#/components/schemas/DistributionWidgetHistogramRequestQuery'
18321845
request_type:
18331846
$ref: '#/components/schemas/DistributionWidgetHistogramRequestType'
1847+
response_format:
1848+
$ref: '#/components/schemas/FormulaAndFunctionResponseFormat'
18341849
rum_query:
18351850
$ref: '#/components/schemas/LogQueryDefinition'
18361851
security_query:
@@ -1854,6 +1869,12 @@ components:
18541869
description: Specifies minimum value to show on the x-axis. It takes a number,
18551870
percentile (p90 === 90th percentile), or auto for default behavior.
18561871
type: string
1872+
num_buckets:
1873+
description: Number of value buckets to target, aka the resolution of the
1874+
value bins.
1875+
example: 100
1876+
format: int64
1877+
type: integer
18571878
scale:
18581879
default: linear
18591880
description: Specifies the scale type. Possible values are `linear`.
@@ -3714,6 +3735,14 @@ components:
37143735
type: array
37153736
legend_size:
37163737
$ref: '#/components/schemas/WidgetLegendSize'
3738+
markers:
3739+
description: List of markers.
3740+
example:
3741+
- display_type: percentile
3742+
value: '90'
3743+
items:
3744+
$ref: '#/components/schemas/WidgetMarker'
3745+
type: array
37173746
requests:
37183747
description: List of widget types.
37193748
example:
@@ -3738,8 +3767,10 @@ components:
37383767
type: string
37393768
type:
37403769
$ref: '#/components/schemas/HeatMapWidgetDefinitionType'
3770+
xaxis:
3771+
$ref: '#/components/schemas/HeatMapWidgetXAxis'
37413772
yaxis:
3742-
$ref: '#/components/schemas/WidgetAxis'
3773+
$ref: '#/components/schemas/HeatMapWidgetDefinitionYaxis'
37433774
required:
37443775
- type
37453776
- requests
@@ -3753,6 +3784,10 @@ components:
37533784
type: string
37543785
x-enum-varnames:
37553786
- HEATMAP
3787+
HeatMapWidgetDefinitionYaxis:
3788+
oneOf:
3789+
- $ref: '#/components/schemas/WidgetAxis'
3790+
- $ref: '#/components/schemas/HeatMapWidgetYAxis'
37563791
HeatMapWidgetRequest:
37573792
description: Updated heat map widget.
37583793
properties:
@@ -3781,6 +3816,10 @@ components:
37813816
items:
37823817
$ref: '#/components/schemas/FormulaAndFunctionQueryDefinition'
37833818
type: array
3819+
query:
3820+
$ref: '#/components/schemas/DistributionWidgetHistogramRequestQuery'
3821+
request_type:
3822+
$ref: '#/components/schemas/DistributionWidgetHistogramRequestType'
37843823
response_format:
37853824
$ref: '#/components/schemas/FormulaAndFunctionResponseFormat'
37863825
rum_query:
@@ -3790,6 +3829,49 @@ components:
37903829
style:
37913830
$ref: '#/components/schemas/WidgetStyle'
37923831
type: object
3832+
HeatMapWidgetXAxis:
3833+
description: X Axis controls for the heat map widget.
3834+
properties:
3835+
num_buckets:
3836+
description: Number of time buckets to target, aka the resolution of the
3837+
time bins. This is only applicable for distribution of points (group distributions
3838+
use the roll-up modifier).
3839+
example: 50
3840+
format: int64
3841+
type: integer
3842+
type: object
3843+
HeatMapWidgetYAxis:
3844+
description: Y Axis controls for the heat map widget.
3845+
properties:
3846+
include_zero:
3847+
description: Set to `true` to include zero.
3848+
type: boolean
3849+
label:
3850+
description: The label of the axis to display on the graph. Only usable
3851+
on Scatterplot Widgets.
3852+
type: string
3853+
max:
3854+
default: auto
3855+
description: Specifies maximum numeric value to show on the axis. Defaults
3856+
to `auto`.
3857+
type: string
3858+
min:
3859+
default: auto
3860+
description: Specifies minimum numeric value to show on the axis. Defaults
3861+
to `auto`.
3862+
type: string
3863+
num_buckets:
3864+
description: Number of value buckets to target, aka the resolution of the
3865+
value bins.
3866+
example: 50
3867+
format: int64
3868+
type: integer
3869+
scale:
3870+
default: linear
3871+
description: Specifies the scale type. Possible values are `linear`, `log`,
3872+
`sqrt`, and `pow##` (for example `pow2` or `pow0.5`).
3873+
type: string
3874+
type: object
37933875
Host:
37943876
description: Object representing a host.
37953877
properties:
@@ -25147,7 +25229,7 @@ components:
2514725229
display_type:
2514825230
description: "Combination of:\n - A severity error, warning, ok, or info\n
2514925231
\ - A line type: dashed, solid, or bold\nIn this case of a Distribution
25150-
widget, this can be set to be `x_axis_percentile`."
25232+
widget, this can be set to be `percentile`."
2515125233
example: error dashed
2515225234
type: string
2515325235
label:
@@ -25158,8 +25240,11 @@ components:
2515825240
description: Timestamp for the widget.
2515925241
type: string
2516025242
value:
25161-
description: Value to apply. Can be a single value y = 15 or a range of
25243+
description: 'Value to apply. Can be a single value y = 15 or a range of
2516225244
values 0 < y < 10.
25245+
25246+
For Distribution widgets with `display_type` set to `percentile`, this
25247+
should be a numeric percentile value (e.g., "90" for P90).'
2516325248
example: y = 15
2516425249
type: string
2516525250
required:

docs/datadog_api_client.v1.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,13 +1131,34 @@ datadog\_api\_client.v1.model.heat\_map\_widget\_definition\_type module
11311131
:members:
11321132
:show-inheritance:
11331133

1134+
datadog\_api\_client.v1.model.heat\_map\_widget\_definition\_yaxis module
1135+
-------------------------------------------------------------------------
1136+
1137+
.. automodule:: datadog_api_client.v1.model.heat_map_widget_definition_yaxis
1138+
:members:
1139+
:show-inheritance:
1140+
11341141
datadog\_api\_client.v1.model.heat\_map\_widget\_request module
11351142
---------------------------------------------------------------
11361143

11371144
.. automodule:: datadog_api_client.v1.model.heat_map_widget_request
11381145
:members:
11391146
:show-inheritance:
11401147

1148+
datadog\_api\_client.v1.model.heat\_map\_widget\_x\_axis module
1149+
---------------------------------------------------------------
1150+
1151+
.. automodule:: datadog_api_client.v1.model.heat_map_widget_x_axis
1152+
:members:
1153+
:show-inheritance:
1154+
1155+
datadog\_api\_client.v1.model.heat\_map\_widget\_y\_axis module
1156+
---------------------------------------------------------------
1157+
1158+
.. automodule:: datadog_api_client.v1.model.heat_map_widget_y_axis
1159+
:members:
1160+
:show-inheritance:
1161+
11411162
datadog\_api\_client.v1.model.host module
11421163
-----------------------------------------
11431164

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
"""
2+
Create a new dashboard with distribution widget with markers and num_buckets
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.distribution_widget_definition import DistributionWidgetDefinition
10+
from datadog_api_client.v1.model.distribution_widget_definition_type import DistributionWidgetDefinitionType
11+
from datadog_api_client.v1.model.distribution_widget_request import DistributionWidgetRequest
12+
from datadog_api_client.v1.model.distribution_widget_x_axis import DistributionWidgetXAxis
13+
from datadog_api_client.v1.model.distribution_widget_y_axis import DistributionWidgetYAxis
14+
from datadog_api_client.v1.model.formula_and_function_metric_aggregation import FormulaAndFunctionMetricAggregation
15+
from datadog_api_client.v1.model.formula_and_function_metric_data_source import FormulaAndFunctionMetricDataSource
16+
from datadog_api_client.v1.model.formula_and_function_metric_query_definition import (
17+
FormulaAndFunctionMetricQueryDefinition,
18+
)
19+
from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat
20+
from datadog_api_client.v1.model.widget import Widget
21+
from datadog_api_client.v1.model.widget_layout import WidgetLayout
22+
from datadog_api_client.v1.model.widget_marker import WidgetMarker
23+
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
24+
25+
body = Dashboard(
26+
title="Example-Dashboard",
27+
widgets=[
28+
Widget(
29+
definition=DistributionWidgetDefinition(
30+
title="",
31+
title_size="16",
32+
title_align=WidgetTextAlign.LEFT,
33+
type=DistributionWidgetDefinitionType.DISTRIBUTION,
34+
xaxis=DistributionWidgetXAxis(
35+
scale="linear",
36+
min="auto",
37+
max="auto",
38+
include_zero=True,
39+
num_buckets=55,
40+
),
41+
yaxis=DistributionWidgetYAxis(
42+
scale="linear",
43+
min="auto",
44+
max="auto",
45+
include_zero=True,
46+
),
47+
markers=[
48+
WidgetMarker(
49+
display_type="percentile",
50+
value="50",
51+
),
52+
WidgetMarker(
53+
display_type="percentile",
54+
value="99",
55+
),
56+
WidgetMarker(
57+
display_type="percentile",
58+
value="90",
59+
),
60+
],
61+
requests=[
62+
DistributionWidgetRequest(
63+
response_format=FormulaAndFunctionResponseFormat.SCALAR,
64+
queries=[
65+
FormulaAndFunctionMetricQueryDefinition(
66+
data_source=FormulaAndFunctionMetricDataSource.METRICS,
67+
name="query1",
68+
query="avg:system.cpu.user{*} by {service}",
69+
aggregator=FormulaAndFunctionMetricAggregation.AVG,
70+
),
71+
],
72+
),
73+
],
74+
),
75+
layout=WidgetLayout(
76+
x=0,
77+
y=0,
78+
width=4,
79+
height=4,
80+
),
81+
),
82+
],
83+
layout_type=DashboardLayoutType.ORDERED,
84+
)
85+
86+
configuration = Configuration()
87+
with ApiClient(configuration) as api_client:
88+
api_instance = DashboardsApi(api_client)
89+
response = api_instance.create_dashboard(body=body)
90+
91+
print(response)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
"""
2+
Create a new dashboard with heatmap widget with markers and num_buckets
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.distribution_widget_histogram_request_type import (
10+
DistributionWidgetHistogramRequestType,
11+
)
12+
from datadog_api_client.v1.model.formula_and_function_metric_data_source import FormulaAndFunctionMetricDataSource
13+
from datadog_api_client.v1.model.formula_and_function_metric_query_definition import (
14+
FormulaAndFunctionMetricQueryDefinition,
15+
)
16+
from datadog_api_client.v1.model.heat_map_widget_definition import HeatMapWidgetDefinition
17+
from datadog_api_client.v1.model.heat_map_widget_definition_type import HeatMapWidgetDefinitionType
18+
from datadog_api_client.v1.model.heat_map_widget_request import HeatMapWidgetRequest
19+
from datadog_api_client.v1.model.heat_map_widget_x_axis import HeatMapWidgetXAxis
20+
from datadog_api_client.v1.model.heat_map_widget_y_axis import HeatMapWidgetYAxis
21+
from datadog_api_client.v1.model.widget import Widget
22+
from datadog_api_client.v1.model.widget_layout import WidgetLayout
23+
from datadog_api_client.v1.model.widget_marker import WidgetMarker
24+
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
25+
26+
body = Dashboard(
27+
title="Example-Dashboard",
28+
widgets=[
29+
Widget(
30+
definition=HeatMapWidgetDefinition(
31+
title="",
32+
title_size="16",
33+
title_align=WidgetTextAlign.LEFT,
34+
type=HeatMapWidgetDefinitionType.HEATMAP,
35+
xaxis=HeatMapWidgetXAxis(
36+
num_buckets=75,
37+
),
38+
yaxis=HeatMapWidgetYAxis(
39+
scale="linear",
40+
min="auto",
41+
max="auto",
42+
include_zero=True,
43+
num_buckets=55,
44+
),
45+
markers=[
46+
WidgetMarker(
47+
display_type="percentile",
48+
value="50",
49+
),
50+
WidgetMarker(
51+
display_type="percentile",
52+
value="99",
53+
),
54+
],
55+
requests=[
56+
HeatMapWidgetRequest(
57+
request_type=DistributionWidgetHistogramRequestType.HISTOGRAM,
58+
query=FormulaAndFunctionMetricQueryDefinition(
59+
data_source=FormulaAndFunctionMetricDataSource.METRICS,
60+
name="query1",
61+
query="histogram:trace.servlet.request{*}",
62+
),
63+
),
64+
],
65+
),
66+
layout=WidgetLayout(
67+
x=0,
68+
y=0,
69+
width=4,
70+
height=4,
71+
),
72+
),
73+
],
74+
layout_type=DashboardLayoutType.ORDERED,
75+
)
76+
77+
configuration = Configuration()
78+
with ApiClient(configuration) as api_client:
79+
api_instance = DashboardsApi(api_client)
80+
response = api_instance.create_dashboard(body=body)
81+
82+
print(response)

0 commit comments

Comments
 (0)