#[non_exhaustive]pub struct QueryValueWidgetDefinition {Show 13 fields
pub autoscale: Option<bool>,
pub custom_links: Option<Vec<WidgetCustomLink>>,
pub custom_unit: Option<String>,
pub precision: Option<i64>,
pub requests: Vec<QueryValueWidgetRequest>,
pub text_align: Option<WidgetTextAlign>,
pub time: Option<WidgetTime>,
pub timeseries_background: Option<TimeseriesBackground>,
pub title: Option<String>,
pub title_align: Option<WidgetTextAlign>,
pub title_size: Option<String>,
pub type_: QueryValueWidgetDefinitionType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Query values display the current value of a given metric, APM, or log query.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.autoscale: Option<bool>
Whether to use auto-scaling or not.
custom_links: Option<Vec<WidgetCustomLink>>
List of custom links.
custom_unit: Option<String>
Display a unit of your choice on the widget.
precision: Option<i64>
Number of decimals to show. If not defined, the widget uses the raw value.
requests: Vec<QueryValueWidgetRequest>
Widget definition.
text_align: Option<WidgetTextAlign>
How to align the text on the widget.
time: Option<WidgetTime>
Time setting for the widget.
timeseries_background: Option<TimeseriesBackground>
Set a timeseries on the widget background.
title: Option<String>
Title of your widget.
title_align: Option<WidgetTextAlign>
How to align the text on the widget.
title_size: Option<String>
Size of the title.
type_: QueryValueWidgetDefinitionType
Type of the query value widget.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl QueryValueWidgetDefinition
impl QueryValueWidgetDefinition
Sourcepub fn new(
requests: Vec<QueryValueWidgetRequest>,
type_: QueryValueWidgetDefinitionType,
) -> QueryValueWidgetDefinition
pub fn new( requests: Vec<QueryValueWidgetRequest>, type_: QueryValueWidgetDefinitionType, ) -> QueryValueWidgetDefinition
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (lines 31-51)
22async fn main() {
23 let body =
24 Dashboard::new(
25 DashboardLayoutType::FREE,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(
29 WidgetDefinition::QueryValueWidgetDefinition(
30 Box::new(
31 QueryValueWidgetDefinition::new(
32 vec![
33 QueryValueWidgetRequest::new()
34 .queries(
35 vec![
36 FormulaAndFunctionQueryDefinition
37 ::FormulaAndFunctionMetricQueryDefinition(
38 Box::new(
39 FormulaAndFunctionMetricQueryDefinition::new(
40 FormulaAndFunctionMetricDataSource::METRICS,
41 "query1".to_string(),
42 "avg:system.cpu.user{*}".to_string(),
43 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44 ),
45 )
46 ],
47 )
48 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49 ],
50 QueryValueWidgetDefinitionType::QUERY_VALUE,
51 )
52 .autoscale(true)
53 .precision(2)
54 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55 .title("".to_string())
56 .title_align(WidgetTextAlign::LEFT)
57 .title_size("16".to_string()),
58 ),
59 ),
60 ).layout(WidgetLayout::new(15, 47, 0, 0))
61 ],
62 )
63 .description(Some("".to_string()))
64 .notify_list(Some(vec![]))
65 .template_variables(Some(vec![]));
66 let configuration = datadog::Configuration::new();
67 let api = DashboardsAPI::with_config(configuration);
68 let resp = api.create_dashboard(body).await;
69 if let Ok(value) = resp {
70 println!("{:#?}", value);
71 } else {
72 println!("{:#?}", resp.unwrap_err());
73 }
74}
More examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (lines 32-53)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::QueryValueWidgetDefinition(
31 Box::new(
32 QueryValueWidgetDefinition::new(
33 vec![
34 QueryValueWidgetRequest::new()
35 .formulas(vec![WidgetFormula::new("query1".to_string())])
36 .queries(
37 vec![
38 FormulaAndFunctionQueryDefinition
39 ::FormulaAndFunctionMetricQueryDefinition(
40 Box::new(
41 FormulaAndFunctionMetricQueryDefinition::new(
42 FormulaAndFunctionMetricDataSource::METRICS,
43 "query1".to_string(),
44 "p90:dist.dd.dogweb.latency{*}".to_string(),
45 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46 ),
47 )
48 ],
49 )
50 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51 ],
52 QueryValueWidgetDefinitionType::QUERY_VALUE,
53 )
54 .autoscale(true)
55 .precision(2)
56 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57 .title("".to_string())
58 .title_align(WidgetTextAlign::LEFT)
59 .title_size("16".to_string()),
60 ),
61 ),
62 ).layout(WidgetLayout::new(2, 2, 0, 0))
63 ],
64 );
65 let configuration = datadog::Configuration::new();
66 let api = DashboardsAPI::with_config(configuration);
67 let resp = api.create_dashboard(body).await;
68 if let Ok(value) = resp {
69 println!("{:#?}", value);
70 } else {
71 println!("{:#?}", resp.unwrap_err());
72 }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (lines 35-56)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::ORDERED,
30 "Example-Dashboard with QVW Timeseries Background".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::QueryValueWidgetDefinition(
34 Box::new(
35 QueryValueWidgetDefinition::new(
36 vec![
37 QueryValueWidgetRequest::new()
38 .formulas(vec![WidgetFormula::new("query1".to_string())])
39 .queries(
40 vec![
41 FormulaAndFunctionQueryDefinition
42 ::FormulaAndFunctionMetricQueryDefinition(
43 Box::new(
44 FormulaAndFunctionMetricQueryDefinition::new(
45 FormulaAndFunctionMetricDataSource::METRICS,
46 "query1".to_string(),
47 "sum:my.cool.count.metric{*}".to_string(),
48 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49 ),
50 )
51 ],
52 )
53 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54 ],
55 QueryValueWidgetDefinitionType::QUERY_VALUE,
56 )
57 .autoscale(true)
58 .precision(2)
59 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60 .timeseries_background(
61 TimeseriesBackground::new(
62 TimeseriesBackgroundType::AREA,
63 ).yaxis(WidgetAxis::new().include_zero(true)),
64 )
65 .title("".to_string())
66 .title_align(WidgetTextAlign::LEFT)
67 .title_size("16".to_string()),
68 ),
69 ),
70 ).layout(WidgetLayout::new(2, 2, 0, 0))
71 ],
72 );
73 let configuration = datadog::Configuration::new();
74 let api = DashboardsAPI::with_config(configuration);
75 let resp = api.create_dashboard(body).await;
76 if let Ok(value) = resp {
77 println!("{:#?}", value);
78 } else {
79 println!("{:#?}", resp.unwrap_err());
80 }
81}
Sourcepub fn autoscale(self, value: bool) -> Self
pub fn autoscale(self, value: bool) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (line 52)
22async fn main() {
23 let body =
24 Dashboard::new(
25 DashboardLayoutType::FREE,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(
29 WidgetDefinition::QueryValueWidgetDefinition(
30 Box::new(
31 QueryValueWidgetDefinition::new(
32 vec![
33 QueryValueWidgetRequest::new()
34 .queries(
35 vec![
36 FormulaAndFunctionQueryDefinition
37 ::FormulaAndFunctionMetricQueryDefinition(
38 Box::new(
39 FormulaAndFunctionMetricQueryDefinition::new(
40 FormulaAndFunctionMetricDataSource::METRICS,
41 "query1".to_string(),
42 "avg:system.cpu.user{*}".to_string(),
43 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44 ),
45 )
46 ],
47 )
48 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49 ],
50 QueryValueWidgetDefinitionType::QUERY_VALUE,
51 )
52 .autoscale(true)
53 .precision(2)
54 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55 .title("".to_string())
56 .title_align(WidgetTextAlign::LEFT)
57 .title_size("16".to_string()),
58 ),
59 ),
60 ).layout(WidgetLayout::new(15, 47, 0, 0))
61 ],
62 )
63 .description(Some("".to_string()))
64 .notify_list(Some(vec![]))
65 .template_variables(Some(vec![]));
66 let configuration = datadog::Configuration::new();
67 let api = DashboardsAPI::with_config(configuration);
68 let resp = api.create_dashboard(body).await;
69 if let Ok(value) = resp {
70 println!("{:#?}", value);
71 } else {
72 println!("{:#?}", resp.unwrap_err());
73 }
74}
More examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 54)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::QueryValueWidgetDefinition(
31 Box::new(
32 QueryValueWidgetDefinition::new(
33 vec![
34 QueryValueWidgetRequest::new()
35 .formulas(vec![WidgetFormula::new("query1".to_string())])
36 .queries(
37 vec![
38 FormulaAndFunctionQueryDefinition
39 ::FormulaAndFunctionMetricQueryDefinition(
40 Box::new(
41 FormulaAndFunctionMetricQueryDefinition::new(
42 FormulaAndFunctionMetricDataSource::METRICS,
43 "query1".to_string(),
44 "p90:dist.dd.dogweb.latency{*}".to_string(),
45 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46 ),
47 )
48 ],
49 )
50 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51 ],
52 QueryValueWidgetDefinitionType::QUERY_VALUE,
53 )
54 .autoscale(true)
55 .precision(2)
56 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57 .title("".to_string())
58 .title_align(WidgetTextAlign::LEFT)
59 .title_size("16".to_string()),
60 ),
61 ),
62 ).layout(WidgetLayout::new(2, 2, 0, 0))
63 ],
64 );
65 let configuration = datadog::Configuration::new();
66 let api = DashboardsAPI::with_config(configuration);
67 let resp = api.create_dashboard(body).await;
68 if let Ok(value) = resp {
69 println!("{:#?}", value);
70 } else {
71 println!("{:#?}", resp.unwrap_err());
72 }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (line 57)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::ORDERED,
30 "Example-Dashboard with QVW Timeseries Background".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::QueryValueWidgetDefinition(
34 Box::new(
35 QueryValueWidgetDefinition::new(
36 vec![
37 QueryValueWidgetRequest::new()
38 .formulas(vec![WidgetFormula::new("query1".to_string())])
39 .queries(
40 vec![
41 FormulaAndFunctionQueryDefinition
42 ::FormulaAndFunctionMetricQueryDefinition(
43 Box::new(
44 FormulaAndFunctionMetricQueryDefinition::new(
45 FormulaAndFunctionMetricDataSource::METRICS,
46 "query1".to_string(),
47 "sum:my.cool.count.metric{*}".to_string(),
48 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49 ),
50 )
51 ],
52 )
53 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54 ],
55 QueryValueWidgetDefinitionType::QUERY_VALUE,
56 )
57 .autoscale(true)
58 .precision(2)
59 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60 .timeseries_background(
61 TimeseriesBackground::new(
62 TimeseriesBackgroundType::AREA,
63 ).yaxis(WidgetAxis::new().include_zero(true)),
64 )
65 .title("".to_string())
66 .title_align(WidgetTextAlign::LEFT)
67 .title_size("16".to_string()),
68 ),
69 ),
70 ).layout(WidgetLayout::new(2, 2, 0, 0))
71 ],
72 );
73 let configuration = datadog::Configuration::new();
74 let api = DashboardsAPI::with_config(configuration);
75 let resp = api.create_dashboard(body).await;
76 if let Ok(value) = resp {
77 println!("{:#?}", value);
78 } else {
79 println!("{:#?}", resp.unwrap_err());
80 }
81}
pub fn custom_links(self, value: Vec<WidgetCustomLink>) -> Self
pub fn custom_unit(self, value: String) -> Self
Sourcepub fn precision(self, value: i64) -> Self
pub fn precision(self, value: i64) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (line 53)
22async fn main() {
23 let body =
24 Dashboard::new(
25 DashboardLayoutType::FREE,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(
29 WidgetDefinition::QueryValueWidgetDefinition(
30 Box::new(
31 QueryValueWidgetDefinition::new(
32 vec![
33 QueryValueWidgetRequest::new()
34 .queries(
35 vec![
36 FormulaAndFunctionQueryDefinition
37 ::FormulaAndFunctionMetricQueryDefinition(
38 Box::new(
39 FormulaAndFunctionMetricQueryDefinition::new(
40 FormulaAndFunctionMetricDataSource::METRICS,
41 "query1".to_string(),
42 "avg:system.cpu.user{*}".to_string(),
43 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44 ),
45 )
46 ],
47 )
48 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49 ],
50 QueryValueWidgetDefinitionType::QUERY_VALUE,
51 )
52 .autoscale(true)
53 .precision(2)
54 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55 .title("".to_string())
56 .title_align(WidgetTextAlign::LEFT)
57 .title_size("16".to_string()),
58 ),
59 ),
60 ).layout(WidgetLayout::new(15, 47, 0, 0))
61 ],
62 )
63 .description(Some("".to_string()))
64 .notify_list(Some(vec![]))
65 .template_variables(Some(vec![]));
66 let configuration = datadog::Configuration::new();
67 let api = DashboardsAPI::with_config(configuration);
68 let resp = api.create_dashboard(body).await;
69 if let Ok(value) = resp {
70 println!("{:#?}", value);
71 } else {
72 println!("{:#?}", resp.unwrap_err());
73 }
74}
More examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 55)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::QueryValueWidgetDefinition(
31 Box::new(
32 QueryValueWidgetDefinition::new(
33 vec![
34 QueryValueWidgetRequest::new()
35 .formulas(vec![WidgetFormula::new("query1".to_string())])
36 .queries(
37 vec![
38 FormulaAndFunctionQueryDefinition
39 ::FormulaAndFunctionMetricQueryDefinition(
40 Box::new(
41 FormulaAndFunctionMetricQueryDefinition::new(
42 FormulaAndFunctionMetricDataSource::METRICS,
43 "query1".to_string(),
44 "p90:dist.dd.dogweb.latency{*}".to_string(),
45 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46 ),
47 )
48 ],
49 )
50 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51 ],
52 QueryValueWidgetDefinitionType::QUERY_VALUE,
53 )
54 .autoscale(true)
55 .precision(2)
56 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57 .title("".to_string())
58 .title_align(WidgetTextAlign::LEFT)
59 .title_size("16".to_string()),
60 ),
61 ),
62 ).layout(WidgetLayout::new(2, 2, 0, 0))
63 ],
64 );
65 let configuration = datadog::Configuration::new();
66 let api = DashboardsAPI::with_config(configuration);
67 let resp = api.create_dashboard(body).await;
68 if let Ok(value) = resp {
69 println!("{:#?}", value);
70 } else {
71 println!("{:#?}", resp.unwrap_err());
72 }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (line 58)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::ORDERED,
30 "Example-Dashboard with QVW Timeseries Background".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::QueryValueWidgetDefinition(
34 Box::new(
35 QueryValueWidgetDefinition::new(
36 vec![
37 QueryValueWidgetRequest::new()
38 .formulas(vec![WidgetFormula::new("query1".to_string())])
39 .queries(
40 vec![
41 FormulaAndFunctionQueryDefinition
42 ::FormulaAndFunctionMetricQueryDefinition(
43 Box::new(
44 FormulaAndFunctionMetricQueryDefinition::new(
45 FormulaAndFunctionMetricDataSource::METRICS,
46 "query1".to_string(),
47 "sum:my.cool.count.metric{*}".to_string(),
48 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49 ),
50 )
51 ],
52 )
53 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54 ],
55 QueryValueWidgetDefinitionType::QUERY_VALUE,
56 )
57 .autoscale(true)
58 .precision(2)
59 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60 .timeseries_background(
61 TimeseriesBackground::new(
62 TimeseriesBackgroundType::AREA,
63 ).yaxis(WidgetAxis::new().include_zero(true)),
64 )
65 .title("".to_string())
66 .title_align(WidgetTextAlign::LEFT)
67 .title_size("16".to_string()),
68 ),
69 ),
70 ).layout(WidgetLayout::new(2, 2, 0, 0))
71 ],
72 );
73 let configuration = datadog::Configuration::new();
74 let api = DashboardsAPI::with_config(configuration);
75 let resp = api.create_dashboard(body).await;
76 if let Ok(value) = resp {
77 println!("{:#?}", value);
78 } else {
79 println!("{:#?}", resp.unwrap_err());
80 }
81}
pub fn text_align(self, value: WidgetTextAlign) -> Self
Sourcepub fn time(self, value: WidgetTime) -> Self
pub fn time(self, value: WidgetTime) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (line 54)
22async fn main() {
23 let body =
24 Dashboard::new(
25 DashboardLayoutType::FREE,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(
29 WidgetDefinition::QueryValueWidgetDefinition(
30 Box::new(
31 QueryValueWidgetDefinition::new(
32 vec![
33 QueryValueWidgetRequest::new()
34 .queries(
35 vec![
36 FormulaAndFunctionQueryDefinition
37 ::FormulaAndFunctionMetricQueryDefinition(
38 Box::new(
39 FormulaAndFunctionMetricQueryDefinition::new(
40 FormulaAndFunctionMetricDataSource::METRICS,
41 "query1".to_string(),
42 "avg:system.cpu.user{*}".to_string(),
43 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44 ),
45 )
46 ],
47 )
48 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49 ],
50 QueryValueWidgetDefinitionType::QUERY_VALUE,
51 )
52 .autoscale(true)
53 .precision(2)
54 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55 .title("".to_string())
56 .title_align(WidgetTextAlign::LEFT)
57 .title_size("16".to_string()),
58 ),
59 ),
60 ).layout(WidgetLayout::new(15, 47, 0, 0))
61 ],
62 )
63 .description(Some("".to_string()))
64 .notify_list(Some(vec![]))
65 .template_variables(Some(vec![]));
66 let configuration = datadog::Configuration::new();
67 let api = DashboardsAPI::with_config(configuration);
68 let resp = api.create_dashboard(body).await;
69 if let Ok(value) = resp {
70 println!("{:#?}", value);
71 } else {
72 println!("{:#?}", resp.unwrap_err());
73 }
74}
More examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 56)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::QueryValueWidgetDefinition(
31 Box::new(
32 QueryValueWidgetDefinition::new(
33 vec![
34 QueryValueWidgetRequest::new()
35 .formulas(vec![WidgetFormula::new("query1".to_string())])
36 .queries(
37 vec![
38 FormulaAndFunctionQueryDefinition
39 ::FormulaAndFunctionMetricQueryDefinition(
40 Box::new(
41 FormulaAndFunctionMetricQueryDefinition::new(
42 FormulaAndFunctionMetricDataSource::METRICS,
43 "query1".to_string(),
44 "p90:dist.dd.dogweb.latency{*}".to_string(),
45 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46 ),
47 )
48 ],
49 )
50 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51 ],
52 QueryValueWidgetDefinitionType::QUERY_VALUE,
53 )
54 .autoscale(true)
55 .precision(2)
56 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57 .title("".to_string())
58 .title_align(WidgetTextAlign::LEFT)
59 .title_size("16".to_string()),
60 ),
61 ),
62 ).layout(WidgetLayout::new(2, 2, 0, 0))
63 ],
64 );
65 let configuration = datadog::Configuration::new();
66 let api = DashboardsAPI::with_config(configuration);
67 let resp = api.create_dashboard(body).await;
68 if let Ok(value) = resp {
69 println!("{:#?}", value);
70 } else {
71 println!("{:#?}", resp.unwrap_err());
72 }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (line 59)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::ORDERED,
30 "Example-Dashboard with QVW Timeseries Background".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::QueryValueWidgetDefinition(
34 Box::new(
35 QueryValueWidgetDefinition::new(
36 vec![
37 QueryValueWidgetRequest::new()
38 .formulas(vec![WidgetFormula::new("query1".to_string())])
39 .queries(
40 vec![
41 FormulaAndFunctionQueryDefinition
42 ::FormulaAndFunctionMetricQueryDefinition(
43 Box::new(
44 FormulaAndFunctionMetricQueryDefinition::new(
45 FormulaAndFunctionMetricDataSource::METRICS,
46 "query1".to_string(),
47 "sum:my.cool.count.metric{*}".to_string(),
48 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49 ),
50 )
51 ],
52 )
53 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54 ],
55 QueryValueWidgetDefinitionType::QUERY_VALUE,
56 )
57 .autoscale(true)
58 .precision(2)
59 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60 .timeseries_background(
61 TimeseriesBackground::new(
62 TimeseriesBackgroundType::AREA,
63 ).yaxis(WidgetAxis::new().include_zero(true)),
64 )
65 .title("".to_string())
66 .title_align(WidgetTextAlign::LEFT)
67 .title_size("16".to_string()),
68 ),
69 ),
70 ).layout(WidgetLayout::new(2, 2, 0, 0))
71 ],
72 );
73 let configuration = datadog::Configuration::new();
74 let api = DashboardsAPI::with_config(configuration);
75 let resp = api.create_dashboard(body).await;
76 if let Ok(value) = resp {
77 println!("{:#?}", value);
78 } else {
79 println!("{:#?}", resp.unwrap_err());
80 }
81}
Sourcepub fn timeseries_background(self, value: TimeseriesBackground) -> Self
pub fn timeseries_background(self, value: TimeseriesBackground) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_765140092.rs (lines 60-64)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::ORDERED,
30 "Example-Dashboard with QVW Timeseries Background".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::QueryValueWidgetDefinition(
34 Box::new(
35 QueryValueWidgetDefinition::new(
36 vec![
37 QueryValueWidgetRequest::new()
38 .formulas(vec![WidgetFormula::new("query1".to_string())])
39 .queries(
40 vec![
41 FormulaAndFunctionQueryDefinition
42 ::FormulaAndFunctionMetricQueryDefinition(
43 Box::new(
44 FormulaAndFunctionMetricQueryDefinition::new(
45 FormulaAndFunctionMetricDataSource::METRICS,
46 "query1".to_string(),
47 "sum:my.cool.count.metric{*}".to_string(),
48 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49 ),
50 )
51 ],
52 )
53 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54 ],
55 QueryValueWidgetDefinitionType::QUERY_VALUE,
56 )
57 .autoscale(true)
58 .precision(2)
59 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60 .timeseries_background(
61 TimeseriesBackground::new(
62 TimeseriesBackgroundType::AREA,
63 ).yaxis(WidgetAxis::new().include_zero(true)),
64 )
65 .title("".to_string())
66 .title_align(WidgetTextAlign::LEFT)
67 .title_size("16".to_string()),
68 ),
69 ),
70 ).layout(WidgetLayout::new(2, 2, 0, 0))
71 ],
72 );
73 let configuration = datadog::Configuration::new();
74 let api = DashboardsAPI::with_config(configuration);
75 let resp = api.create_dashboard(body).await;
76 if let Ok(value) = resp {
77 println!("{:#?}", value);
78 } else {
79 println!("{:#?}", resp.unwrap_err());
80 }
81}
Sourcepub fn title(self, value: String) -> Self
pub fn title(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (line 55)
22async fn main() {
23 let body =
24 Dashboard::new(
25 DashboardLayoutType::FREE,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(
29 WidgetDefinition::QueryValueWidgetDefinition(
30 Box::new(
31 QueryValueWidgetDefinition::new(
32 vec![
33 QueryValueWidgetRequest::new()
34 .queries(
35 vec![
36 FormulaAndFunctionQueryDefinition
37 ::FormulaAndFunctionMetricQueryDefinition(
38 Box::new(
39 FormulaAndFunctionMetricQueryDefinition::new(
40 FormulaAndFunctionMetricDataSource::METRICS,
41 "query1".to_string(),
42 "avg:system.cpu.user{*}".to_string(),
43 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44 ),
45 )
46 ],
47 )
48 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49 ],
50 QueryValueWidgetDefinitionType::QUERY_VALUE,
51 )
52 .autoscale(true)
53 .precision(2)
54 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55 .title("".to_string())
56 .title_align(WidgetTextAlign::LEFT)
57 .title_size("16".to_string()),
58 ),
59 ),
60 ).layout(WidgetLayout::new(15, 47, 0, 0))
61 ],
62 )
63 .description(Some("".to_string()))
64 .notify_list(Some(vec![]))
65 .template_variables(Some(vec![]));
66 let configuration = datadog::Configuration::new();
67 let api = DashboardsAPI::with_config(configuration);
68 let resp = api.create_dashboard(body).await;
69 if let Ok(value) = resp {
70 println!("{:#?}", value);
71 } else {
72 println!("{:#?}", resp.unwrap_err());
73 }
74}
More examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 57)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::QueryValueWidgetDefinition(
31 Box::new(
32 QueryValueWidgetDefinition::new(
33 vec![
34 QueryValueWidgetRequest::new()
35 .formulas(vec![WidgetFormula::new("query1".to_string())])
36 .queries(
37 vec![
38 FormulaAndFunctionQueryDefinition
39 ::FormulaAndFunctionMetricQueryDefinition(
40 Box::new(
41 FormulaAndFunctionMetricQueryDefinition::new(
42 FormulaAndFunctionMetricDataSource::METRICS,
43 "query1".to_string(),
44 "p90:dist.dd.dogweb.latency{*}".to_string(),
45 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46 ),
47 )
48 ],
49 )
50 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51 ],
52 QueryValueWidgetDefinitionType::QUERY_VALUE,
53 )
54 .autoscale(true)
55 .precision(2)
56 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57 .title("".to_string())
58 .title_align(WidgetTextAlign::LEFT)
59 .title_size("16".to_string()),
60 ),
61 ),
62 ).layout(WidgetLayout::new(2, 2, 0, 0))
63 ],
64 );
65 let configuration = datadog::Configuration::new();
66 let api = DashboardsAPI::with_config(configuration);
67 let resp = api.create_dashboard(body).await;
68 if let Ok(value) = resp {
69 println!("{:#?}", value);
70 } else {
71 println!("{:#?}", resp.unwrap_err());
72 }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (line 65)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::ORDERED,
30 "Example-Dashboard with QVW Timeseries Background".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::QueryValueWidgetDefinition(
34 Box::new(
35 QueryValueWidgetDefinition::new(
36 vec![
37 QueryValueWidgetRequest::new()
38 .formulas(vec![WidgetFormula::new("query1".to_string())])
39 .queries(
40 vec![
41 FormulaAndFunctionQueryDefinition
42 ::FormulaAndFunctionMetricQueryDefinition(
43 Box::new(
44 FormulaAndFunctionMetricQueryDefinition::new(
45 FormulaAndFunctionMetricDataSource::METRICS,
46 "query1".to_string(),
47 "sum:my.cool.count.metric{*}".to_string(),
48 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49 ),
50 )
51 ],
52 )
53 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54 ],
55 QueryValueWidgetDefinitionType::QUERY_VALUE,
56 )
57 .autoscale(true)
58 .precision(2)
59 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60 .timeseries_background(
61 TimeseriesBackground::new(
62 TimeseriesBackgroundType::AREA,
63 ).yaxis(WidgetAxis::new().include_zero(true)),
64 )
65 .title("".to_string())
66 .title_align(WidgetTextAlign::LEFT)
67 .title_size("16".to_string()),
68 ),
69 ),
70 ).layout(WidgetLayout::new(2, 2, 0, 0))
71 ],
72 );
73 let configuration = datadog::Configuration::new();
74 let api = DashboardsAPI::with_config(configuration);
75 let resp = api.create_dashboard(body).await;
76 if let Ok(value) = resp {
77 println!("{:#?}", value);
78 } else {
79 println!("{:#?}", resp.unwrap_err());
80 }
81}
Sourcepub fn title_align(self, value: WidgetTextAlign) -> Self
pub fn title_align(self, value: WidgetTextAlign) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (line 56)
22async fn main() {
23 let body =
24 Dashboard::new(
25 DashboardLayoutType::FREE,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(
29 WidgetDefinition::QueryValueWidgetDefinition(
30 Box::new(
31 QueryValueWidgetDefinition::new(
32 vec![
33 QueryValueWidgetRequest::new()
34 .queries(
35 vec![
36 FormulaAndFunctionQueryDefinition
37 ::FormulaAndFunctionMetricQueryDefinition(
38 Box::new(
39 FormulaAndFunctionMetricQueryDefinition::new(
40 FormulaAndFunctionMetricDataSource::METRICS,
41 "query1".to_string(),
42 "avg:system.cpu.user{*}".to_string(),
43 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44 ),
45 )
46 ],
47 )
48 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49 ],
50 QueryValueWidgetDefinitionType::QUERY_VALUE,
51 )
52 .autoscale(true)
53 .precision(2)
54 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55 .title("".to_string())
56 .title_align(WidgetTextAlign::LEFT)
57 .title_size("16".to_string()),
58 ),
59 ),
60 ).layout(WidgetLayout::new(15, 47, 0, 0))
61 ],
62 )
63 .description(Some("".to_string()))
64 .notify_list(Some(vec![]))
65 .template_variables(Some(vec![]));
66 let configuration = datadog::Configuration::new();
67 let api = DashboardsAPI::with_config(configuration);
68 let resp = api.create_dashboard(body).await;
69 if let Ok(value) = resp {
70 println!("{:#?}", value);
71 } else {
72 println!("{:#?}", resp.unwrap_err());
73 }
74}
More examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 58)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::QueryValueWidgetDefinition(
31 Box::new(
32 QueryValueWidgetDefinition::new(
33 vec![
34 QueryValueWidgetRequest::new()
35 .formulas(vec![WidgetFormula::new("query1".to_string())])
36 .queries(
37 vec![
38 FormulaAndFunctionQueryDefinition
39 ::FormulaAndFunctionMetricQueryDefinition(
40 Box::new(
41 FormulaAndFunctionMetricQueryDefinition::new(
42 FormulaAndFunctionMetricDataSource::METRICS,
43 "query1".to_string(),
44 "p90:dist.dd.dogweb.latency{*}".to_string(),
45 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46 ),
47 )
48 ],
49 )
50 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51 ],
52 QueryValueWidgetDefinitionType::QUERY_VALUE,
53 )
54 .autoscale(true)
55 .precision(2)
56 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57 .title("".to_string())
58 .title_align(WidgetTextAlign::LEFT)
59 .title_size("16".to_string()),
60 ),
61 ),
62 ).layout(WidgetLayout::new(2, 2, 0, 0))
63 ],
64 );
65 let configuration = datadog::Configuration::new();
66 let api = DashboardsAPI::with_config(configuration);
67 let resp = api.create_dashboard(body).await;
68 if let Ok(value) = resp {
69 println!("{:#?}", value);
70 } else {
71 println!("{:#?}", resp.unwrap_err());
72 }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (line 66)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::ORDERED,
30 "Example-Dashboard with QVW Timeseries Background".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::QueryValueWidgetDefinition(
34 Box::new(
35 QueryValueWidgetDefinition::new(
36 vec![
37 QueryValueWidgetRequest::new()
38 .formulas(vec![WidgetFormula::new("query1".to_string())])
39 .queries(
40 vec![
41 FormulaAndFunctionQueryDefinition
42 ::FormulaAndFunctionMetricQueryDefinition(
43 Box::new(
44 FormulaAndFunctionMetricQueryDefinition::new(
45 FormulaAndFunctionMetricDataSource::METRICS,
46 "query1".to_string(),
47 "sum:my.cool.count.metric{*}".to_string(),
48 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49 ),
50 )
51 ],
52 )
53 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54 ],
55 QueryValueWidgetDefinitionType::QUERY_VALUE,
56 )
57 .autoscale(true)
58 .precision(2)
59 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60 .timeseries_background(
61 TimeseriesBackground::new(
62 TimeseriesBackgroundType::AREA,
63 ).yaxis(WidgetAxis::new().include_zero(true)),
64 )
65 .title("".to_string())
66 .title_align(WidgetTextAlign::LEFT)
67 .title_size("16".to_string()),
68 ),
69 ),
70 ).layout(WidgetLayout::new(2, 2, 0, 0))
71 ],
72 );
73 let configuration = datadog::Configuration::new();
74 let api = DashboardsAPI::with_config(configuration);
75 let resp = api.create_dashboard(body).await;
76 if let Ok(value) = resp {
77 println!("{:#?}", value);
78 } else {
79 println!("{:#?}", resp.unwrap_err());
80 }
81}
Sourcepub fn title_size(self, value: String) -> Self
pub fn title_size(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (line 57)
22async fn main() {
23 let body =
24 Dashboard::new(
25 DashboardLayoutType::FREE,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(
29 WidgetDefinition::QueryValueWidgetDefinition(
30 Box::new(
31 QueryValueWidgetDefinition::new(
32 vec![
33 QueryValueWidgetRequest::new()
34 .queries(
35 vec![
36 FormulaAndFunctionQueryDefinition
37 ::FormulaAndFunctionMetricQueryDefinition(
38 Box::new(
39 FormulaAndFunctionMetricQueryDefinition::new(
40 FormulaAndFunctionMetricDataSource::METRICS,
41 "query1".to_string(),
42 "avg:system.cpu.user{*}".to_string(),
43 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44 ),
45 )
46 ],
47 )
48 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49 ],
50 QueryValueWidgetDefinitionType::QUERY_VALUE,
51 )
52 .autoscale(true)
53 .precision(2)
54 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55 .title("".to_string())
56 .title_align(WidgetTextAlign::LEFT)
57 .title_size("16".to_string()),
58 ),
59 ),
60 ).layout(WidgetLayout::new(15, 47, 0, 0))
61 ],
62 )
63 .description(Some("".to_string()))
64 .notify_list(Some(vec![]))
65 .template_variables(Some(vec![]));
66 let configuration = datadog::Configuration::new();
67 let api = DashboardsAPI::with_config(configuration);
68 let resp = api.create_dashboard(body).await;
69 if let Ok(value) = resp {
70 println!("{:#?}", value);
71 } else {
72 println!("{:#?}", resp.unwrap_err());
73 }
74}
More examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 59)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::QueryValueWidgetDefinition(
31 Box::new(
32 QueryValueWidgetDefinition::new(
33 vec![
34 QueryValueWidgetRequest::new()
35 .formulas(vec![WidgetFormula::new("query1".to_string())])
36 .queries(
37 vec![
38 FormulaAndFunctionQueryDefinition
39 ::FormulaAndFunctionMetricQueryDefinition(
40 Box::new(
41 FormulaAndFunctionMetricQueryDefinition::new(
42 FormulaAndFunctionMetricDataSource::METRICS,
43 "query1".to_string(),
44 "p90:dist.dd.dogweb.latency{*}".to_string(),
45 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46 ),
47 )
48 ],
49 )
50 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51 ],
52 QueryValueWidgetDefinitionType::QUERY_VALUE,
53 )
54 .autoscale(true)
55 .precision(2)
56 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57 .title("".to_string())
58 .title_align(WidgetTextAlign::LEFT)
59 .title_size("16".to_string()),
60 ),
61 ),
62 ).layout(WidgetLayout::new(2, 2, 0, 0))
63 ],
64 );
65 let configuration = datadog::Configuration::new();
66 let api = DashboardsAPI::with_config(configuration);
67 let resp = api.create_dashboard(body).await;
68 if let Ok(value) = resp {
69 println!("{:#?}", value);
70 } else {
71 println!("{:#?}", resp.unwrap_err());
72 }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (line 67)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::ORDERED,
30 "Example-Dashboard with QVW Timeseries Background".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::QueryValueWidgetDefinition(
34 Box::new(
35 QueryValueWidgetDefinition::new(
36 vec![
37 QueryValueWidgetRequest::new()
38 .formulas(vec![WidgetFormula::new("query1".to_string())])
39 .queries(
40 vec![
41 FormulaAndFunctionQueryDefinition
42 ::FormulaAndFunctionMetricQueryDefinition(
43 Box::new(
44 FormulaAndFunctionMetricQueryDefinition::new(
45 FormulaAndFunctionMetricDataSource::METRICS,
46 "query1".to_string(),
47 "sum:my.cool.count.metric{*}".to_string(),
48 ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49 ),
50 )
51 ],
52 )
53 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54 ],
55 QueryValueWidgetDefinitionType::QUERY_VALUE,
56 )
57 .autoscale(true)
58 .precision(2)
59 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60 .timeseries_background(
61 TimeseriesBackground::new(
62 TimeseriesBackgroundType::AREA,
63 ).yaxis(WidgetAxis::new().include_zero(true)),
64 )
65 .title("".to_string())
66 .title_align(WidgetTextAlign::LEFT)
67 .title_size("16".to_string()),
68 ),
69 ),
70 ).layout(WidgetLayout::new(2, 2, 0, 0))
71 ],
72 );
73 let configuration = datadog::Configuration::new();
74 let api = DashboardsAPI::with_config(configuration);
75 let resp = api.create_dashboard(body).await;
76 if let Ok(value) = resp {
77 println!("{:#?}", value);
78 } else {
79 println!("{:#?}", resp.unwrap_err());
80 }
81}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for QueryValueWidgetDefinition
impl Clone for QueryValueWidgetDefinition
Source§fn clone(&self) -> QueryValueWidgetDefinition
fn clone(&self) -> QueryValueWidgetDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for QueryValueWidgetDefinition
impl Debug for QueryValueWidgetDefinition
Source§impl<'de> Deserialize<'de> for QueryValueWidgetDefinition
impl<'de> Deserialize<'de> for QueryValueWidgetDefinition
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for QueryValueWidgetDefinition
Auto Trait Implementations§
impl Freeze for QueryValueWidgetDefinition
impl RefUnwindSafe for QueryValueWidgetDefinition
impl Send for QueryValueWidgetDefinition
impl Sync for QueryValueWidgetDefinition
impl Unpin for QueryValueWidgetDefinition
impl UnwindSafe for QueryValueWidgetDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more