#[non_exhaustive]pub struct ScatterPlotWidgetDefinition {
pub color_by_groups: Option<Vec<String>>,
pub custom_links: Option<Vec<WidgetCustomLink>>,
pub requests: ScatterPlotWidgetDefinitionRequests,
pub time: Option<WidgetTime>,
pub title: Option<String>,
pub title_align: Option<WidgetTextAlign>,
pub title_size: Option<String>,
pub type_: ScatterPlotWidgetDefinitionType,
pub xaxis: Option<WidgetAxis>,
pub yaxis: Option<WidgetAxis>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The scatter plot visualization allows you to graph a chosen scope over two different metrics with their respective aggregation.
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.color_by_groups: Option<Vec<String>>
List of groups used for colors.
custom_links: Option<Vec<WidgetCustomLink>>
List of custom links.
requests: ScatterPlotWidgetDefinitionRequests
Widget definition.
time: Option<WidgetTime>
Time setting for the widget.
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_: ScatterPlotWidgetDefinitionType
Type of the scatter plot widget.
xaxis: Option<WidgetAxis>
Axis controls for the widget.
yaxis: Option<WidgetAxis>
Axis controls for the widget.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ScatterPlotWidgetDefinition
impl ScatterPlotWidgetDefinition
Sourcepub fn new(
requests: ScatterPlotWidgetDefinitionRequests,
type_: ScatterPlotWidgetDefinitionType,
) -> ScatterPlotWidgetDefinition
pub fn new( requests: ScatterPlotWidgetDefinitionRequests, type_: ScatterPlotWidgetDefinitionType, ) -> ScatterPlotWidgetDefinition
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2104498738.rs (lines 32-75)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::ScatterPlotWidgetDefinition(
31 Box::new(
32 ScatterPlotWidgetDefinition::new(
33 ScatterPlotWidgetDefinitionRequests
34 ::new().table(
35 ScatterplotTableRequest::new()
36 .formulas(
37 vec![
38 ScatterplotWidgetFormula::new(
39 ScatterplotDimension::X,
40 "query1".to_string(),
41 ).alias("my-query1".to_string()),
42 ScatterplotWidgetFormula::new(
43 ScatterplotDimension::Y,
44 "query2".to_string(),
45 ).alias("my-query2".to_string())
46 ],
47 )
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionMetricQueryDefinition(
52 Box::new(
53 FormulaAndFunctionMetricQueryDefinition::new(
54 FormulaAndFunctionMetricDataSource::METRICS,
55 "query1".to_string(),
56 "avg:system.cpu.user{*} by {service}".to_string(),
57 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
58 ),
59 ),
60 FormulaAndFunctionQueryDefinition
61 ::FormulaAndFunctionMetricQueryDefinition(
62 Box::new(
63 FormulaAndFunctionMetricQueryDefinition::new(
64 FormulaAndFunctionMetricDataSource::METRICS,
65 "query2".to_string(),
66 "avg:system.mem.used{*} by {service}".to_string(),
67 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
68 ),
69 )
70 ],
71 )
72 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
73 ),
74 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
75 )
76 .title("".to_string())
77 .title_align(WidgetTextAlign::LEFT)
78 .title_size("16".to_string()),
79 ),
80 ),
81 )
82 .id(5346764334358972)
83 .layout(WidgetLayout::new(2, 4, 0, 0))
84 ],
85 );
86 let configuration = datadog::Configuration::new();
87 let api = DashboardsAPI::with_config(configuration);
88 let resp = api.create_dashboard(body).await;
89 if let Ok(value) = resp {
90 println!("{:#?}", value);
91 } else {
92 println!("{:#?}", resp.unwrap_err());
93 }
94}
More examples
examples/v1_dashboards_CreateDashboard_2342457693.rs (lines 35-78)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::FREE,
30 "Example-Dashboard".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::ScatterPlotWidgetDefinition(
34 Box::new(
35 ScatterPlotWidgetDefinition::new(
36 ScatterPlotWidgetDefinitionRequests
37 ::new().table(
38 ScatterplotTableRequest::new()
39 .formulas(
40 vec![
41 ScatterplotWidgetFormula::new(
42 ScatterplotDimension::X,
43 "query1".to_string(),
44 ).alias("".to_string()),
45 ScatterplotWidgetFormula::new(
46 ScatterplotDimension::Y,
47 "query2".to_string(),
48 ).alias("".to_string())
49 ],
50 )
51 .queries(
52 vec![
53 FormulaAndFunctionQueryDefinition
54 ::FormulaAndFunctionMetricQueryDefinition(
55 Box::new(
56 FormulaAndFunctionMetricQueryDefinition::new(
57 FormulaAndFunctionMetricDataSource::METRICS,
58 "query1".to_string(),
59 "avg:system.cpu.user{*} by {service}".to_string(),
60 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
61 ),
62 ),
63 FormulaAndFunctionQueryDefinition
64 ::FormulaAndFunctionMetricQueryDefinition(
65 Box::new(
66 FormulaAndFunctionMetricQueryDefinition::new(
67 FormulaAndFunctionMetricDataSource::METRICS,
68 "query2".to_string(),
69 "avg:system.mem.used{*} by {service}".to_string(),
70 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
76 ),
77 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
78 )
79 .color_by_groups(vec![])
80 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
81 .title("".to_string())
82 .title_align(WidgetTextAlign::LEFT)
83 .title_size("16".to_string())
84 .xaxis(
85 WidgetAxis::new()
86 .include_zero(true)
87 .max("auto".to_string())
88 .min("auto".to_string())
89 .scale("linear".to_string()),
90 )
91 .yaxis(
92 WidgetAxis::new()
93 .include_zero(true)
94 .max("auto".to_string())
95 .min("auto".to_string())
96 .scale("linear".to_string()),
97 ),
98 ),
99 ),
100 ).layout(WidgetLayout::new(15, 47, 0, 0))
101 ],
102 )
103 .description(Some("".to_string()))
104 .notify_list(Some(vec![]))
105 .template_variables(Some(vec![]));
106 let configuration = datadog::Configuration::new();
107 let api = DashboardsAPI::with_config(configuration);
108 let resp = api.create_dashboard(body).await;
109 if let Ok(value) = resp {
110 println!("{:#?}", value);
111 } else {
112 println!("{:#?}", resp.unwrap_err());
113 }
114}
Sourcepub fn color_by_groups(self, value: Vec<String>) -> Self
pub fn color_by_groups(self, value: Vec<String>) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2342457693.rs (line 79)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::FREE,
30 "Example-Dashboard".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::ScatterPlotWidgetDefinition(
34 Box::new(
35 ScatterPlotWidgetDefinition::new(
36 ScatterPlotWidgetDefinitionRequests
37 ::new().table(
38 ScatterplotTableRequest::new()
39 .formulas(
40 vec![
41 ScatterplotWidgetFormula::new(
42 ScatterplotDimension::X,
43 "query1".to_string(),
44 ).alias("".to_string()),
45 ScatterplotWidgetFormula::new(
46 ScatterplotDimension::Y,
47 "query2".to_string(),
48 ).alias("".to_string())
49 ],
50 )
51 .queries(
52 vec![
53 FormulaAndFunctionQueryDefinition
54 ::FormulaAndFunctionMetricQueryDefinition(
55 Box::new(
56 FormulaAndFunctionMetricQueryDefinition::new(
57 FormulaAndFunctionMetricDataSource::METRICS,
58 "query1".to_string(),
59 "avg:system.cpu.user{*} by {service}".to_string(),
60 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
61 ),
62 ),
63 FormulaAndFunctionQueryDefinition
64 ::FormulaAndFunctionMetricQueryDefinition(
65 Box::new(
66 FormulaAndFunctionMetricQueryDefinition::new(
67 FormulaAndFunctionMetricDataSource::METRICS,
68 "query2".to_string(),
69 "avg:system.mem.used{*} by {service}".to_string(),
70 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
76 ),
77 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
78 )
79 .color_by_groups(vec![])
80 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
81 .title("".to_string())
82 .title_align(WidgetTextAlign::LEFT)
83 .title_size("16".to_string())
84 .xaxis(
85 WidgetAxis::new()
86 .include_zero(true)
87 .max("auto".to_string())
88 .min("auto".to_string())
89 .scale("linear".to_string()),
90 )
91 .yaxis(
92 WidgetAxis::new()
93 .include_zero(true)
94 .max("auto".to_string())
95 .min("auto".to_string())
96 .scale("linear".to_string()),
97 ),
98 ),
99 ),
100 ).layout(WidgetLayout::new(15, 47, 0, 0))
101 ],
102 )
103 .description(Some("".to_string()))
104 .notify_list(Some(vec![]))
105 .template_variables(Some(vec![]));
106 let configuration = datadog::Configuration::new();
107 let api = DashboardsAPI::with_config(configuration);
108 let resp = api.create_dashboard(body).await;
109 if let Ok(value) = resp {
110 println!("{:#?}", value);
111 } else {
112 println!("{:#?}", resp.unwrap_err());
113 }
114}
pub fn custom_links(self, value: Vec<WidgetCustomLink>) -> Self
Sourcepub fn time(self, value: WidgetTime) -> Self
pub fn time(self, value: WidgetTime) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2342457693.rs (line 80)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::FREE,
30 "Example-Dashboard".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::ScatterPlotWidgetDefinition(
34 Box::new(
35 ScatterPlotWidgetDefinition::new(
36 ScatterPlotWidgetDefinitionRequests
37 ::new().table(
38 ScatterplotTableRequest::new()
39 .formulas(
40 vec![
41 ScatterplotWidgetFormula::new(
42 ScatterplotDimension::X,
43 "query1".to_string(),
44 ).alias("".to_string()),
45 ScatterplotWidgetFormula::new(
46 ScatterplotDimension::Y,
47 "query2".to_string(),
48 ).alias("".to_string())
49 ],
50 )
51 .queries(
52 vec![
53 FormulaAndFunctionQueryDefinition
54 ::FormulaAndFunctionMetricQueryDefinition(
55 Box::new(
56 FormulaAndFunctionMetricQueryDefinition::new(
57 FormulaAndFunctionMetricDataSource::METRICS,
58 "query1".to_string(),
59 "avg:system.cpu.user{*} by {service}".to_string(),
60 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
61 ),
62 ),
63 FormulaAndFunctionQueryDefinition
64 ::FormulaAndFunctionMetricQueryDefinition(
65 Box::new(
66 FormulaAndFunctionMetricQueryDefinition::new(
67 FormulaAndFunctionMetricDataSource::METRICS,
68 "query2".to_string(),
69 "avg:system.mem.used{*} by {service}".to_string(),
70 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
76 ),
77 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
78 )
79 .color_by_groups(vec![])
80 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
81 .title("".to_string())
82 .title_align(WidgetTextAlign::LEFT)
83 .title_size("16".to_string())
84 .xaxis(
85 WidgetAxis::new()
86 .include_zero(true)
87 .max("auto".to_string())
88 .min("auto".to_string())
89 .scale("linear".to_string()),
90 )
91 .yaxis(
92 WidgetAxis::new()
93 .include_zero(true)
94 .max("auto".to_string())
95 .min("auto".to_string())
96 .scale("linear".to_string()),
97 ),
98 ),
99 ),
100 ).layout(WidgetLayout::new(15, 47, 0, 0))
101 ],
102 )
103 .description(Some("".to_string()))
104 .notify_list(Some(vec![]))
105 .template_variables(Some(vec![]));
106 let configuration = datadog::Configuration::new();
107 let api = DashboardsAPI::with_config(configuration);
108 let resp = api.create_dashboard(body).await;
109 if let Ok(value) = resp {
110 println!("{:#?}", value);
111 } else {
112 println!("{:#?}", resp.unwrap_err());
113 }
114}
Sourcepub fn title(self, value: String) -> Self
pub fn title(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2104498738.rs (line 76)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::ScatterPlotWidgetDefinition(
31 Box::new(
32 ScatterPlotWidgetDefinition::new(
33 ScatterPlotWidgetDefinitionRequests
34 ::new().table(
35 ScatterplotTableRequest::new()
36 .formulas(
37 vec![
38 ScatterplotWidgetFormula::new(
39 ScatterplotDimension::X,
40 "query1".to_string(),
41 ).alias("my-query1".to_string()),
42 ScatterplotWidgetFormula::new(
43 ScatterplotDimension::Y,
44 "query2".to_string(),
45 ).alias("my-query2".to_string())
46 ],
47 )
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionMetricQueryDefinition(
52 Box::new(
53 FormulaAndFunctionMetricQueryDefinition::new(
54 FormulaAndFunctionMetricDataSource::METRICS,
55 "query1".to_string(),
56 "avg:system.cpu.user{*} by {service}".to_string(),
57 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
58 ),
59 ),
60 FormulaAndFunctionQueryDefinition
61 ::FormulaAndFunctionMetricQueryDefinition(
62 Box::new(
63 FormulaAndFunctionMetricQueryDefinition::new(
64 FormulaAndFunctionMetricDataSource::METRICS,
65 "query2".to_string(),
66 "avg:system.mem.used{*} by {service}".to_string(),
67 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
68 ),
69 )
70 ],
71 )
72 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
73 ),
74 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
75 )
76 .title("".to_string())
77 .title_align(WidgetTextAlign::LEFT)
78 .title_size("16".to_string()),
79 ),
80 ),
81 )
82 .id(5346764334358972)
83 .layout(WidgetLayout::new(2, 4, 0, 0))
84 ],
85 );
86 let configuration = datadog::Configuration::new();
87 let api = DashboardsAPI::with_config(configuration);
88 let resp = api.create_dashboard(body).await;
89 if let Ok(value) = resp {
90 println!("{:#?}", value);
91 } else {
92 println!("{:#?}", resp.unwrap_err());
93 }
94}
More examples
examples/v1_dashboards_CreateDashboard_2342457693.rs (line 81)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::FREE,
30 "Example-Dashboard".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::ScatterPlotWidgetDefinition(
34 Box::new(
35 ScatterPlotWidgetDefinition::new(
36 ScatterPlotWidgetDefinitionRequests
37 ::new().table(
38 ScatterplotTableRequest::new()
39 .formulas(
40 vec![
41 ScatterplotWidgetFormula::new(
42 ScatterplotDimension::X,
43 "query1".to_string(),
44 ).alias("".to_string()),
45 ScatterplotWidgetFormula::new(
46 ScatterplotDimension::Y,
47 "query2".to_string(),
48 ).alias("".to_string())
49 ],
50 )
51 .queries(
52 vec![
53 FormulaAndFunctionQueryDefinition
54 ::FormulaAndFunctionMetricQueryDefinition(
55 Box::new(
56 FormulaAndFunctionMetricQueryDefinition::new(
57 FormulaAndFunctionMetricDataSource::METRICS,
58 "query1".to_string(),
59 "avg:system.cpu.user{*} by {service}".to_string(),
60 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
61 ),
62 ),
63 FormulaAndFunctionQueryDefinition
64 ::FormulaAndFunctionMetricQueryDefinition(
65 Box::new(
66 FormulaAndFunctionMetricQueryDefinition::new(
67 FormulaAndFunctionMetricDataSource::METRICS,
68 "query2".to_string(),
69 "avg:system.mem.used{*} by {service}".to_string(),
70 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
76 ),
77 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
78 )
79 .color_by_groups(vec![])
80 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
81 .title("".to_string())
82 .title_align(WidgetTextAlign::LEFT)
83 .title_size("16".to_string())
84 .xaxis(
85 WidgetAxis::new()
86 .include_zero(true)
87 .max("auto".to_string())
88 .min("auto".to_string())
89 .scale("linear".to_string()),
90 )
91 .yaxis(
92 WidgetAxis::new()
93 .include_zero(true)
94 .max("auto".to_string())
95 .min("auto".to_string())
96 .scale("linear".to_string()),
97 ),
98 ),
99 ),
100 ).layout(WidgetLayout::new(15, 47, 0, 0))
101 ],
102 )
103 .description(Some("".to_string()))
104 .notify_list(Some(vec![]))
105 .template_variables(Some(vec![]));
106 let configuration = datadog::Configuration::new();
107 let api = DashboardsAPI::with_config(configuration);
108 let resp = api.create_dashboard(body).await;
109 if let Ok(value) = resp {
110 println!("{:#?}", value);
111 } else {
112 println!("{:#?}", resp.unwrap_err());
113 }
114}
Sourcepub fn title_align(self, value: WidgetTextAlign) -> Self
pub fn title_align(self, value: WidgetTextAlign) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2104498738.rs (line 77)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::ScatterPlotWidgetDefinition(
31 Box::new(
32 ScatterPlotWidgetDefinition::new(
33 ScatterPlotWidgetDefinitionRequests
34 ::new().table(
35 ScatterplotTableRequest::new()
36 .formulas(
37 vec![
38 ScatterplotWidgetFormula::new(
39 ScatterplotDimension::X,
40 "query1".to_string(),
41 ).alias("my-query1".to_string()),
42 ScatterplotWidgetFormula::new(
43 ScatterplotDimension::Y,
44 "query2".to_string(),
45 ).alias("my-query2".to_string())
46 ],
47 )
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionMetricQueryDefinition(
52 Box::new(
53 FormulaAndFunctionMetricQueryDefinition::new(
54 FormulaAndFunctionMetricDataSource::METRICS,
55 "query1".to_string(),
56 "avg:system.cpu.user{*} by {service}".to_string(),
57 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
58 ),
59 ),
60 FormulaAndFunctionQueryDefinition
61 ::FormulaAndFunctionMetricQueryDefinition(
62 Box::new(
63 FormulaAndFunctionMetricQueryDefinition::new(
64 FormulaAndFunctionMetricDataSource::METRICS,
65 "query2".to_string(),
66 "avg:system.mem.used{*} by {service}".to_string(),
67 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
68 ),
69 )
70 ],
71 )
72 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
73 ),
74 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
75 )
76 .title("".to_string())
77 .title_align(WidgetTextAlign::LEFT)
78 .title_size("16".to_string()),
79 ),
80 ),
81 )
82 .id(5346764334358972)
83 .layout(WidgetLayout::new(2, 4, 0, 0))
84 ],
85 );
86 let configuration = datadog::Configuration::new();
87 let api = DashboardsAPI::with_config(configuration);
88 let resp = api.create_dashboard(body).await;
89 if let Ok(value) = resp {
90 println!("{:#?}", value);
91 } else {
92 println!("{:#?}", resp.unwrap_err());
93 }
94}
More examples
examples/v1_dashboards_CreateDashboard_2342457693.rs (line 82)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::FREE,
30 "Example-Dashboard".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::ScatterPlotWidgetDefinition(
34 Box::new(
35 ScatterPlotWidgetDefinition::new(
36 ScatterPlotWidgetDefinitionRequests
37 ::new().table(
38 ScatterplotTableRequest::new()
39 .formulas(
40 vec![
41 ScatterplotWidgetFormula::new(
42 ScatterplotDimension::X,
43 "query1".to_string(),
44 ).alias("".to_string()),
45 ScatterplotWidgetFormula::new(
46 ScatterplotDimension::Y,
47 "query2".to_string(),
48 ).alias("".to_string())
49 ],
50 )
51 .queries(
52 vec![
53 FormulaAndFunctionQueryDefinition
54 ::FormulaAndFunctionMetricQueryDefinition(
55 Box::new(
56 FormulaAndFunctionMetricQueryDefinition::new(
57 FormulaAndFunctionMetricDataSource::METRICS,
58 "query1".to_string(),
59 "avg:system.cpu.user{*} by {service}".to_string(),
60 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
61 ),
62 ),
63 FormulaAndFunctionQueryDefinition
64 ::FormulaAndFunctionMetricQueryDefinition(
65 Box::new(
66 FormulaAndFunctionMetricQueryDefinition::new(
67 FormulaAndFunctionMetricDataSource::METRICS,
68 "query2".to_string(),
69 "avg:system.mem.used{*} by {service}".to_string(),
70 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
76 ),
77 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
78 )
79 .color_by_groups(vec![])
80 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
81 .title("".to_string())
82 .title_align(WidgetTextAlign::LEFT)
83 .title_size("16".to_string())
84 .xaxis(
85 WidgetAxis::new()
86 .include_zero(true)
87 .max("auto".to_string())
88 .min("auto".to_string())
89 .scale("linear".to_string()),
90 )
91 .yaxis(
92 WidgetAxis::new()
93 .include_zero(true)
94 .max("auto".to_string())
95 .min("auto".to_string())
96 .scale("linear".to_string()),
97 ),
98 ),
99 ),
100 ).layout(WidgetLayout::new(15, 47, 0, 0))
101 ],
102 )
103 .description(Some("".to_string()))
104 .notify_list(Some(vec![]))
105 .template_variables(Some(vec![]));
106 let configuration = datadog::Configuration::new();
107 let api = DashboardsAPI::with_config(configuration);
108 let resp = api.create_dashboard(body).await;
109 if let Ok(value) = resp {
110 println!("{:#?}", value);
111 } else {
112 println!("{:#?}", resp.unwrap_err());
113 }
114}
Sourcepub fn title_size(self, value: String) -> Self
pub fn title_size(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2104498738.rs (line 78)
23async fn main() {
24 let body =
25 Dashboard::new(
26 DashboardLayoutType::ORDERED,
27 "Example-Dashboard".to_string(),
28 vec![
29 Widget::new(
30 WidgetDefinition::ScatterPlotWidgetDefinition(
31 Box::new(
32 ScatterPlotWidgetDefinition::new(
33 ScatterPlotWidgetDefinitionRequests
34 ::new().table(
35 ScatterplotTableRequest::new()
36 .formulas(
37 vec![
38 ScatterplotWidgetFormula::new(
39 ScatterplotDimension::X,
40 "query1".to_string(),
41 ).alias("my-query1".to_string()),
42 ScatterplotWidgetFormula::new(
43 ScatterplotDimension::Y,
44 "query2".to_string(),
45 ).alias("my-query2".to_string())
46 ],
47 )
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionMetricQueryDefinition(
52 Box::new(
53 FormulaAndFunctionMetricQueryDefinition::new(
54 FormulaAndFunctionMetricDataSource::METRICS,
55 "query1".to_string(),
56 "avg:system.cpu.user{*} by {service}".to_string(),
57 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
58 ),
59 ),
60 FormulaAndFunctionQueryDefinition
61 ::FormulaAndFunctionMetricQueryDefinition(
62 Box::new(
63 FormulaAndFunctionMetricQueryDefinition::new(
64 FormulaAndFunctionMetricDataSource::METRICS,
65 "query2".to_string(),
66 "avg:system.mem.used{*} by {service}".to_string(),
67 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
68 ),
69 )
70 ],
71 )
72 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
73 ),
74 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
75 )
76 .title("".to_string())
77 .title_align(WidgetTextAlign::LEFT)
78 .title_size("16".to_string()),
79 ),
80 ),
81 )
82 .id(5346764334358972)
83 .layout(WidgetLayout::new(2, 4, 0, 0))
84 ],
85 );
86 let configuration = datadog::Configuration::new();
87 let api = DashboardsAPI::with_config(configuration);
88 let resp = api.create_dashboard(body).await;
89 if let Ok(value) = resp {
90 println!("{:#?}", value);
91 } else {
92 println!("{:#?}", resp.unwrap_err());
93 }
94}
More examples
examples/v1_dashboards_CreateDashboard_2342457693.rs (line 83)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::FREE,
30 "Example-Dashboard".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::ScatterPlotWidgetDefinition(
34 Box::new(
35 ScatterPlotWidgetDefinition::new(
36 ScatterPlotWidgetDefinitionRequests
37 ::new().table(
38 ScatterplotTableRequest::new()
39 .formulas(
40 vec![
41 ScatterplotWidgetFormula::new(
42 ScatterplotDimension::X,
43 "query1".to_string(),
44 ).alias("".to_string()),
45 ScatterplotWidgetFormula::new(
46 ScatterplotDimension::Y,
47 "query2".to_string(),
48 ).alias("".to_string())
49 ],
50 )
51 .queries(
52 vec![
53 FormulaAndFunctionQueryDefinition
54 ::FormulaAndFunctionMetricQueryDefinition(
55 Box::new(
56 FormulaAndFunctionMetricQueryDefinition::new(
57 FormulaAndFunctionMetricDataSource::METRICS,
58 "query1".to_string(),
59 "avg:system.cpu.user{*} by {service}".to_string(),
60 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
61 ),
62 ),
63 FormulaAndFunctionQueryDefinition
64 ::FormulaAndFunctionMetricQueryDefinition(
65 Box::new(
66 FormulaAndFunctionMetricQueryDefinition::new(
67 FormulaAndFunctionMetricDataSource::METRICS,
68 "query2".to_string(),
69 "avg:system.mem.used{*} by {service}".to_string(),
70 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
76 ),
77 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
78 )
79 .color_by_groups(vec![])
80 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
81 .title("".to_string())
82 .title_align(WidgetTextAlign::LEFT)
83 .title_size("16".to_string())
84 .xaxis(
85 WidgetAxis::new()
86 .include_zero(true)
87 .max("auto".to_string())
88 .min("auto".to_string())
89 .scale("linear".to_string()),
90 )
91 .yaxis(
92 WidgetAxis::new()
93 .include_zero(true)
94 .max("auto".to_string())
95 .min("auto".to_string())
96 .scale("linear".to_string()),
97 ),
98 ),
99 ),
100 ).layout(WidgetLayout::new(15, 47, 0, 0))
101 ],
102 )
103 .description(Some("".to_string()))
104 .notify_list(Some(vec![]))
105 .template_variables(Some(vec![]));
106 let configuration = datadog::Configuration::new();
107 let api = DashboardsAPI::with_config(configuration);
108 let resp = api.create_dashboard(body).await;
109 if let Ok(value) = resp {
110 println!("{:#?}", value);
111 } else {
112 println!("{:#?}", resp.unwrap_err());
113 }
114}
Sourcepub fn xaxis(self, value: WidgetAxis) -> Self
pub fn xaxis(self, value: WidgetAxis) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2342457693.rs (lines 84-90)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::FREE,
30 "Example-Dashboard".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::ScatterPlotWidgetDefinition(
34 Box::new(
35 ScatterPlotWidgetDefinition::new(
36 ScatterPlotWidgetDefinitionRequests
37 ::new().table(
38 ScatterplotTableRequest::new()
39 .formulas(
40 vec![
41 ScatterplotWidgetFormula::new(
42 ScatterplotDimension::X,
43 "query1".to_string(),
44 ).alias("".to_string()),
45 ScatterplotWidgetFormula::new(
46 ScatterplotDimension::Y,
47 "query2".to_string(),
48 ).alias("".to_string())
49 ],
50 )
51 .queries(
52 vec![
53 FormulaAndFunctionQueryDefinition
54 ::FormulaAndFunctionMetricQueryDefinition(
55 Box::new(
56 FormulaAndFunctionMetricQueryDefinition::new(
57 FormulaAndFunctionMetricDataSource::METRICS,
58 "query1".to_string(),
59 "avg:system.cpu.user{*} by {service}".to_string(),
60 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
61 ),
62 ),
63 FormulaAndFunctionQueryDefinition
64 ::FormulaAndFunctionMetricQueryDefinition(
65 Box::new(
66 FormulaAndFunctionMetricQueryDefinition::new(
67 FormulaAndFunctionMetricDataSource::METRICS,
68 "query2".to_string(),
69 "avg:system.mem.used{*} by {service}".to_string(),
70 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
76 ),
77 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
78 )
79 .color_by_groups(vec![])
80 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
81 .title("".to_string())
82 .title_align(WidgetTextAlign::LEFT)
83 .title_size("16".to_string())
84 .xaxis(
85 WidgetAxis::new()
86 .include_zero(true)
87 .max("auto".to_string())
88 .min("auto".to_string())
89 .scale("linear".to_string()),
90 )
91 .yaxis(
92 WidgetAxis::new()
93 .include_zero(true)
94 .max("auto".to_string())
95 .min("auto".to_string())
96 .scale("linear".to_string()),
97 ),
98 ),
99 ),
100 ).layout(WidgetLayout::new(15, 47, 0, 0))
101 ],
102 )
103 .description(Some("".to_string()))
104 .notify_list(Some(vec![]))
105 .template_variables(Some(vec![]));
106 let configuration = datadog::Configuration::new();
107 let api = DashboardsAPI::with_config(configuration);
108 let resp = api.create_dashboard(body).await;
109 if let Ok(value) = resp {
110 println!("{:#?}", value);
111 } else {
112 println!("{:#?}", resp.unwrap_err());
113 }
114}
Sourcepub fn yaxis(self, value: WidgetAxis) -> Self
pub fn yaxis(self, value: WidgetAxis) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2342457693.rs (lines 91-97)
26async fn main() {
27 let body =
28 Dashboard::new(
29 DashboardLayoutType::FREE,
30 "Example-Dashboard".to_string(),
31 vec![
32 Widget::new(
33 WidgetDefinition::ScatterPlotWidgetDefinition(
34 Box::new(
35 ScatterPlotWidgetDefinition::new(
36 ScatterPlotWidgetDefinitionRequests
37 ::new().table(
38 ScatterplotTableRequest::new()
39 .formulas(
40 vec![
41 ScatterplotWidgetFormula::new(
42 ScatterplotDimension::X,
43 "query1".to_string(),
44 ).alias("".to_string()),
45 ScatterplotWidgetFormula::new(
46 ScatterplotDimension::Y,
47 "query2".to_string(),
48 ).alias("".to_string())
49 ],
50 )
51 .queries(
52 vec![
53 FormulaAndFunctionQueryDefinition
54 ::FormulaAndFunctionMetricQueryDefinition(
55 Box::new(
56 FormulaAndFunctionMetricQueryDefinition::new(
57 FormulaAndFunctionMetricDataSource::METRICS,
58 "query1".to_string(),
59 "avg:system.cpu.user{*} by {service}".to_string(),
60 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
61 ),
62 ),
63 FormulaAndFunctionQueryDefinition
64 ::FormulaAndFunctionMetricQueryDefinition(
65 Box::new(
66 FormulaAndFunctionMetricQueryDefinition::new(
67 FormulaAndFunctionMetricDataSource::METRICS,
68 "query2".to_string(),
69 "avg:system.mem.used{*} by {service}".to_string(),
70 ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR),
76 ),
77 ScatterPlotWidgetDefinitionType::SCATTERPLOT,
78 )
79 .color_by_groups(vec![])
80 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
81 .title("".to_string())
82 .title_align(WidgetTextAlign::LEFT)
83 .title_size("16".to_string())
84 .xaxis(
85 WidgetAxis::new()
86 .include_zero(true)
87 .max("auto".to_string())
88 .min("auto".to_string())
89 .scale("linear".to_string()),
90 )
91 .yaxis(
92 WidgetAxis::new()
93 .include_zero(true)
94 .max("auto".to_string())
95 .min("auto".to_string())
96 .scale("linear".to_string()),
97 ),
98 ),
99 ),
100 ).layout(WidgetLayout::new(15, 47, 0, 0))
101 ],
102 )
103 .description(Some("".to_string()))
104 .notify_list(Some(vec![]))
105 .template_variables(Some(vec![]));
106 let configuration = datadog::Configuration::new();
107 let api = DashboardsAPI::with_config(configuration);
108 let resp = api.create_dashboard(body).await;
109 if let Ok(value) = resp {
110 println!("{:#?}", value);
111 } else {
112 println!("{:#?}", resp.unwrap_err());
113 }
114}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ScatterPlotWidgetDefinition
impl Clone for ScatterPlotWidgetDefinition
Source§fn clone(&self) -> ScatterPlotWidgetDefinition
fn clone(&self) -> ScatterPlotWidgetDefinition
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 ScatterPlotWidgetDefinition
impl Debug for ScatterPlotWidgetDefinition
Source§impl<'de> Deserialize<'de> for ScatterPlotWidgetDefinition
impl<'de> Deserialize<'de> for ScatterPlotWidgetDefinition
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 ScatterPlotWidgetDefinition
Auto Trait Implementations§
impl Freeze for ScatterPlotWidgetDefinition
impl RefUnwindSafe for ScatterPlotWidgetDefinition
impl Send for ScatterPlotWidgetDefinition
impl Sync for ScatterPlotWidgetDefinition
impl Unpin for ScatterPlotWidgetDefinition
impl UnwindSafe for ScatterPlotWidgetDefinition
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