#[non_exhaustive]pub struct CheckStatusWidgetDefinition {
pub check: String,
pub group: Option<String>,
pub group_by: Option<Vec<String>>,
pub grouping: WidgetGrouping,
pub tags: Option<Vec<String>>,
pub time: Option<WidgetTime>,
pub title: Option<String>,
pub title_align: Option<WidgetTextAlign>,
pub title_size: Option<String>,
pub type_: CheckStatusWidgetDefinitionType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Check status shows the current status or number of results for any check performed.
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.check: String
Name of the check to use in the widget.
group: Option<String>
Group reporting a single check.
group_by: Option<Vec<String>>
List of tag prefixes to group by in the case of a cluster check.
grouping: WidgetGrouping
The kind of grouping to use.
List of tags used to filter the groups reporting a cluster check.
time: Option<WidgetTime>
Time setting for the widget.
title: Option<String>
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_: CheckStatusWidgetDefinitionType
Type of the check status widget.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl CheckStatusWidgetDefinition
impl CheckStatusWidgetDefinition
Sourcepub fn new(
check: String,
grouping: WidgetGrouping,
type_: CheckStatusWidgetDefinitionType,
) -> CheckStatusWidgetDefinition
pub fn new( check: String, grouping: WidgetGrouping, type_: CheckStatusWidgetDefinitionType, ) -> CheckStatusWidgetDefinition
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2607944105.rs (lines 21-25)
15async fn main() {
16 let body = Dashboard::new(
17 DashboardLayoutType::FREE,
18 "Example-Dashboard".to_string(),
19 vec![
20 Widget::new(WidgetDefinition::CheckStatusWidgetDefinition(Box::new(
21 CheckStatusWidgetDefinition::new(
22 "datadog.agent.up".to_string(),
23 WidgetGrouping::CHECK,
24 CheckStatusWidgetDefinitionType::CHECK_STATUS,
25 )
26 .tags(vec!["*".to_string()])
27 .title_align(WidgetTextAlign::LEFT)
28 .title_size("16".to_string()),
29 )))
30 .layout(WidgetLayout::new(8, 15, 0, 0)),
31 ],
32 )
33 .description(Some("".to_string()))
34 .notify_list(Some(vec![]))
35 .template_variables(Some(vec![]));
36 let configuration = datadog::Configuration::new();
37 let api = DashboardsAPI::with_config(configuration);
38 let resp = api.create_dashboard(body).await;
39 if let Ok(value) = resp {
40 println!("{:#?}", value);
41 } else {
42 println!("{:#?}", resp.unwrap_err());
43 }
44}
pub fn group(self, value: String) -> Self
pub fn group_by(self, value: Vec<String>) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2607944105.rs (line 26)
15async fn main() {
16 let body = Dashboard::new(
17 DashboardLayoutType::FREE,
18 "Example-Dashboard".to_string(),
19 vec![
20 Widget::new(WidgetDefinition::CheckStatusWidgetDefinition(Box::new(
21 CheckStatusWidgetDefinition::new(
22 "datadog.agent.up".to_string(),
23 WidgetGrouping::CHECK,
24 CheckStatusWidgetDefinitionType::CHECK_STATUS,
25 )
26 .tags(vec!["*".to_string()])
27 .title_align(WidgetTextAlign::LEFT)
28 .title_size("16".to_string()),
29 )))
30 .layout(WidgetLayout::new(8, 15, 0, 0)),
31 ],
32 )
33 .description(Some("".to_string()))
34 .notify_list(Some(vec![]))
35 .template_variables(Some(vec![]));
36 let configuration = datadog::Configuration::new();
37 let api = DashboardsAPI::with_config(configuration);
38 let resp = api.create_dashboard(body).await;
39 if let Ok(value) = resp {
40 println!("{:#?}", value);
41 } else {
42 println!("{:#?}", resp.unwrap_err());
43 }
44}
pub fn time(self, value: WidgetTime) -> Self
pub fn title(self, value: String) -> Self
Sourcepub fn title_align(self, value: WidgetTextAlign) -> Self
pub fn title_align(self, value: WidgetTextAlign) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2607944105.rs (line 27)
15async fn main() {
16 let body = Dashboard::new(
17 DashboardLayoutType::FREE,
18 "Example-Dashboard".to_string(),
19 vec![
20 Widget::new(WidgetDefinition::CheckStatusWidgetDefinition(Box::new(
21 CheckStatusWidgetDefinition::new(
22 "datadog.agent.up".to_string(),
23 WidgetGrouping::CHECK,
24 CheckStatusWidgetDefinitionType::CHECK_STATUS,
25 )
26 .tags(vec!["*".to_string()])
27 .title_align(WidgetTextAlign::LEFT)
28 .title_size("16".to_string()),
29 )))
30 .layout(WidgetLayout::new(8, 15, 0, 0)),
31 ],
32 )
33 .description(Some("".to_string()))
34 .notify_list(Some(vec![]))
35 .template_variables(Some(vec![]));
36 let configuration = datadog::Configuration::new();
37 let api = DashboardsAPI::with_config(configuration);
38 let resp = api.create_dashboard(body).await;
39 if let Ok(value) = resp {
40 println!("{:#?}", value);
41 } else {
42 println!("{:#?}", resp.unwrap_err());
43 }
44}
Sourcepub fn title_size(self, value: String) -> Self
pub fn title_size(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2607944105.rs (line 28)
15async fn main() {
16 let body = Dashboard::new(
17 DashboardLayoutType::FREE,
18 "Example-Dashboard".to_string(),
19 vec![
20 Widget::new(WidgetDefinition::CheckStatusWidgetDefinition(Box::new(
21 CheckStatusWidgetDefinition::new(
22 "datadog.agent.up".to_string(),
23 WidgetGrouping::CHECK,
24 CheckStatusWidgetDefinitionType::CHECK_STATUS,
25 )
26 .tags(vec!["*".to_string()])
27 .title_align(WidgetTextAlign::LEFT)
28 .title_size("16".to_string()),
29 )))
30 .layout(WidgetLayout::new(8, 15, 0, 0)),
31 ],
32 )
33 .description(Some("".to_string()))
34 .notify_list(Some(vec![]))
35 .template_variables(Some(vec![]));
36 let configuration = datadog::Configuration::new();
37 let api = DashboardsAPI::with_config(configuration);
38 let resp = api.create_dashboard(body).await;
39 if let Ok(value) = resp {
40 println!("{:#?}", value);
41 } else {
42 println!("{:#?}", resp.unwrap_err());
43 }
44}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for CheckStatusWidgetDefinition
impl Clone for CheckStatusWidgetDefinition
Source§fn clone(&self) -> CheckStatusWidgetDefinition
fn clone(&self) -> CheckStatusWidgetDefinition
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 CheckStatusWidgetDefinition
impl Debug for CheckStatusWidgetDefinition
Source§impl<'de> Deserialize<'de> for CheckStatusWidgetDefinition
impl<'de> Deserialize<'de> for CheckStatusWidgetDefinition
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 CheckStatusWidgetDefinition
Auto Trait Implementations§
impl Freeze for CheckStatusWidgetDefinition
impl RefUnwindSafe for CheckStatusWidgetDefinition
impl Send for CheckStatusWidgetDefinition
impl Sync for CheckStatusWidgetDefinition
impl Unpin for CheckStatusWidgetDefinition
impl UnwindSafe for CheckStatusWidgetDefinition
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