#[non_exhaustive]pub struct HostMapWidgetDefinitionRequests {
pub fill: Option<HostMapRequest>,
pub size: Option<HostMapRequest>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
List of definitions.
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.fill: Option<HostMapRequest>
Updated host map.
size: Option<HostMapRequest>
Updated host map.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl HostMapWidgetDefinitionRequests
impl HostMapWidgetDefinitionRequests
Sourcepub fn new() -> HostMapWidgetDefinitionRequests
pub fn new() -> HostMapWidgetDefinitionRequests
Examples found in repository?
examples/v1_dashboards_CreateDashboard_858397694.rs (line 22)
16async fn main() {
17 let body = Dashboard::new(
18 DashboardLayoutType::ORDERED,
19 "".to_string(),
20 vec![Widget::new(WidgetDefinition::HostMapWidgetDefinition(
21 Box::new(HostMapWidgetDefinition::new(
22 HostMapWidgetDefinitionRequests::new()
23 .fill(HostMapRequest::new().q("avg:system.cpu.user{*}".to_string())),
24 HostMapWidgetDefinitionType::HOSTMAP,
25 )),
26 ))],
27 )
28 .description(None)
29 .notify_list(Some(vec![]))
30 .reflow_type(DashboardReflowType::AUTO)
31 .restricted_roles(vec![])
32 .template_variables(Some(vec![DashboardTemplateVariable::new(
33 "host1".to_string(),
34 )
35 .available_values(Some(vec![
36 "my-host".to_string(),
37 "host1".to_string(),
38 "host2".to_string(),
39 ]))
40 .defaults(vec!["my-host".to_string()])
41 .prefix(Some("host".to_string()))]));
42 let configuration = datadog::Configuration::new();
43 let api = DashboardsAPI::with_config(configuration);
44 let resp = api.create_dashboard(body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
More examples
examples/v1_dashboards_CreateDashboard_1751391372.rs (line 22)
16async fn main() {
17 let body = Dashboard::new(
18 DashboardLayoutType::ORDERED,
19 "".to_string(),
20 vec![Widget::new(WidgetDefinition::HostMapWidgetDefinition(
21 Box::new(HostMapWidgetDefinition::new(
22 HostMapWidgetDefinitionRequests::new()
23 .fill(HostMapRequest::new().q("avg:system.cpu.user{*}".to_string())),
24 HostMapWidgetDefinitionType::HOSTMAP,
25 )),
26 ))],
27 )
28 .description(None)
29 .notify_list(Some(vec![]))
30 .reflow_type(DashboardReflowType::AUTO)
31 .restricted_roles(vec![])
32 .template_variables(Some(vec![DashboardTemplateVariable::new(
33 "group_by_var".to_string(),
34 )
35 .available_values(Some(vec![
36 "service".to_string(),
37 "datacenter".to_string(),
38 "env".to_string(),
39 ]))
40 .defaults(vec!["service".to_string(), "datacenter".to_string()])
41 .type_(Some("group".to_string()))]));
42 let configuration = datadog::Configuration::new();
43 let api = DashboardsAPI::with_config(configuration);
44 let resp = api.create_dashboard(body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
examples/v1_dashboards_CreateDashboard_1200099236.rs (line 25)
18async fn main() {
19 let body = Dashboard::new(
20 DashboardLayoutType::FREE,
21 "Example-Dashboard".to_string(),
22 vec![
23 Widget::new(WidgetDefinition::HostMapWidgetDefinition(Box::new(
24 HostMapWidgetDefinition::new(
25 HostMapWidgetDefinitionRequests::new().fill(
26 HostMapRequest::new().q("avg:system.cpu.user{*} by {host}".to_string()),
27 ),
28 HostMapWidgetDefinitionType::HOSTMAP,
29 )
30 .no_group_hosts(true)
31 .no_metric_hosts(true)
32 .node_type(WidgetNodeType::HOST)
33 .style(
34 HostMapWidgetDefinitionStyle::new()
35 .palette("green_to_orange".to_string())
36 .palette_flip(false),
37 )
38 .title("".to_string())
39 .title_align(WidgetTextAlign::LEFT)
40 .title_size("16".to_string()),
41 )))
42 .layout(WidgetLayout::new(22, 47, 0, 0)),
43 ],
44 )
45 .description(None)
46 .notify_list(Some(vec![]))
47 .template_variables(Some(vec![]));
48 let configuration = datadog::Configuration::new();
49 let api = DashboardsAPI::with_config(configuration);
50 let resp = api.create_dashboard(body).await;
51 if let Ok(value) = resp {
52 println!("{:#?}", value);
53 } else {
54 println!("{:#?}", resp.unwrap_err());
55 }
56}
examples/v1_dashboards_CreateDashboard_2850365602.rs (line 25)
19async fn main() {
20 let body = Dashboard::new(
21 DashboardLayoutType::ORDERED,
22 "".to_string(),
23 vec![Widget::new(WidgetDefinition::HostMapWidgetDefinition(
24 Box::new(HostMapWidgetDefinition::new(
25 HostMapWidgetDefinitionRequests::new()
26 .fill(HostMapRequest::new().q("avg:system.cpu.user{*}".to_string())),
27 HostMapWidgetDefinitionType::HOSTMAP,
28 )),
29 ))],
30 )
31 .description(None)
32 .notify_list(Some(vec![]))
33 .reflow_type(DashboardReflowType::AUTO)
34 .restricted_roles(vec![])
35 .template_variable_presets(Some(vec![DashboardTemplateVariablePreset::new()
36 .name("my saved view".to_string())
37 .template_variables(vec![DashboardTemplateVariablePresetValue::new()
38 .name("datacenter".to_string())
39 .values(vec!["*".to_string(), "my-host".to_string()])])]))
40 .template_variables(Some(vec![DashboardTemplateVariable::new(
41 "host1".to_string(),
42 )
43 .available_values(Some(vec![
44 "my-host".to_string(),
45 "host1".to_string(),
46 "host2".to_string(),
47 ]))
48 .defaults(vec!["my-host".to_string()])
49 .prefix(Some("host".to_string()))]));
50 let configuration = datadog::Configuration::new();
51 let api = DashboardsAPI::with_config(configuration);
52 let resp = api.create_dashboard(body).await;
53 if let Ok(value) = resp {
54 println!("{:#?}", value);
55 } else {
56 println!("{:#?}", resp.unwrap_err());
57 }
58}
Sourcepub fn fill(self, value: HostMapRequest) -> Self
pub fn fill(self, value: HostMapRequest) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_858397694.rs (line 23)
16async fn main() {
17 let body = Dashboard::new(
18 DashboardLayoutType::ORDERED,
19 "".to_string(),
20 vec![Widget::new(WidgetDefinition::HostMapWidgetDefinition(
21 Box::new(HostMapWidgetDefinition::new(
22 HostMapWidgetDefinitionRequests::new()
23 .fill(HostMapRequest::new().q("avg:system.cpu.user{*}".to_string())),
24 HostMapWidgetDefinitionType::HOSTMAP,
25 )),
26 ))],
27 )
28 .description(None)
29 .notify_list(Some(vec![]))
30 .reflow_type(DashboardReflowType::AUTO)
31 .restricted_roles(vec![])
32 .template_variables(Some(vec![DashboardTemplateVariable::new(
33 "host1".to_string(),
34 )
35 .available_values(Some(vec![
36 "my-host".to_string(),
37 "host1".to_string(),
38 "host2".to_string(),
39 ]))
40 .defaults(vec!["my-host".to_string()])
41 .prefix(Some("host".to_string()))]));
42 let configuration = datadog::Configuration::new();
43 let api = DashboardsAPI::with_config(configuration);
44 let resp = api.create_dashboard(body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
More examples
examples/v1_dashboards_CreateDashboard_1751391372.rs (line 23)
16async fn main() {
17 let body = Dashboard::new(
18 DashboardLayoutType::ORDERED,
19 "".to_string(),
20 vec![Widget::new(WidgetDefinition::HostMapWidgetDefinition(
21 Box::new(HostMapWidgetDefinition::new(
22 HostMapWidgetDefinitionRequests::new()
23 .fill(HostMapRequest::new().q("avg:system.cpu.user{*}".to_string())),
24 HostMapWidgetDefinitionType::HOSTMAP,
25 )),
26 ))],
27 )
28 .description(None)
29 .notify_list(Some(vec![]))
30 .reflow_type(DashboardReflowType::AUTO)
31 .restricted_roles(vec![])
32 .template_variables(Some(vec![DashboardTemplateVariable::new(
33 "group_by_var".to_string(),
34 )
35 .available_values(Some(vec![
36 "service".to_string(),
37 "datacenter".to_string(),
38 "env".to_string(),
39 ]))
40 .defaults(vec!["service".to_string(), "datacenter".to_string()])
41 .type_(Some("group".to_string()))]));
42 let configuration = datadog::Configuration::new();
43 let api = DashboardsAPI::with_config(configuration);
44 let resp = api.create_dashboard(body).await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
examples/v1_dashboards_CreateDashboard_1200099236.rs (lines 25-27)
18async fn main() {
19 let body = Dashboard::new(
20 DashboardLayoutType::FREE,
21 "Example-Dashboard".to_string(),
22 vec![
23 Widget::new(WidgetDefinition::HostMapWidgetDefinition(Box::new(
24 HostMapWidgetDefinition::new(
25 HostMapWidgetDefinitionRequests::new().fill(
26 HostMapRequest::new().q("avg:system.cpu.user{*} by {host}".to_string()),
27 ),
28 HostMapWidgetDefinitionType::HOSTMAP,
29 )
30 .no_group_hosts(true)
31 .no_metric_hosts(true)
32 .node_type(WidgetNodeType::HOST)
33 .style(
34 HostMapWidgetDefinitionStyle::new()
35 .palette("green_to_orange".to_string())
36 .palette_flip(false),
37 )
38 .title("".to_string())
39 .title_align(WidgetTextAlign::LEFT)
40 .title_size("16".to_string()),
41 )))
42 .layout(WidgetLayout::new(22, 47, 0, 0)),
43 ],
44 )
45 .description(None)
46 .notify_list(Some(vec![]))
47 .template_variables(Some(vec![]));
48 let configuration = datadog::Configuration::new();
49 let api = DashboardsAPI::with_config(configuration);
50 let resp = api.create_dashboard(body).await;
51 if let Ok(value) = resp {
52 println!("{:#?}", value);
53 } else {
54 println!("{:#?}", resp.unwrap_err());
55 }
56}
examples/v1_dashboards_CreateDashboard_2850365602.rs (line 26)
19async fn main() {
20 let body = Dashboard::new(
21 DashboardLayoutType::ORDERED,
22 "".to_string(),
23 vec![Widget::new(WidgetDefinition::HostMapWidgetDefinition(
24 Box::new(HostMapWidgetDefinition::new(
25 HostMapWidgetDefinitionRequests::new()
26 .fill(HostMapRequest::new().q("avg:system.cpu.user{*}".to_string())),
27 HostMapWidgetDefinitionType::HOSTMAP,
28 )),
29 ))],
30 )
31 .description(None)
32 .notify_list(Some(vec![]))
33 .reflow_type(DashboardReflowType::AUTO)
34 .restricted_roles(vec![])
35 .template_variable_presets(Some(vec![DashboardTemplateVariablePreset::new()
36 .name("my saved view".to_string())
37 .template_variables(vec![DashboardTemplateVariablePresetValue::new()
38 .name("datacenter".to_string())
39 .values(vec!["*".to_string(), "my-host".to_string()])])]))
40 .template_variables(Some(vec![DashboardTemplateVariable::new(
41 "host1".to_string(),
42 )
43 .available_values(Some(vec![
44 "my-host".to_string(),
45 "host1".to_string(),
46 "host2".to_string(),
47 ]))
48 .defaults(vec!["my-host".to_string()])
49 .prefix(Some("host".to_string()))]));
50 let configuration = datadog::Configuration::new();
51 let api = DashboardsAPI::with_config(configuration);
52 let resp = api.create_dashboard(body).await;
53 if let Ok(value) = resp {
54 println!("{:#?}", value);
55 } else {
56 println!("{:#?}", resp.unwrap_err());
57 }
58}
pub fn size(self, value: HostMapRequest) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for HostMapWidgetDefinitionRequests
impl Clone for HostMapWidgetDefinitionRequests
Source§fn clone(&self) -> HostMapWidgetDefinitionRequests
fn clone(&self) -> HostMapWidgetDefinitionRequests
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<'de> Deserialize<'de> for HostMapWidgetDefinitionRequests
impl<'de> Deserialize<'de> for HostMapWidgetDefinitionRequests
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 HostMapWidgetDefinitionRequests
impl PartialEq for HostMapWidgetDefinitionRequests
Source§fn eq(&self, other: &HostMapWidgetDefinitionRequests) -> bool
fn eq(&self, other: &HostMapWidgetDefinitionRequests) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for HostMapWidgetDefinitionRequests
Auto Trait Implementations§
impl Freeze for HostMapWidgetDefinitionRequests
impl RefUnwindSafe for HostMapWidgetDefinitionRequests
impl Send for HostMapWidgetDefinitionRequests
impl Sync for HostMapWidgetDefinitionRequests
impl Unpin for HostMapWidgetDefinitionRequests
impl UnwindSafe for HostMapWidgetDefinitionRequests
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