#[non_exhaustive]pub struct GeomapWidgetDefinition {
pub custom_links: Option<Vec<WidgetCustomLink>>,
pub requests: Vec<GeomapWidgetRequest>,
pub style: GeomapWidgetDefinitionStyle,
pub time: Option<WidgetTime>,
pub title: Option<String>,
pub title_align: Option<WidgetTextAlign>,
pub title_size: Option<String>,
pub type_: GeomapWidgetDefinitionType,
pub view: GeomapWidgetDefinitionView,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
This visualization displays a series of values by country on a world map.
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.custom_links: Option<Vec<WidgetCustomLink>>
A list of custom links.
requests: Vec<GeomapWidgetRequest>
Array of one request object to display in the widget. The request must contain a group-by
tag whose value is a country ISO code.
See the Request JSON schema documentation
for information about building the REQUEST_SCHEMA
.
style: GeomapWidgetDefinitionStyle
The style to apply to the widget.
time: Option<WidgetTime>
Time setting for the widget.
title: Option<String>
The title of your widget.
title_align: Option<WidgetTextAlign>
How to align the text on the widget.
title_size: Option<String>
The size of the title.
type_: GeomapWidgetDefinitionType
Type of the geomap widget.
view: GeomapWidgetDefinitionView
The view of the world that the map should render.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl GeomapWidgetDefinition
impl GeomapWidgetDefinition
Sourcepub fn new(
requests: Vec<GeomapWidgetRequest>,
style: GeomapWidgetDefinitionStyle,
type_: GeomapWidgetDefinitionType,
view: GeomapWidgetDefinitionView,
) -> GeomapWidgetDefinition
pub fn new( requests: Vec<GeomapWidgetRequest>, style: GeomapWidgetDefinitionStyle, type_: GeomapWidgetDefinitionType, view: GeomapWidgetDefinitionView, ) -> GeomapWidgetDefinition
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (lines 29-62)
23async fn main() {
24 let body = Dashboard::new(
25 DashboardLayoutType::ORDERED,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(WidgetDefinition::GeomapWidgetDefinition(Box::new(
29 GeomapWidgetDefinition::new(
30 vec![GeomapWidgetRequest::new()
31 .columns(vec![
32 ListStreamColumn::new(
33 "@network.client.geoip.location.latitude".to_string(),
34 ListStreamColumnWidth::AUTO,
35 ),
36 ListStreamColumn::new(
37 "@network.client.geoip.location.longitude".to_string(),
38 ListStreamColumnWidth::AUTO,
39 ),
40 ListStreamColumn::new(
41 "@network.client.geoip.country.iso_code".to_string(),
42 ListStreamColumnWidth::AUTO,
43 ),
44 ListStreamColumn::new(
45 "@network.client.geoip.subdivision.name".to_string(),
46 ListStreamColumnWidth::AUTO,
47 ),
48 ListStreamColumn::new(
49 "classic".to_string(),
50 ListStreamColumnWidth::AUTO,
51 ),
52 ListStreamColumn::new("".to_string(), ListStreamColumnWidth::AUTO),
53 ])
54 .query(
55 ListStreamQuery::new(ListStreamSource::LOGS_STREAM, "".to_string())
56 .indexes(vec![]),
57 )
58 .response_format(FormulaAndFunctionResponseFormat::EVENT_LIST)],
59 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
60 GeomapWidgetDefinitionType::GEOMAP,
61 GeomapWidgetDefinitionView::new("WORLD".to_string()),
62 )
63 .title("".to_string())
64 .title_align(WidgetTextAlign::LEFT)
65 .title_size("16".to_string()),
66 )))
67 .layout(WidgetLayout::new(6, 12, 0, 0)),
68 ],
69 )
70 .description(Some("Example-Dashboard".to_string()))
71 .notify_list(Some(vec![]))
72 .reflow_type(DashboardReflowType::FIXED)
73 .tags(Some(vec![]))
74 .template_variables(Some(vec![]));
75 let configuration = datadog::Configuration::new();
76 let api = DashboardsAPI::with_config(configuration);
77 let resp = api.create_dashboard(body).await;
78 if let Ok(value) = resp {
79 println!("{:#?}", value);
80 } else {
81 println!("{:#?}", resp.unwrap_err());
82 }
83}
More examples
examples/v1_dashboards_CreateDashboard_915214113.rs (lines 44-107)
35async fn main() {
36 let body =
37 Dashboard::new(
38 DashboardLayoutType::FREE,
39 "Example-Dashboard".to_string(),
40 vec![
41 Widget::new(
42 WidgetDefinition::GeomapWidgetDefinition(
43 Box::new(
44 GeomapWidgetDefinition::new(
45 vec![
46 GeomapWidgetRequest::new()
47 .formulas(vec![WidgetFormula::new("query1".to_string())])
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionEventQueryDefinition(
52 Box::new(
53 FormulaAndFunctionEventQueryDefinition::new(
54 FormulaAndFunctionEventQueryDefinitionCompute::new(
55 FormulaAndFunctionEventAggregation::COUNT,
56 ),
57 FormulaAndFunctionEventsDataSource::RUM,
58 "query1".to_string(),
59 )
60 .group_by(
61 vec![
62 FormulaAndFunctionEventQueryGroupBy::new(
63 "@geo.country_iso_code".to_string(),
64 )
65 .limit(250)
66 .sort(
67 FormulaAndFunctionEventQueryGroupBySort
68 ::new(
69 FormulaAndFunctionEventAggregation
70 ::COUNT,
71 ).order(QuerySortOrder::DESC),
72 )
73 ],
74 )
75 .indexes(vec!["*".to_string()])
76 .search(
77 FormulaAndFunctionEventQueryDefinitionSearch::new(
78 "".to_string(),
79 ),
80 ),
81 ),
82 )
83 ],
84 )
85 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
86 .sort(
87 WidgetSortBy::new()
88 .count(250)
89 .order_by(
90 vec![
91 WidgetSortOrderBy::WidgetFormulaSort(
92 Box::new(
93 WidgetFormulaSort::new(
94 0,
95 WidgetSort::DESCENDING,
96 FormulaType::FORMULA,
97 ),
98 ),
99 )
100 ],
101 ),
102 )
103 ],
104 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
105 GeomapWidgetDefinitionType::GEOMAP,
106 GeomapWidgetDefinitionView::new("WORLD".to_string()),
107 )
108 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
109 .title("".to_string())
110 .title_align(WidgetTextAlign::LEFT)
111 .title_size("16".to_string()),
112 ),
113 ),
114 ).layout(WidgetLayout::new(30, 47, 0, 0))
115 ],
116 )
117 .description(None)
118 .notify_list(Some(vec![]))
119 .template_variables(Some(vec![]));
120 let configuration = datadog::Configuration::new();
121 let api = DashboardsAPI::with_config(configuration);
122 let resp = api.create_dashboard(body).await;
123 if let Ok(value) = resp {
124 println!("{:#?}", value);
125 } else {
126 println!("{:#?}", resp.unwrap_err());
127 }
128}
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_915214113.rs (line 108)
35async fn main() {
36 let body =
37 Dashboard::new(
38 DashboardLayoutType::FREE,
39 "Example-Dashboard".to_string(),
40 vec![
41 Widget::new(
42 WidgetDefinition::GeomapWidgetDefinition(
43 Box::new(
44 GeomapWidgetDefinition::new(
45 vec![
46 GeomapWidgetRequest::new()
47 .formulas(vec![WidgetFormula::new("query1".to_string())])
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionEventQueryDefinition(
52 Box::new(
53 FormulaAndFunctionEventQueryDefinition::new(
54 FormulaAndFunctionEventQueryDefinitionCompute::new(
55 FormulaAndFunctionEventAggregation::COUNT,
56 ),
57 FormulaAndFunctionEventsDataSource::RUM,
58 "query1".to_string(),
59 )
60 .group_by(
61 vec![
62 FormulaAndFunctionEventQueryGroupBy::new(
63 "@geo.country_iso_code".to_string(),
64 )
65 .limit(250)
66 .sort(
67 FormulaAndFunctionEventQueryGroupBySort
68 ::new(
69 FormulaAndFunctionEventAggregation
70 ::COUNT,
71 ).order(QuerySortOrder::DESC),
72 )
73 ],
74 )
75 .indexes(vec!["*".to_string()])
76 .search(
77 FormulaAndFunctionEventQueryDefinitionSearch::new(
78 "".to_string(),
79 ),
80 ),
81 ),
82 )
83 ],
84 )
85 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
86 .sort(
87 WidgetSortBy::new()
88 .count(250)
89 .order_by(
90 vec![
91 WidgetSortOrderBy::WidgetFormulaSort(
92 Box::new(
93 WidgetFormulaSort::new(
94 0,
95 WidgetSort::DESCENDING,
96 FormulaType::FORMULA,
97 ),
98 ),
99 )
100 ],
101 ),
102 )
103 ],
104 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
105 GeomapWidgetDefinitionType::GEOMAP,
106 GeomapWidgetDefinitionView::new("WORLD".to_string()),
107 )
108 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
109 .title("".to_string())
110 .title_align(WidgetTextAlign::LEFT)
111 .title_size("16".to_string()),
112 ),
113 ),
114 ).layout(WidgetLayout::new(30, 47, 0, 0))
115 ],
116 )
117 .description(None)
118 .notify_list(Some(vec![]))
119 .template_variables(Some(vec![]));
120 let configuration = datadog::Configuration::new();
121 let api = DashboardsAPI::with_config(configuration);
122 let resp = api.create_dashboard(body).await;
123 if let Ok(value) = resp {
124 println!("{:#?}", value);
125 } else {
126 println!("{:#?}", resp.unwrap_err());
127 }
128}
Sourcepub fn title(self, value: String) -> Self
pub fn title(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (line 63)
23async fn main() {
24 let body = Dashboard::new(
25 DashboardLayoutType::ORDERED,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(WidgetDefinition::GeomapWidgetDefinition(Box::new(
29 GeomapWidgetDefinition::new(
30 vec![GeomapWidgetRequest::new()
31 .columns(vec![
32 ListStreamColumn::new(
33 "@network.client.geoip.location.latitude".to_string(),
34 ListStreamColumnWidth::AUTO,
35 ),
36 ListStreamColumn::new(
37 "@network.client.geoip.location.longitude".to_string(),
38 ListStreamColumnWidth::AUTO,
39 ),
40 ListStreamColumn::new(
41 "@network.client.geoip.country.iso_code".to_string(),
42 ListStreamColumnWidth::AUTO,
43 ),
44 ListStreamColumn::new(
45 "@network.client.geoip.subdivision.name".to_string(),
46 ListStreamColumnWidth::AUTO,
47 ),
48 ListStreamColumn::new(
49 "classic".to_string(),
50 ListStreamColumnWidth::AUTO,
51 ),
52 ListStreamColumn::new("".to_string(), ListStreamColumnWidth::AUTO),
53 ])
54 .query(
55 ListStreamQuery::new(ListStreamSource::LOGS_STREAM, "".to_string())
56 .indexes(vec![]),
57 )
58 .response_format(FormulaAndFunctionResponseFormat::EVENT_LIST)],
59 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
60 GeomapWidgetDefinitionType::GEOMAP,
61 GeomapWidgetDefinitionView::new("WORLD".to_string()),
62 )
63 .title("".to_string())
64 .title_align(WidgetTextAlign::LEFT)
65 .title_size("16".to_string()),
66 )))
67 .layout(WidgetLayout::new(6, 12, 0, 0)),
68 ],
69 )
70 .description(Some("Example-Dashboard".to_string()))
71 .notify_list(Some(vec![]))
72 .reflow_type(DashboardReflowType::FIXED)
73 .tags(Some(vec![]))
74 .template_variables(Some(vec![]));
75 let configuration = datadog::Configuration::new();
76 let api = DashboardsAPI::with_config(configuration);
77 let resp = api.create_dashboard(body).await;
78 if let Ok(value) = resp {
79 println!("{:#?}", value);
80 } else {
81 println!("{:#?}", resp.unwrap_err());
82 }
83}
More examples
examples/v1_dashboards_CreateDashboard_915214113.rs (line 109)
35async fn main() {
36 let body =
37 Dashboard::new(
38 DashboardLayoutType::FREE,
39 "Example-Dashboard".to_string(),
40 vec![
41 Widget::new(
42 WidgetDefinition::GeomapWidgetDefinition(
43 Box::new(
44 GeomapWidgetDefinition::new(
45 vec![
46 GeomapWidgetRequest::new()
47 .formulas(vec![WidgetFormula::new("query1".to_string())])
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionEventQueryDefinition(
52 Box::new(
53 FormulaAndFunctionEventQueryDefinition::new(
54 FormulaAndFunctionEventQueryDefinitionCompute::new(
55 FormulaAndFunctionEventAggregation::COUNT,
56 ),
57 FormulaAndFunctionEventsDataSource::RUM,
58 "query1".to_string(),
59 )
60 .group_by(
61 vec![
62 FormulaAndFunctionEventQueryGroupBy::new(
63 "@geo.country_iso_code".to_string(),
64 )
65 .limit(250)
66 .sort(
67 FormulaAndFunctionEventQueryGroupBySort
68 ::new(
69 FormulaAndFunctionEventAggregation
70 ::COUNT,
71 ).order(QuerySortOrder::DESC),
72 )
73 ],
74 )
75 .indexes(vec!["*".to_string()])
76 .search(
77 FormulaAndFunctionEventQueryDefinitionSearch::new(
78 "".to_string(),
79 ),
80 ),
81 ),
82 )
83 ],
84 )
85 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
86 .sort(
87 WidgetSortBy::new()
88 .count(250)
89 .order_by(
90 vec![
91 WidgetSortOrderBy::WidgetFormulaSort(
92 Box::new(
93 WidgetFormulaSort::new(
94 0,
95 WidgetSort::DESCENDING,
96 FormulaType::FORMULA,
97 ),
98 ),
99 )
100 ],
101 ),
102 )
103 ],
104 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
105 GeomapWidgetDefinitionType::GEOMAP,
106 GeomapWidgetDefinitionView::new("WORLD".to_string()),
107 )
108 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
109 .title("".to_string())
110 .title_align(WidgetTextAlign::LEFT)
111 .title_size("16".to_string()),
112 ),
113 ),
114 ).layout(WidgetLayout::new(30, 47, 0, 0))
115 ],
116 )
117 .description(None)
118 .notify_list(Some(vec![]))
119 .template_variables(Some(vec![]));
120 let configuration = datadog::Configuration::new();
121 let api = DashboardsAPI::with_config(configuration);
122 let resp = api.create_dashboard(body).await;
123 if let Ok(value) = resp {
124 println!("{:#?}", value);
125 } else {
126 println!("{:#?}", resp.unwrap_err());
127 }
128}
Sourcepub fn title_align(self, value: WidgetTextAlign) -> Self
pub fn title_align(self, value: WidgetTextAlign) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (line 64)
23async fn main() {
24 let body = Dashboard::new(
25 DashboardLayoutType::ORDERED,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(WidgetDefinition::GeomapWidgetDefinition(Box::new(
29 GeomapWidgetDefinition::new(
30 vec![GeomapWidgetRequest::new()
31 .columns(vec![
32 ListStreamColumn::new(
33 "@network.client.geoip.location.latitude".to_string(),
34 ListStreamColumnWidth::AUTO,
35 ),
36 ListStreamColumn::new(
37 "@network.client.geoip.location.longitude".to_string(),
38 ListStreamColumnWidth::AUTO,
39 ),
40 ListStreamColumn::new(
41 "@network.client.geoip.country.iso_code".to_string(),
42 ListStreamColumnWidth::AUTO,
43 ),
44 ListStreamColumn::new(
45 "@network.client.geoip.subdivision.name".to_string(),
46 ListStreamColumnWidth::AUTO,
47 ),
48 ListStreamColumn::new(
49 "classic".to_string(),
50 ListStreamColumnWidth::AUTO,
51 ),
52 ListStreamColumn::new("".to_string(), ListStreamColumnWidth::AUTO),
53 ])
54 .query(
55 ListStreamQuery::new(ListStreamSource::LOGS_STREAM, "".to_string())
56 .indexes(vec![]),
57 )
58 .response_format(FormulaAndFunctionResponseFormat::EVENT_LIST)],
59 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
60 GeomapWidgetDefinitionType::GEOMAP,
61 GeomapWidgetDefinitionView::new("WORLD".to_string()),
62 )
63 .title("".to_string())
64 .title_align(WidgetTextAlign::LEFT)
65 .title_size("16".to_string()),
66 )))
67 .layout(WidgetLayout::new(6, 12, 0, 0)),
68 ],
69 )
70 .description(Some("Example-Dashboard".to_string()))
71 .notify_list(Some(vec![]))
72 .reflow_type(DashboardReflowType::FIXED)
73 .tags(Some(vec![]))
74 .template_variables(Some(vec![]));
75 let configuration = datadog::Configuration::new();
76 let api = DashboardsAPI::with_config(configuration);
77 let resp = api.create_dashboard(body).await;
78 if let Ok(value) = resp {
79 println!("{:#?}", value);
80 } else {
81 println!("{:#?}", resp.unwrap_err());
82 }
83}
More examples
examples/v1_dashboards_CreateDashboard_915214113.rs (line 110)
35async fn main() {
36 let body =
37 Dashboard::new(
38 DashboardLayoutType::FREE,
39 "Example-Dashboard".to_string(),
40 vec![
41 Widget::new(
42 WidgetDefinition::GeomapWidgetDefinition(
43 Box::new(
44 GeomapWidgetDefinition::new(
45 vec![
46 GeomapWidgetRequest::new()
47 .formulas(vec![WidgetFormula::new("query1".to_string())])
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionEventQueryDefinition(
52 Box::new(
53 FormulaAndFunctionEventQueryDefinition::new(
54 FormulaAndFunctionEventQueryDefinitionCompute::new(
55 FormulaAndFunctionEventAggregation::COUNT,
56 ),
57 FormulaAndFunctionEventsDataSource::RUM,
58 "query1".to_string(),
59 )
60 .group_by(
61 vec![
62 FormulaAndFunctionEventQueryGroupBy::new(
63 "@geo.country_iso_code".to_string(),
64 )
65 .limit(250)
66 .sort(
67 FormulaAndFunctionEventQueryGroupBySort
68 ::new(
69 FormulaAndFunctionEventAggregation
70 ::COUNT,
71 ).order(QuerySortOrder::DESC),
72 )
73 ],
74 )
75 .indexes(vec!["*".to_string()])
76 .search(
77 FormulaAndFunctionEventQueryDefinitionSearch::new(
78 "".to_string(),
79 ),
80 ),
81 ),
82 )
83 ],
84 )
85 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
86 .sort(
87 WidgetSortBy::new()
88 .count(250)
89 .order_by(
90 vec![
91 WidgetSortOrderBy::WidgetFormulaSort(
92 Box::new(
93 WidgetFormulaSort::new(
94 0,
95 WidgetSort::DESCENDING,
96 FormulaType::FORMULA,
97 ),
98 ),
99 )
100 ],
101 ),
102 )
103 ],
104 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
105 GeomapWidgetDefinitionType::GEOMAP,
106 GeomapWidgetDefinitionView::new("WORLD".to_string()),
107 )
108 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
109 .title("".to_string())
110 .title_align(WidgetTextAlign::LEFT)
111 .title_size("16".to_string()),
112 ),
113 ),
114 ).layout(WidgetLayout::new(30, 47, 0, 0))
115 ],
116 )
117 .description(None)
118 .notify_list(Some(vec![]))
119 .template_variables(Some(vec![]));
120 let configuration = datadog::Configuration::new();
121 let api = DashboardsAPI::with_config(configuration);
122 let resp = api.create_dashboard(body).await;
123 if let Ok(value) = resp {
124 println!("{:#?}", value);
125 } else {
126 println!("{:#?}", resp.unwrap_err());
127 }
128}
Sourcepub fn title_size(self, value: String) -> Self
pub fn title_size(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (line 65)
23async fn main() {
24 let body = Dashboard::new(
25 DashboardLayoutType::ORDERED,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(WidgetDefinition::GeomapWidgetDefinition(Box::new(
29 GeomapWidgetDefinition::new(
30 vec![GeomapWidgetRequest::new()
31 .columns(vec![
32 ListStreamColumn::new(
33 "@network.client.geoip.location.latitude".to_string(),
34 ListStreamColumnWidth::AUTO,
35 ),
36 ListStreamColumn::new(
37 "@network.client.geoip.location.longitude".to_string(),
38 ListStreamColumnWidth::AUTO,
39 ),
40 ListStreamColumn::new(
41 "@network.client.geoip.country.iso_code".to_string(),
42 ListStreamColumnWidth::AUTO,
43 ),
44 ListStreamColumn::new(
45 "@network.client.geoip.subdivision.name".to_string(),
46 ListStreamColumnWidth::AUTO,
47 ),
48 ListStreamColumn::new(
49 "classic".to_string(),
50 ListStreamColumnWidth::AUTO,
51 ),
52 ListStreamColumn::new("".to_string(), ListStreamColumnWidth::AUTO),
53 ])
54 .query(
55 ListStreamQuery::new(ListStreamSource::LOGS_STREAM, "".to_string())
56 .indexes(vec![]),
57 )
58 .response_format(FormulaAndFunctionResponseFormat::EVENT_LIST)],
59 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
60 GeomapWidgetDefinitionType::GEOMAP,
61 GeomapWidgetDefinitionView::new("WORLD".to_string()),
62 )
63 .title("".to_string())
64 .title_align(WidgetTextAlign::LEFT)
65 .title_size("16".to_string()),
66 )))
67 .layout(WidgetLayout::new(6, 12, 0, 0)),
68 ],
69 )
70 .description(Some("Example-Dashboard".to_string()))
71 .notify_list(Some(vec![]))
72 .reflow_type(DashboardReflowType::FIXED)
73 .tags(Some(vec![]))
74 .template_variables(Some(vec![]));
75 let configuration = datadog::Configuration::new();
76 let api = DashboardsAPI::with_config(configuration);
77 let resp = api.create_dashboard(body).await;
78 if let Ok(value) = resp {
79 println!("{:#?}", value);
80 } else {
81 println!("{:#?}", resp.unwrap_err());
82 }
83}
More examples
examples/v1_dashboards_CreateDashboard_915214113.rs (line 111)
35async fn main() {
36 let body =
37 Dashboard::new(
38 DashboardLayoutType::FREE,
39 "Example-Dashboard".to_string(),
40 vec![
41 Widget::new(
42 WidgetDefinition::GeomapWidgetDefinition(
43 Box::new(
44 GeomapWidgetDefinition::new(
45 vec![
46 GeomapWidgetRequest::new()
47 .formulas(vec![WidgetFormula::new("query1".to_string())])
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionEventQueryDefinition(
52 Box::new(
53 FormulaAndFunctionEventQueryDefinition::new(
54 FormulaAndFunctionEventQueryDefinitionCompute::new(
55 FormulaAndFunctionEventAggregation::COUNT,
56 ),
57 FormulaAndFunctionEventsDataSource::RUM,
58 "query1".to_string(),
59 )
60 .group_by(
61 vec![
62 FormulaAndFunctionEventQueryGroupBy::new(
63 "@geo.country_iso_code".to_string(),
64 )
65 .limit(250)
66 .sort(
67 FormulaAndFunctionEventQueryGroupBySort
68 ::new(
69 FormulaAndFunctionEventAggregation
70 ::COUNT,
71 ).order(QuerySortOrder::DESC),
72 )
73 ],
74 )
75 .indexes(vec!["*".to_string()])
76 .search(
77 FormulaAndFunctionEventQueryDefinitionSearch::new(
78 "".to_string(),
79 ),
80 ),
81 ),
82 )
83 ],
84 )
85 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
86 .sort(
87 WidgetSortBy::new()
88 .count(250)
89 .order_by(
90 vec![
91 WidgetSortOrderBy::WidgetFormulaSort(
92 Box::new(
93 WidgetFormulaSort::new(
94 0,
95 WidgetSort::DESCENDING,
96 FormulaType::FORMULA,
97 ),
98 ),
99 )
100 ],
101 ),
102 )
103 ],
104 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
105 GeomapWidgetDefinitionType::GEOMAP,
106 GeomapWidgetDefinitionView::new("WORLD".to_string()),
107 )
108 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
109 .title("".to_string())
110 .title_align(WidgetTextAlign::LEFT)
111 .title_size("16".to_string()),
112 ),
113 ),
114 ).layout(WidgetLayout::new(30, 47, 0, 0))
115 ],
116 )
117 .description(None)
118 .notify_list(Some(vec![]))
119 .template_variables(Some(vec![]));
120 let configuration = datadog::Configuration::new();
121 let api = DashboardsAPI::with_config(configuration);
122 let resp = api.create_dashboard(body).await;
123 if let Ok(value) = resp {
124 println!("{:#?}", value);
125 } else {
126 println!("{:#?}", resp.unwrap_err());
127 }
128}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for GeomapWidgetDefinition
impl Clone for GeomapWidgetDefinition
Source§fn clone(&self) -> GeomapWidgetDefinition
fn clone(&self) -> GeomapWidgetDefinition
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 GeomapWidgetDefinition
impl Debug for GeomapWidgetDefinition
Source§impl<'de> Deserialize<'de> for GeomapWidgetDefinition
impl<'de> Deserialize<'de> for GeomapWidgetDefinition
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
Source§impl PartialEq for GeomapWidgetDefinition
impl PartialEq for GeomapWidgetDefinition
Source§impl Serialize for GeomapWidgetDefinition
impl Serialize for GeomapWidgetDefinition
impl StructuralPartialEq for GeomapWidgetDefinition
Auto Trait Implementations§
impl Freeze for GeomapWidgetDefinition
impl RefUnwindSafe for GeomapWidgetDefinition
impl Send for GeomapWidgetDefinition
impl Sync for GeomapWidgetDefinition
impl Unpin for GeomapWidgetDefinition
impl UnwindSafe for GeomapWidgetDefinition
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