Skip to content

Commit d4bf1e0

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d62b0cc of spec repo
1 parent 8c89df3 commit d4bf1e0

20 files changed

+853
-3
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 51 additions & 2 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, also known as the resolution
1874+
of the 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`.
@@ -3752,6 +3773,14 @@ components:
37523773
type: array
37533774
legend_size:
37543775
$ref: '#/components/schemas/WidgetLegendSize'
3776+
markers:
3777+
description: List of markers.
3778+
example:
3779+
- display_type: percentile
3780+
value: '90'
3781+
items:
3782+
$ref: '#/components/schemas/WidgetMarker'
3783+
type: array
37553784
requests:
37563785
description: List of widget types.
37573786
example:
@@ -3776,6 +3805,8 @@ components:
37763805
type: string
37773806
type:
37783807
$ref: '#/components/schemas/HeatMapWidgetDefinitionType'
3808+
xaxis:
3809+
$ref: '#/components/schemas/HeatMapWidgetXAxis'
37793810
yaxis:
37803811
$ref: '#/components/schemas/WidgetAxis'
37813812
required:
@@ -3819,6 +3850,10 @@ components:
38193850
items:
38203851
$ref: '#/components/schemas/FormulaAndFunctionQueryDefinition'
38213852
type: array
3853+
query:
3854+
$ref: '#/components/schemas/DistributionWidgetHistogramRequestQuery'
3855+
request_type:
3856+
$ref: '#/components/schemas/DistributionWidgetHistogramRequestType'
38223857
response_format:
38233858
$ref: '#/components/schemas/FormulaAndFunctionResponseFormat'
38243859
rum_query:
@@ -3828,6 +3863,17 @@ components:
38283863
style:
38293864
$ref: '#/components/schemas/WidgetStyle'
38303865
type: object
3866+
HeatMapWidgetXAxis:
3867+
description: X Axis controls for the heat map widget.
3868+
properties:
3869+
num_buckets:
3870+
description: Number of time buckets to target, also known as the resolution
3871+
of the time bins. This is only applicable for distribution of points (group
3872+
distributions use the roll-up modifier).
3873+
example: 50
3874+
format: int64
3875+
type: integer
3876+
type: object
38313877
Host:
38323878
description: Object representing a host.
38333879
properties:
@@ -25245,7 +25291,7 @@ components:
2524525291
display_type:
2524625292
description: "Combination of:\n - A severity error, warning, ok, or info\n
2524725293
\ - A line type: dashed, solid, or bold\nIn this case of a Distribution
25248-
widget, this can be set to be `x_axis_percentile`."
25294+
widget, this can be set to be `percentile`."
2524925295
example: error dashed
2525025296
type: string
2525125297
label:
@@ -25256,8 +25302,11 @@ components:
2525625302
description: Timestamp for the widget.
2525725303
type: string
2525825304
value:
25259-
description: Value to apply. Can be a single value y = 15 or a range of
25305+
description: 'Value to apply. Can be a single value y = 15 or a range of
2526025306
values 0 < y < 10.
25307+
25308+
For Distribution widgets with `display_type` set to `percentile`, this
25309+
should be a numeric percentile value (for example, "90" for P90).'
2526125310
example: y = 15
2526225311
type: string
2526325312
required:

.generator/schemas/v2/openapi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67941,6 +67941,7 @@ paths:
6794167941
- us3.datadoghq.com
6794267942
- us5.datadoghq.com
6794367943
- ap1.datadoghq.com
67944+
- ap2.datadoghq.com
6794467945
- datadoghq.eu
6794567946
- ddog-gov.com
6794667947
subdomain:
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// Create a new dashboard with distribution widget with markers and num_buckets
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI;
4+
use datadog_api_client::datadogV1::model::Dashboard;
5+
use datadog_api_client::datadogV1::model::DashboardLayoutType;
6+
use datadog_api_client::datadogV1::model::DistributionWidgetDefinition;
7+
use datadog_api_client::datadogV1::model::DistributionWidgetDefinitionType;
8+
use datadog_api_client::datadogV1::model::DistributionWidgetRequest;
9+
use datadog_api_client::datadogV1::model::DistributionWidgetXAxis;
10+
use datadog_api_client::datadogV1::model::DistributionWidgetYAxis;
11+
use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricAggregation;
12+
use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricDataSource;
13+
use datadog_api_client::datadogV1::model::FormulaAndFunctionMetricQueryDefinition;
14+
use datadog_api_client::datadogV1::model::FormulaAndFunctionQueryDefinition;
15+
use datadog_api_client::datadogV1::model::FormulaAndFunctionResponseFormat;
16+
use datadog_api_client::datadogV1::model::Widget;
17+
use datadog_api_client::datadogV1::model::WidgetDefinition;
18+
use datadog_api_client::datadogV1::model::WidgetLayout;
19+
use datadog_api_client::datadogV1::model::WidgetMarker;
20+
use datadog_api_client::datadogV1::model::WidgetTextAlign;
21+
22+
#[tokio::main]
23+
async fn main() {
24+
let body =
25+
Dashboard::new(
26+
DashboardLayoutType::ORDERED,
27+
"Example-Dashboard".to_string(),
28+
vec![
29+
Widget::new(
30+
WidgetDefinition::DistributionWidgetDefinition(
31+
Box::new(
32+
DistributionWidgetDefinition::new(
33+
vec![
34+
DistributionWidgetRequest::new()
35+
.queries(
36+
vec![
37+
FormulaAndFunctionQueryDefinition
38+
::FormulaAndFunctionMetricQueryDefinition(
39+
Box::new(
40+
FormulaAndFunctionMetricQueryDefinition::new(
41+
FormulaAndFunctionMetricDataSource::METRICS,
42+
"query1".to_string(),
43+
"avg:system.cpu.user{*} by {service}".to_string(),
44+
).aggregator(FormulaAndFunctionMetricAggregation::AVG),
45+
),
46+
)
47+
],
48+
)
49+
.response_format(FormulaAndFunctionResponseFormat::SCALAR)
50+
],
51+
DistributionWidgetDefinitionType::DISTRIBUTION,
52+
)
53+
.markers(
54+
vec![
55+
WidgetMarker::new("50".to_string()).display_type("percentile".to_string()),
56+
WidgetMarker::new("99".to_string()).display_type("percentile".to_string()),
57+
WidgetMarker::new("90".to_string()).display_type("percentile".to_string())
58+
],
59+
)
60+
.title("".to_string())
61+
.title_align(WidgetTextAlign::LEFT)
62+
.title_size("16".to_string())
63+
.xaxis(
64+
DistributionWidgetXAxis::new()
65+
.include_zero(true)
66+
.max("auto".to_string())
67+
.min("auto".to_string())
68+
.num_buckets(55)
69+
.scale("linear".to_string()),
70+
)
71+
.yaxis(
72+
DistributionWidgetYAxis::new()
73+
.include_zero(true)
74+
.max("auto".to_string())
75+
.min("auto".to_string())
76+
.scale("linear".to_string()),
77+
),
78+
),
79+
),
80+
).layout(WidgetLayout::new(4, 4, 0, 0))
81+
],
82+
);
83+
let configuration = datadog::Configuration::new();
84+
let api = DashboardsAPI::with_config(configuration);
85+
let resp = api.create_dashboard(body).await;
86+
if let Ok(value) = resp {
87+
println!("{:#?}", value);
88+
} else {
89+
println!("{:#?}", resp.unwrap_err());
90+
}
91+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Create a new dashboard with formula and function distribution widget
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI;
4+
use datadog_api_client::datadogV1::model::Dashboard;
5+
use datadog_api_client::datadogV1::model::DashboardLayoutType;
6+
use datadog_api_client::datadogV1::model::DistributionWidgetDefinition;
7+
use datadog_api_client::datadogV1::model::DistributionWidgetDefinitionType;
8+
use datadog_api_client::datadogV1::model::DistributionWidgetRequest;
9+
use datadog_api_client::datadogV1::model::FormulaAndFunctionEventAggregation;
10+
use datadog_api_client::datadogV1::model::FormulaAndFunctionEventQueryDefinition;
11+
use datadog_api_client::datadogV1::model::FormulaAndFunctionEventQueryDefinitionCompute;
12+
use datadog_api_client::datadogV1::model::FormulaAndFunctionEventQueryDefinitionSearch;
13+
use datadog_api_client::datadogV1::model::FormulaAndFunctionEventQueryGroupBy;
14+
use datadog_api_client::datadogV1::model::FormulaAndFunctionEventQueryGroupBySort;
15+
use datadog_api_client::datadogV1::model::FormulaAndFunctionEventsDataSource;
16+
use datadog_api_client::datadogV1::model::FormulaAndFunctionQueryDefinition;
17+
use datadog_api_client::datadogV1::model::FormulaAndFunctionResponseFormat;
18+
use datadog_api_client::datadogV1::model::QuerySortOrder;
19+
use datadog_api_client::datadogV1::model::Widget;
20+
use datadog_api_client::datadogV1::model::WidgetDefinition;
21+
use datadog_api_client::datadogV1::model::WidgetLayout;
22+
use datadog_api_client::datadogV1::model::WidgetLegacyLiveSpan;
23+
use datadog_api_client::datadogV1::model::WidgetTextAlign;
24+
use datadog_api_client::datadogV1::model::WidgetTime;
25+
26+
#[tokio::main]
27+
async fn main() {
28+
let body =
29+
Dashboard::new(
30+
DashboardLayoutType::FREE,
31+
"Example-Dashboard".to_string(),
32+
vec![
33+
Widget::new(
34+
WidgetDefinition::DistributionWidgetDefinition(
35+
Box::new(
36+
DistributionWidgetDefinition::new(
37+
vec![
38+
DistributionWidgetRequest::new()
39+
.queries(
40+
vec![
41+
FormulaAndFunctionQueryDefinition
42+
::FormulaAndFunctionEventQueryDefinition(
43+
Box::new(
44+
FormulaAndFunctionEventQueryDefinition::new(
45+
FormulaAndFunctionEventQueryDefinitionCompute::new(
46+
FormulaAndFunctionEventAggregation::AVG,
47+
).metric("@duration".to_string()),
48+
FormulaAndFunctionEventsDataSource::LOGS,
49+
"query1".to_string(),
50+
)
51+
.group_by(
52+
vec![
53+
FormulaAndFunctionEventQueryGroupBy::new(
54+
"service".to_string(),
55+
)
56+
.limit(1000)
57+
.sort(
58+
FormulaAndFunctionEventQueryGroupBySort
59+
::new(
60+
FormulaAndFunctionEventAggregation
61+
::COUNT,
62+
).order(QuerySortOrder::DESC),
63+
)
64+
],
65+
)
66+
.indexes(vec!["*".to_string()])
67+
.search(
68+
FormulaAndFunctionEventQueryDefinitionSearch::new(
69+
"".to_string(),
70+
),
71+
)
72+
.storage("hot".to_string()),
73+
),
74+
)
75+
],
76+
)
77+
.response_format(FormulaAndFunctionResponseFormat::SCALAR)
78+
],
79+
DistributionWidgetDefinitionType::DISTRIBUTION,
80+
)
81+
.time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
82+
.title("".to_string())
83+
.title_align(WidgetTextAlign::LEFT)
84+
.title_size("16".to_string()),
85+
),
86+
),
87+
).layout(WidgetLayout::new(15, 47, 0, 0))
88+
],
89+
)
90+
.notify_list(Some(vec![]))
91+
.template_variables(Some(vec![]));
92+
let configuration = datadog::Configuration::new();
93+
let api = DashboardsAPI::with_config(configuration);
94+
let resp = api.create_dashboard(body).await;
95+
if let Ok(value) = resp {
96+
println!("{:#?}", value);
97+
} else {
98+
println!("{:#?}", resp.unwrap_err());
99+
}
100+
}

0 commit comments

Comments
 (0)