#[non_exhaustive]pub struct GeomapWidgetRequest {
pub columns: Option<Vec<ListStreamColumn>>,
pub formulas: Option<Vec<WidgetFormula>>,
pub log_query: Option<LogQueryDefinition>,
pub q: Option<String>,
pub queries: Option<Vec<FormulaAndFunctionQueryDefinition>>,
pub query: Option<ListStreamQuery>,
pub response_format: Option<FormulaAndFunctionResponseFormat>,
pub rum_query: Option<LogQueryDefinition>,
pub security_query: Option<LogQueryDefinition>,
pub sort: Option<WidgetSortBy>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
An updated geomap widget.
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.columns: Option<Vec<ListStreamColumn>>
Widget columns.
formulas: Option<Vec<WidgetFormula>>
List of formulas that operate on queries.
log_query: Option<LogQueryDefinition>
The log query.
q: Option<String>
The widget metrics query.
queries: Option<Vec<FormulaAndFunctionQueryDefinition>>
List of queries that can be returned directly or used in formulas.
query: Option<ListStreamQuery>
Updated list stream widget.
response_format: Option<FormulaAndFunctionResponseFormat>
Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.
rum_query: Option<LogQueryDefinition>
The log query.
security_query: Option<LogQueryDefinition>
The log query.
sort: Option<WidgetSortBy>
The controls for sorting the widget.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl GeomapWidgetRequest
impl GeomapWidgetRequest
Sourcepub fn new() -> GeomapWidgetRequest
pub fn new() -> GeomapWidgetRequest
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (line 30)
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 46)
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 columns(self, value: Vec<ListStreamColumn>) -> Self
pub fn columns(self, value: Vec<ListStreamColumn>) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (lines 31-53)
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}
Sourcepub fn formulas(self, value: Vec<WidgetFormula>) -> Self
pub fn formulas(self, value: Vec<WidgetFormula>) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_915214113.rs (line 47)
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 log_query(self, value: LogQueryDefinition) -> Self
pub fn q(self, value: String) -> Self
Sourcepub fn queries(self, value: Vec<FormulaAndFunctionQueryDefinition>) -> Self
pub fn queries(self, value: Vec<FormulaAndFunctionQueryDefinition>) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_915214113.rs (lines 48-84)
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 query(self, value: ListStreamQuery) -> Self
pub fn query(self, value: ListStreamQuery) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (lines 54-57)
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}
Sourcepub fn response_format(self, value: FormulaAndFunctionResponseFormat) -> Self
pub fn response_format(self, value: FormulaAndFunctionResponseFormat) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (line 58)
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 85)
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 rum_query(self, value: LogQueryDefinition) -> Self
pub fn security_query(self, value: LogQueryDefinition) -> Self
Sourcepub fn sort(self, value: WidgetSortBy) -> Self
pub fn sort(self, value: WidgetSortBy) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_915214113.rs (lines 86-102)
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 GeomapWidgetRequest
impl Clone for GeomapWidgetRequest
Source§fn clone(&self) -> GeomapWidgetRequest
fn clone(&self) -> GeomapWidgetRequest
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 GeomapWidgetRequest
impl Debug for GeomapWidgetRequest
Source§impl Default for GeomapWidgetRequest
impl Default for GeomapWidgetRequest
Source§impl<'de> Deserialize<'de> for GeomapWidgetRequest
impl<'de> Deserialize<'de> for GeomapWidgetRequest
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 GeomapWidgetRequest
impl PartialEq for GeomapWidgetRequest
Source§impl Serialize for GeomapWidgetRequest
impl Serialize for GeomapWidgetRequest
impl StructuralPartialEq for GeomapWidgetRequest
Auto Trait Implementations§
impl Freeze for GeomapWidgetRequest
impl RefUnwindSafe for GeomapWidgetRequest
impl Send for GeomapWidgetRequest
impl Sync for GeomapWidgetRequest
impl Unpin for GeomapWidgetRequest
impl UnwindSafe for GeomapWidgetRequest
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