#[non_exhaustive]pub struct AlertGraphWidgetDefinition {
pub alert_id: String,
pub time: Option<WidgetTime>,
pub title: Option<String>,
pub title_align: Option<WidgetTextAlign>,
pub title_size: Option<String>,
pub type_: AlertGraphWidgetDefinitionType,
pub viz_type: WidgetVizType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Alert graphs are timeseries graphs showing the current status of any monitor defined on your system.
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.alert_id: String
ID of the alert to use in the widget.
time: Option<WidgetTime>
Time setting for the widget.
title: Option<String>
The title of the widget.
title_align: Option<WidgetTextAlign>
How to align the text on the widget.
title_size: Option<String>
Size of the title.
type_: AlertGraphWidgetDefinitionType
Type of the alert graph widget.
viz_type: WidgetVizType
Whether to display the Alert Graph as a timeseries or a top list.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl AlertGraphWidgetDefinition
impl AlertGraphWidgetDefinition
Sourcepub fn new(
alert_id: String,
type_: AlertGraphWidgetDefinitionType,
viz_type: WidgetVizType,
) -> AlertGraphWidgetDefinition
pub fn new( alert_id: String, type_: AlertGraphWidgetDefinitionType, viz_type: WidgetVizType, ) -> AlertGraphWidgetDefinition
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2308247857.rs (lines 24-28)
17async fn main() {
18 // there is a valid "monitor" in the system
19 let body = Dashboard::new(
20 DashboardLayoutType::FREE,
21 "Example-Dashboard".to_string(),
22 vec![
23 Widget::new(WidgetDefinition::AlertGraphWidgetDefinition(Box::new(
24 AlertGraphWidgetDefinition::new(
25 "7".to_string(),
26 AlertGraphWidgetDefinitionType::ALERT_GRAPH,
27 WidgetVizType::TIMESERIES,
28 )
29 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(
30 WidgetLegacyLiveSpan::new(),
31 )))
32 .title("".to_string())
33 .title_align(WidgetTextAlign::LEFT)
34 .title_size("16".to_string()),
35 )))
36 .layout(WidgetLayout::new(15, 47, 0, 0)),
37 ],
38 )
39 .description(Some("".to_string()))
40 .notify_list(Some(vec![]))
41 .template_variables(Some(vec![]));
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}
Sourcepub fn time(self, value: WidgetTime) -> Self
pub fn time(self, value: WidgetTime) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2308247857.rs (lines 29-31)
17async fn main() {
18 // there is a valid "monitor" in the system
19 let body = Dashboard::new(
20 DashboardLayoutType::FREE,
21 "Example-Dashboard".to_string(),
22 vec![
23 Widget::new(WidgetDefinition::AlertGraphWidgetDefinition(Box::new(
24 AlertGraphWidgetDefinition::new(
25 "7".to_string(),
26 AlertGraphWidgetDefinitionType::ALERT_GRAPH,
27 WidgetVizType::TIMESERIES,
28 )
29 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(
30 WidgetLegacyLiveSpan::new(),
31 )))
32 .title("".to_string())
33 .title_align(WidgetTextAlign::LEFT)
34 .title_size("16".to_string()),
35 )))
36 .layout(WidgetLayout::new(15, 47, 0, 0)),
37 ],
38 )
39 .description(Some("".to_string()))
40 .notify_list(Some(vec![]))
41 .template_variables(Some(vec![]));
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}
Sourcepub fn title(self, value: String) -> Self
pub fn title(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2308247857.rs (line 32)
17async fn main() {
18 // there is a valid "monitor" in the system
19 let body = Dashboard::new(
20 DashboardLayoutType::FREE,
21 "Example-Dashboard".to_string(),
22 vec![
23 Widget::new(WidgetDefinition::AlertGraphWidgetDefinition(Box::new(
24 AlertGraphWidgetDefinition::new(
25 "7".to_string(),
26 AlertGraphWidgetDefinitionType::ALERT_GRAPH,
27 WidgetVizType::TIMESERIES,
28 )
29 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(
30 WidgetLegacyLiveSpan::new(),
31 )))
32 .title("".to_string())
33 .title_align(WidgetTextAlign::LEFT)
34 .title_size("16".to_string()),
35 )))
36 .layout(WidgetLayout::new(15, 47, 0, 0)),
37 ],
38 )
39 .description(Some("".to_string()))
40 .notify_list(Some(vec![]))
41 .template_variables(Some(vec![]));
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}
Sourcepub fn title_align(self, value: WidgetTextAlign) -> Self
pub fn title_align(self, value: WidgetTextAlign) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2308247857.rs (line 33)
17async fn main() {
18 // there is a valid "monitor" in the system
19 let body = Dashboard::new(
20 DashboardLayoutType::FREE,
21 "Example-Dashboard".to_string(),
22 vec![
23 Widget::new(WidgetDefinition::AlertGraphWidgetDefinition(Box::new(
24 AlertGraphWidgetDefinition::new(
25 "7".to_string(),
26 AlertGraphWidgetDefinitionType::ALERT_GRAPH,
27 WidgetVizType::TIMESERIES,
28 )
29 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(
30 WidgetLegacyLiveSpan::new(),
31 )))
32 .title("".to_string())
33 .title_align(WidgetTextAlign::LEFT)
34 .title_size("16".to_string()),
35 )))
36 .layout(WidgetLayout::new(15, 47, 0, 0)),
37 ],
38 )
39 .description(Some("".to_string()))
40 .notify_list(Some(vec![]))
41 .template_variables(Some(vec![]));
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}
Sourcepub fn title_size(self, value: String) -> Self
pub fn title_size(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2308247857.rs (line 34)
17async fn main() {
18 // there is a valid "monitor" in the system
19 let body = Dashboard::new(
20 DashboardLayoutType::FREE,
21 "Example-Dashboard".to_string(),
22 vec![
23 Widget::new(WidgetDefinition::AlertGraphWidgetDefinition(Box::new(
24 AlertGraphWidgetDefinition::new(
25 "7".to_string(),
26 AlertGraphWidgetDefinitionType::ALERT_GRAPH,
27 WidgetVizType::TIMESERIES,
28 )
29 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(
30 WidgetLegacyLiveSpan::new(),
31 )))
32 .title("".to_string())
33 .title_align(WidgetTextAlign::LEFT)
34 .title_size("16".to_string()),
35 )))
36 .layout(WidgetLayout::new(15, 47, 0, 0)),
37 ],
38 )
39 .description(Some("".to_string()))
40 .notify_list(Some(vec![]))
41 .template_variables(Some(vec![]));
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}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for AlertGraphWidgetDefinition
impl Clone for AlertGraphWidgetDefinition
Source§fn clone(&self) -> AlertGraphWidgetDefinition
fn clone(&self) -> AlertGraphWidgetDefinition
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 AlertGraphWidgetDefinition
impl Debug for AlertGraphWidgetDefinition
Source§impl<'de> Deserialize<'de> for AlertGraphWidgetDefinition
impl<'de> Deserialize<'de> for AlertGraphWidgetDefinition
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 AlertGraphWidgetDefinition
Auto Trait Implementations§
impl Freeze for AlertGraphWidgetDefinition
impl RefUnwindSafe for AlertGraphWidgetDefinition
impl Send for AlertGraphWidgetDefinition
impl Sync for AlertGraphWidgetDefinition
impl Unpin for AlertGraphWidgetDefinition
impl UnwindSafe for AlertGraphWidgetDefinition
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