Struct HostMapRequest

Source
#[non_exhaustive]
pub struct HostMapRequest { pub apm_query: Option<LogQueryDefinition>, pub event_query: Option<LogQueryDefinition>, pub log_query: Option<LogQueryDefinition>, pub network_query: Option<LogQueryDefinition>, pub process_query: Option<ProcessQueryDefinition>, pub profile_metrics_query: Option<LogQueryDefinition>, pub q: Option<String>, pub rum_query: Option<LogQueryDefinition>, pub security_query: Option<LogQueryDefinition>, pub additional_properties: BTreeMap<String, Value>, /* private fields */ }
Expand description

Updated host 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.
§apm_query: Option<LogQueryDefinition>

The log query.

§event_query: Option<LogQueryDefinition>

The log query.

§log_query: Option<LogQueryDefinition>

The log query.

§network_query: Option<LogQueryDefinition>

The log query.

§process_query: Option<ProcessQueryDefinition>

The process query to use in the widget.

§profile_metrics_query: Option<LogQueryDefinition>

The log query.

§q: Option<String>

Query definition.

§rum_query: Option<LogQueryDefinition>

The log query.

§security_query: Option<LogQueryDefinition>

The log query.

§additional_properties: BTreeMap<String, Value>

Implementations§

Source§

impl HostMapRequest

Source

pub fn new() -> HostMapRequest

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
Hide additional 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 (line 26)
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}
Source

pub fn apm_query(self, value: LogQueryDefinition) -> Self

Source

pub fn event_query(self, value: LogQueryDefinition) -> Self

Source

pub fn log_query(self, value: LogQueryDefinition) -> Self

Source

pub fn network_query(self, value: LogQueryDefinition) -> Self

Source

pub fn process_query(self, value: ProcessQueryDefinition) -> Self

Source

pub fn profile_metrics_query(self, value: LogQueryDefinition) -> Self

Source

pub fn q(self, value: String) -> 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
Hide additional 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 (line 26)
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}
Source

pub fn rum_query(self, value: LogQueryDefinition) -> Self

Source

pub fn security_query(self, value: LogQueryDefinition) -> Self

Source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

Source§

impl Clone for HostMapRequest

Source§

fn clone(&self) -> HostMapRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HostMapRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HostMapRequest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for HostMapRequest

Source§

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 HostMapRequest

Source§

fn eq(&self, other: &HostMapRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for HostMapRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for HostMapRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,