#[non_exhaustive]pub struct Dashboard {Show 18 fields
pub author_handle: Option<String>,
pub author_name: Option<Option<String>>,
pub created_at: Option<DateTime<Utc>>,
pub description: Option<Option<String>>,
pub id: Option<String>,
pub is_read_only: Option<bool>,
pub layout_type: DashboardLayoutType,
pub modified_at: Option<DateTime<Utc>>,
pub notify_list: Option<Option<Vec<String>>>,
pub reflow_type: Option<DashboardReflowType>,
pub restricted_roles: Option<Vec<String>>,
pub tags: Option<Option<Vec<String>>>,
pub template_variable_presets: Option<Option<Vec<DashboardTemplateVariablePreset>>>,
pub template_variables: Option<Option<Vec<DashboardTemplateVariable>>>,
pub title: String,
pub url: Option<String>,
pub widgets: Vec<Widget>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
A dashboard is Datadog’s tool for visually tracking, analyzing, and displaying key performance metrics, which enable you to monitor the health of your infrastructure.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.Identifier of the dashboard author.
Name of the dashboard author.
created_at: Option<DateTime<Utc>>
Creation date of the dashboard.
description: Option<Option<String>>
Description of the dashboard.
id: Option<String>
ID of the dashboard.
is_read_only: Option<bool>
Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
layout_type: DashboardLayoutType
Layout type of the dashboard.
modified_at: Option<DateTime<Utc>>
Modification date of the dashboard.
notify_list: Option<Option<Vec<String>>>
List of handles of users to notify when changes are made to this dashboard.
reflow_type: Option<DashboardReflowType>
Reflow type for a new dashboard layout dashboard. Set this only when layout type is ‘ordered’. If set to ‘fixed’, the dashboard expects all widgets to have a layout, and if it’s set to ‘auto’, widgets should not have layouts.
restricted_roles: Option<Vec<String>>
A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
List of team names representing ownership of a dashboard.
template_variable_presets: Option<Option<Vec<DashboardTemplateVariablePreset>>>
Array of template variables saved views.
template_variables: Option<Option<Vec<DashboardTemplateVariable>>>
List of template variables for this dashboard.
title: String
Title of the dashboard.
url: Option<String>
The URL of the dashboard.
widgets: Vec<Widget>
List of widgets to display on the dashboard.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl Dashboard
impl Dashboard
Sourcepub fn new(
layout_type: DashboardLayoutType,
title: String,
widgets: Vec<Widget>,
) -> Dashboard
pub fn new( layout_type: DashboardLayoutType, title: String, widgets: Vec<Widget>, ) -> Dashboard
Examples found in repository?
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![Widget::new(WidgetDefinition::NoteWidgetDefinition(Box::new(
18 NoteWidgetDefinition::new("# Example Note".to_string(), NoteWidgetDefinitionType::NOTE),
19 )))
20 .layout(WidgetLayout::new(24, 18, 0, 0))],
21 )
22 .description(Some("".to_string()))
23 .notify_list(Some(vec![]))
24 .template_variables(Some(vec![]));
25 let configuration = datadog::Configuration::new();
26 let api = DashboardsAPI::with_config(configuration);
27 let resp = api.create_dashboard(body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
More examples
16async fn main() {
17 let body = Dashboard::new(
18 DashboardLayoutType::ORDERED,
19 "Example-Dashboard with funnel widget".to_string(),
20 vec![Widget::new(WidgetDefinition::FunnelWidgetDefinition(
21 Box::new(FunnelWidgetDefinition::new(
22 vec![FunnelWidgetRequest::new(
23 FunnelQuery::new(FunnelSource::RUM, "".to_string(), vec![]),
24 FunnelRequestType::FUNNEL,
25 )],
26 FunnelWidgetDefinitionType::FUNNEL,
27 )),
28 ))],
29 );
30 let configuration = datadog::Configuration::new();
31 let api = DashboardsAPI::with_config(configuration);
32 let resp = api.create_dashboard(body).await;
33 if let Ok(value) = resp {
34 println!("{:#?}", value);
35 } else {
36 println!("{:#?}", resp.unwrap_err());
37 }
38}
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![
18 Widget::new(WidgetDefinition::IFrameWidgetDefinition(Box::new(
19 IFrameWidgetDefinition::new(
20 IFrameWidgetDefinitionType::IFRAME,
21 "https://docs.datadoghq.com/api/latest/".to_string(),
22 ),
23 )))
24 .layout(WidgetLayout::new(12, 12, 0, 0)),
25 ],
26 )
27 .description(Some("".to_string()))
28 .notify_list(Some(vec![]))
29 .template_variables(Some(vec![]));
30 let configuration = datadog::Configuration::new();
31 let api = DashboardsAPI::with_config(configuration);
32 let resp = api.create_dashboard(body).await;
33 if let Ok(value) = resp {
34 println!("{:#?}", value);
35 } else {
36 println!("{:#?}", resp.unwrap_err());
37 }
38}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::ImageWidgetDefinition(Box::new(
20 ImageWidgetDefinition::new(
21 ImageWidgetDefinitionType::IMAGE,
22 "https://example.com/image.png".to_string(),
23 )
24 .sizing(WidgetImageSizing::COVER),
25 )))
26 .layout(WidgetLayout::new(12, 12, 0, 0)),
27 ],
28 )
29 .description(Some("".to_string()))
30 .notify_list(Some(vec![]))
31 .template_variables(Some(vec![]));
32 let configuration = datadog::Configuration::new();
33 let api = DashboardsAPI::with_config(configuration);
34 let resp = api.create_dashboard(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::FreeTextWidgetDefinition(Box::new(
20 FreeTextWidgetDefinition::new(
21 "Example free text".to_string(),
22 FreeTextWidgetDefinitionType::FREE_TEXT,
23 )
24 .color("#4d4d4d".to_string())
25 .font_size("auto".to_string())
26 .text_align(WidgetTextAlign::LEFT),
27 )))
28 .layout(WidgetLayout::new(6, 24, 0, 0)),
29 ],
30 )
31 .description(None)
32 .notify_list(Some(vec![]))
33 .template_variables(Some(vec![]));
34 let configuration = datadog::Configuration::new();
35 let api = DashboardsAPI::with_config(configuration);
36 let resp = api.create_dashboard(body).await;
37 if let Ok(value) = resp {
38 println!("{:#?}", value);
39 } else {
40 println!("{:#?}", resp.unwrap_err());
41 }
42}
18async fn main() {
19 let body = Dashboard::new(
20 DashboardLayoutType::ORDERED,
21 "Example-Dashboard with list_stream widget".to_string(),
22 vec![Widget::new(WidgetDefinition::ListStreamWidgetDefinition(
23 Box::new(ListStreamWidgetDefinition::new(
24 vec![ListStreamWidgetRequest::new(
25 vec![ListStreamColumn::new(
26 "timestamp".to_string(),
27 ListStreamColumnWidth::AUTO,
28 )],
29 ListStreamQuery::new(ListStreamSource::APM_ISSUE_STREAM, "".to_string()),
30 ListStreamResponseFormat::EVENT_LIST,
31 )],
32 ListStreamWidgetDefinitionType::LIST_STREAM,
33 )),
34 ))],
35 );
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}
- examples/v1_dashboards_CreateDashboard_4026341408.rs
- examples/v1_dashboards_CreateDashboard_4076476470.rs
- examples/v1_dashboards_CreateDashboard_2607944105.rs
- examples/v1_dashboards_CreateDashboard_3250131584.rs
- examples/v1_dashboards_CreateDashboard_2034634967.rs
- examples/v1_dashboards_CreateDashboard_3117424216.rs
- examples/v1_dashboards_CreateDashboard_2432046716.rs
- examples/v1_dashboards_CreateDashboard_2634813877.rs
- examples/v1_dashboards_CreateDashboard_2618036642.rs
- examples/v1_dashboards_CreateDashboard_3195475781.rs
- examples/v1_dashboards_CreateDashboard_2316374332.rs
- examples/v1_dashboards_CreateDashboard_1423904722.rs
- examples/v1_dashboards_CreateDashboard_858397694.rs
- examples/v1_dashboards_CreateDashboard_1751391372.rs
- examples/v1_dashboards_CreateDashboard_2308247857.rs
- examples/v1_dashboards_UpdateDashboard.rs
- examples/v1_dashboards_CreateDashboard_2917274132.rs
- examples/v1_dashboards_CreateDashboard_1177423752.rs
- examples/v1_dashboards_CreateDashboard_173805046.rs
- examples/v1_dashboards_CreateDashboard_1877023900.rs
- examples/v1_dashboards_CreateDashboard_2361531620.rs
- examples/v1_dashboards_CreateDashboard_1039800684.rs
- examples/v1_dashboards_UpdateDashboard_3454865944.rs
- examples/v1_dashboards_CreateDashboard_803346562.rs
- examples/v1_dashboards_CreateDashboard_1094917386.rs
- examples/v1_dashboards_CreateDashboard_2610827685.rs
- examples/v1_dashboards_CreateDashboard_2843286292.rs
- examples/v1_dashboards_CreateDashboard_109450134.rs
- examples/v1_dashboards_CreateDashboard_2652180930.rs
- examples/v1_dashboards_CreateDashboard_2029850837.rs
- examples/v1_dashboards_CreateDashboard_1200099236.rs
- examples/v1_dashboards_CreateDashboard_1754992756.rs
- examples/v1_dashboards_CreateDashboard_2921337351.rs
- examples/v1_dashboards_CreateDashboard_2850365602.rs
- examples/v1_dashboards_CreateDashboard.rs
- examples/v1_dashboards_CreateDashboard_3982498788.rs
- examples/v1_dashboards_CreateDashboard_3669695268.rs
- examples/v1_dashboards_CreateDashboard_3298564989.rs
- examples/v1_dashboards_CreateDashboard_2705593938.rs
- examples/v1_dashboards_CreateDashboard_3562282606.rs
- examples/v1_dashboards_CreateDashboard_3777304439.rs
- examples/v1_dashboards_CreateDashboard_2349863258.rs
- examples/v1_dashboards_CreateDashboard_2644712913.rs
- examples/v1_dashboards_CreateDashboard_3513586382.rs
- examples/v1_dashboards_CreateDashboard_2490110261.rs
- examples/v1_dashboards_CreateDashboard_145494973.rs
- examples/v1_dashboards_CreateDashboard_765140092.rs
- examples/v1_dashboards_CreateDashboard_1433408735.rs
- examples/v1_dashboards_CreateDashboard_798168180.rs
- examples/v1_dashboards_CreateDashboard_1284514532.rs
- examples/v1_dashboards_CreateDashboard_1024858348.rs
- examples/v1_dashboards_CreateDashboard_252716965.rs
- examples/v1_dashboards_CreateDashboard_3882428227.rs
- examples/v1_dashboards_CreateDashboard_2261785072.rs
- examples/v1_dashboards_CreateDashboard_578885732.rs
- examples/v1_dashboards_CreateDashboard_1442588603.rs
- examples/v1_dashboards_CreateDashboard_2064651578.rs
- examples/v1_dashboards_CreateDashboard_41622531.rs
- examples/v1_dashboards_CreateDashboard_2104498738.rs
- examples/v1_dashboards_CreateDashboard_2336428357.rs
- examples/v1_dashboards_CreateDashboard_1307120899.rs
- examples/v1_dashboards_CreateDashboard_985012506.rs
- examples/v1_dashboards_CreateDashboard_2800096921.rs
- examples/v1_dashboards_CreateDashboard_1413226400.rs
- examples/v1_dashboards_CreateDashboard_4262729673.rs
- examples/v1_dashboards_CreateDashboard_1213075383.rs
- examples/v1_dashboards_CreateDashboard_2563642929.rs
- examples/v1_dashboards_CreateDashboard_3520534424.rs
- examples/v1_dashboards_CreateDashboard_3451918078.rs
- examples/v1_dashboards_CreateDashboard_3066042014.rs
- examples/v1_dashboards_CreateDashboard_1490099434.rs
- examples/v1_dashboards_CreateDashboard_2278756614.rs
- examples/v1_dashboards_CreateDashboard_2342457693.rs
- examples/v1_dashboards_CreateDashboard_915214113.rs
- examples/v1_dashboards_CreateDashboard_794302680.rs
pub fn created_at(self, value: DateTime<Utc>) -> Self
Sourcepub fn description(self, value: Option<String>) -> Self
pub fn description(self, value: Option<String>) -> Self
Examples found in repository?
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![Widget::new(WidgetDefinition::NoteWidgetDefinition(Box::new(
18 NoteWidgetDefinition::new("# Example Note".to_string(), NoteWidgetDefinitionType::NOTE),
19 )))
20 .layout(WidgetLayout::new(24, 18, 0, 0))],
21 )
22 .description(Some("".to_string()))
23 .notify_list(Some(vec![]))
24 .template_variables(Some(vec![]));
25 let configuration = datadog::Configuration::new();
26 let api = DashboardsAPI::with_config(configuration);
27 let resp = api.create_dashboard(body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
More examples
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![
18 Widget::new(WidgetDefinition::IFrameWidgetDefinition(Box::new(
19 IFrameWidgetDefinition::new(
20 IFrameWidgetDefinitionType::IFRAME,
21 "https://docs.datadoghq.com/api/latest/".to_string(),
22 ),
23 )))
24 .layout(WidgetLayout::new(12, 12, 0, 0)),
25 ],
26 )
27 .description(Some("".to_string()))
28 .notify_list(Some(vec![]))
29 .template_variables(Some(vec![]));
30 let configuration = datadog::Configuration::new();
31 let api = DashboardsAPI::with_config(configuration);
32 let resp = api.create_dashboard(body).await;
33 if let Ok(value) = resp {
34 println!("{:#?}", value);
35 } else {
36 println!("{:#?}", resp.unwrap_err());
37 }
38}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::ImageWidgetDefinition(Box::new(
20 ImageWidgetDefinition::new(
21 ImageWidgetDefinitionType::IMAGE,
22 "https://example.com/image.png".to_string(),
23 )
24 .sizing(WidgetImageSizing::COVER),
25 )))
26 .layout(WidgetLayout::new(12, 12, 0, 0)),
27 ],
28 )
29 .description(Some("".to_string()))
30 .notify_list(Some(vec![]))
31 .template_variables(Some(vec![]));
32 let configuration = datadog::Configuration::new();
33 let api = DashboardsAPI::with_config(configuration);
34 let resp = api.create_dashboard(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::FreeTextWidgetDefinition(Box::new(
20 FreeTextWidgetDefinition::new(
21 "Example free text".to_string(),
22 FreeTextWidgetDefinitionType::FREE_TEXT,
23 )
24 .color("#4d4d4d".to_string())
25 .font_size("auto".to_string())
26 .text_align(WidgetTextAlign::LEFT),
27 )))
28 .layout(WidgetLayout::new(6, 24, 0, 0)),
29 ],
30 )
31 .description(None)
32 .notify_list(Some(vec![]))
33 .template_variables(Some(vec![]));
34 let configuration = datadog::Configuration::new();
35 let api = DashboardsAPI::with_config(configuration);
36 let resp = api.create_dashboard(body).await;
37 if let Ok(value) = resp {
38 println!("{:#?}", value);
39 } else {
40 println!("{:#?}", resp.unwrap_err());
41 }
42}
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}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::EventTimelineWidgetDefinition(Box::new(
20 EventTimelineWidgetDefinition::new(
21 "status:error priority:all".to_string(),
22 EventTimelineWidgetDefinitionType::EVENT_TIMELINE,
23 )
24 .tags_execution("and".to_string())
25 .title("".to_string())
26 .title_align(WidgetTextAlign::LEFT)
27 .title_size("16".to_string()),
28 )))
29 .layout(WidgetLayout::new(9, 47, 0, 0)),
30 ],
31 )
32 .description(None)
33 .notify_list(Some(vec![]))
34 .template_variables(Some(vec![]));
35 let configuration = datadog::Configuration::new();
36 let api = DashboardsAPI::with_config(configuration);
37 let resp = api.create_dashboard(body).await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
- examples/v1_dashboards_CreateDashboard_2034634967.rs
- examples/v1_dashboards_CreateDashboard_2634813877.rs
- examples/v1_dashboards_CreateDashboard_2316374332.rs
- examples/v1_dashboards_CreateDashboard_1423904722.rs
- examples/v1_dashboards_CreateDashboard_858397694.rs
- examples/v1_dashboards_CreateDashboard_1751391372.rs
- examples/v1_dashboards_CreateDashboard_2308247857.rs
- examples/v1_dashboards_UpdateDashboard.rs
- examples/v1_dashboards_CreateDashboard_2917274132.rs
- examples/v1_dashboards_CreateDashboard_1177423752.rs
- examples/v1_dashboards_CreateDashboard_173805046.rs
- examples/v1_dashboards_UpdateDashboard_3454865944.rs
- examples/v1_dashboards_CreateDashboard_1094917386.rs
- examples/v1_dashboards_CreateDashboard_2610827685.rs
- examples/v1_dashboards_CreateDashboard_109450134.rs
- examples/v1_dashboards_CreateDashboard_2652180930.rs
- examples/v1_dashboards_CreateDashboard_2029850837.rs
- examples/v1_dashboards_CreateDashboard_1200099236.rs
- examples/v1_dashboards_CreateDashboard_1754992756.rs
- examples/v1_dashboards_CreateDashboard_2921337351.rs
- examples/v1_dashboards_CreateDashboard_2850365602.rs
- examples/v1_dashboards_CreateDashboard_2349863258.rs
- examples/v1_dashboards_CreateDashboard_3513586382.rs
- examples/v1_dashboards_CreateDashboard_3882428227.rs
- examples/v1_dashboards_CreateDashboard_1442588603.rs
- examples/v1_dashboards_CreateDashboard_2336428357.rs
- examples/v1_dashboards_CreateDashboard_1413226400.rs
- examples/v1_dashboards_CreateDashboard_1213075383.rs
- examples/v1_dashboards_CreateDashboard_2563642929.rs
- examples/v1_dashboards_CreateDashboard_3520534424.rs
- examples/v1_dashboards_CreateDashboard_1490099434.rs
- examples/v1_dashboards_CreateDashboard_2278756614.rs
- examples/v1_dashboards_CreateDashboard_2342457693.rs
- examples/v1_dashboards_CreateDashboard_915214113.rs
- examples/v1_dashboards_CreateDashboard_794302680.rs
pub fn id(self, value: String) -> Self
pub fn is_read_only(self, value: bool) -> Self
pub fn modified_at(self, value: DateTime<Utc>) -> Self
Sourcepub fn notify_list(self, value: Option<Vec<String>>) -> Self
pub fn notify_list(self, value: Option<Vec<String>>) -> Self
Examples found in repository?
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![Widget::new(WidgetDefinition::NoteWidgetDefinition(Box::new(
18 NoteWidgetDefinition::new("# Example Note".to_string(), NoteWidgetDefinitionType::NOTE),
19 )))
20 .layout(WidgetLayout::new(24, 18, 0, 0))],
21 )
22 .description(Some("".to_string()))
23 .notify_list(Some(vec![]))
24 .template_variables(Some(vec![]));
25 let configuration = datadog::Configuration::new();
26 let api = DashboardsAPI::with_config(configuration);
27 let resp = api.create_dashboard(body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
More examples
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![
18 Widget::new(WidgetDefinition::IFrameWidgetDefinition(Box::new(
19 IFrameWidgetDefinition::new(
20 IFrameWidgetDefinitionType::IFRAME,
21 "https://docs.datadoghq.com/api/latest/".to_string(),
22 ),
23 )))
24 .layout(WidgetLayout::new(12, 12, 0, 0)),
25 ],
26 )
27 .description(Some("".to_string()))
28 .notify_list(Some(vec![]))
29 .template_variables(Some(vec![]));
30 let configuration = datadog::Configuration::new();
31 let api = DashboardsAPI::with_config(configuration);
32 let resp = api.create_dashboard(body).await;
33 if let Ok(value) = resp {
34 println!("{:#?}", value);
35 } else {
36 println!("{:#?}", resp.unwrap_err());
37 }
38}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::ImageWidgetDefinition(Box::new(
20 ImageWidgetDefinition::new(
21 ImageWidgetDefinitionType::IMAGE,
22 "https://example.com/image.png".to_string(),
23 )
24 .sizing(WidgetImageSizing::COVER),
25 )))
26 .layout(WidgetLayout::new(12, 12, 0, 0)),
27 ],
28 )
29 .description(Some("".to_string()))
30 .notify_list(Some(vec![]))
31 .template_variables(Some(vec![]));
32 let configuration = datadog::Configuration::new();
33 let api = DashboardsAPI::with_config(configuration);
34 let resp = api.create_dashboard(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::FreeTextWidgetDefinition(Box::new(
20 FreeTextWidgetDefinition::new(
21 "Example free text".to_string(),
22 FreeTextWidgetDefinitionType::FREE_TEXT,
23 )
24 .color("#4d4d4d".to_string())
25 .font_size("auto".to_string())
26 .text_align(WidgetTextAlign::LEFT),
27 )))
28 .layout(WidgetLayout::new(6, 24, 0, 0)),
29 ],
30 )
31 .description(None)
32 .notify_list(Some(vec![]))
33 .template_variables(Some(vec![]));
34 let configuration = datadog::Configuration::new();
35 let api = DashboardsAPI::with_config(configuration);
36 let resp = api.create_dashboard(body).await;
37 if let Ok(value) = resp {
38 println!("{:#?}", value);
39 } else {
40 println!("{:#?}", resp.unwrap_err());
41 }
42}
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}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::EventTimelineWidgetDefinition(Box::new(
20 EventTimelineWidgetDefinition::new(
21 "status:error priority:all".to_string(),
22 EventTimelineWidgetDefinitionType::EVENT_TIMELINE,
23 )
24 .tags_execution("and".to_string())
25 .title("".to_string())
26 .title_align(WidgetTextAlign::LEFT)
27 .title_size("16".to_string()),
28 )))
29 .layout(WidgetLayout::new(9, 47, 0, 0)),
30 ],
31 )
32 .description(None)
33 .notify_list(Some(vec![]))
34 .template_variables(Some(vec![]));
35 let configuration = datadog::Configuration::new();
36 let api = DashboardsAPI::with_config(configuration);
37 let resp = api.create_dashboard(body).await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
- examples/v1_dashboards_CreateDashboard_2034634967.rs
- examples/v1_dashboards_CreateDashboard_2634813877.rs
- examples/v1_dashboards_CreateDashboard_2316374332.rs
- examples/v1_dashboards_CreateDashboard_1423904722.rs
- examples/v1_dashboards_CreateDashboard_858397694.rs
- examples/v1_dashboards_CreateDashboard_1751391372.rs
- examples/v1_dashboards_CreateDashboard_2308247857.rs
- examples/v1_dashboards_CreateDashboard_2917274132.rs
- examples/v1_dashboards_CreateDashboard_1177423752.rs
- examples/v1_dashboards_CreateDashboard_173805046.rs
- examples/v1_dashboards_CreateDashboard_1094917386.rs
- examples/v1_dashboards_CreateDashboard_2610827685.rs
- examples/v1_dashboards_CreateDashboard_109450134.rs
- examples/v1_dashboards_CreateDashboard_2652180930.rs
- examples/v1_dashboards_CreateDashboard_2029850837.rs
- examples/v1_dashboards_CreateDashboard_1200099236.rs
- examples/v1_dashboards_CreateDashboard_2921337351.rs
- examples/v1_dashboards_CreateDashboard_2850365602.rs
- examples/v1_dashboards_CreateDashboard_3777304439.rs
- examples/v1_dashboards_CreateDashboard_2349863258.rs
- examples/v1_dashboards_CreateDashboard_3513586382.rs
- examples/v1_dashboards_CreateDashboard_2336428357.rs
- examples/v1_dashboards_CreateDashboard_1413226400.rs
- examples/v1_dashboards_CreateDashboard_1213075383.rs
- examples/v1_dashboards_CreateDashboard_2563642929.rs
- examples/v1_dashboards_CreateDashboard_3520534424.rs
- examples/v1_dashboards_CreateDashboard_1490099434.rs
- examples/v1_dashboards_CreateDashboard_2278756614.rs
- examples/v1_dashboards_CreateDashboard_2342457693.rs
- examples/v1_dashboards_CreateDashboard_915214113.rs
- examples/v1_dashboards_CreateDashboard_794302680.rs
Sourcepub fn reflow_type(self, value: DashboardReflowType) -> Self
pub fn reflow_type(self, value: DashboardReflowType) -> Self
Examples found in repository?
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
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}
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}
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}
28async fn main() {
29 let body =
30 Dashboard::new(
31 DashboardLayoutType::ORDERED,
32 "Example-Dashboard with formula style".to_string(),
33 vec![
34 Widget::new(
35 WidgetDefinition::TimeseriesWidgetDefinition(
36 Box::new(
37 TimeseriesWidgetDefinition::new(
38 vec![
39 TimeseriesWidgetRequest::new()
40 .display_type(WidgetDisplayType::LINE)
41 .formulas(
42 vec![
43 WidgetFormula::new(
44 "query1".to_string(),
45 ).style(
46 WidgetFormulaStyle::new()
47 .palette("classic".to_string())
48 .palette_index(4),
49 )
50 ],
51 )
52 .queries(
53 vec![
54 FormulaAndFunctionQueryDefinition
55 ::FormulaAndFunctionMetricQueryDefinition(
56 Box::new(
57 FormulaAndFunctionMetricQueryDefinition::new(
58 FormulaAndFunctionMetricDataSource::METRICS,
59 "query1".to_string(),
60 "avg:system.cpu.user{*}".to_string(),
61 ),
62 ),
63 )
64 ],
65 )
66 .response_format(FormulaAndFunctionResponseFormat::TIMESERIES)
67 .style(
68 WidgetRequestStyle::new()
69 .line_type(WidgetLineType::SOLID)
70 .line_width(WidgetLineWidth::NORMAL)
71 .palette("dog_classic".to_string()),
72 )
73 ],
74 TimeseriesWidgetDefinitionType::TIMESERIES,
75 )
76 .legend_columns(
77 vec![
78 TimeseriesWidgetLegendColumn::AVG,
79 TimeseriesWidgetLegendColumn::MIN,
80 TimeseriesWidgetLegendColumn::MAX,
81 TimeseriesWidgetLegendColumn::VALUE,
82 TimeseriesWidgetLegendColumn::SUM
83 ],
84 )
85 .legend_layout(TimeseriesWidgetLegendLayout::AUTO)
86 .show_legend(true)
87 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
88 .title("styled timeseries".to_string()),
89 ),
90 ),
91 )
92 ],
93 ).reflow_type(DashboardReflowType::AUTO);
94 let configuration = datadog::Configuration::new();
95 let api = DashboardsAPI::with_config(configuration);
96 let resp = api.create_dashboard(body).await;
97 if let Ok(value) = resp {
98 println!("{:#?}", value);
99 } else {
100 println!("{:#?}", resp.unwrap_err());
101 }
102}
30async fn main() {
31 let body =
32 Dashboard::new(
33 DashboardLayoutType::ORDERED,
34 "Example-Dashboard with ci_tests datasource".to_string(),
35 vec![
36 Widget::new(
37 WidgetDefinition::TimeseriesWidgetDefinition(
38 Box::new(
39 TimeseriesWidgetDefinition::new(
40 vec![
41 TimeseriesWidgetRequest::new()
42 .display_type(WidgetDisplayType::LINE)
43 .formulas(vec![WidgetFormula::new("query1".to_string())])
44 .queries(
45 vec![
46 FormulaAndFunctionQueryDefinition
47 ::FormulaAndFunctionEventQueryDefinition(
48 Box::new(
49 FormulaAndFunctionEventQueryDefinition::new(
50 FormulaAndFunctionEventQueryDefinitionCompute::new(
51 FormulaAndFunctionEventAggregation::COUNT,
52 ),
53 FormulaAndFunctionEventsDataSource::CI_TESTS,
54 "query1".to_string(),
55 )
56 .group_by(vec![])
57 .indexes(vec!["*".to_string()])
58 .search(
59 FormulaAndFunctionEventQueryDefinitionSearch::new(
60 "test_level:test".to_string(),
61 ),
62 ),
63 ),
64 )
65 ],
66 )
67 .response_format(FormulaAndFunctionResponseFormat::TIMESERIES)
68 .style(
69 WidgetRequestStyle::new()
70 .line_type(WidgetLineType::SOLID)
71 .line_width(WidgetLineWidth::NORMAL)
72 .palette("dog_classic".to_string()),
73 )
74 ],
75 TimeseriesWidgetDefinitionType::TIMESERIES,
76 )
77 .legend_columns(
78 vec![
79 TimeseriesWidgetLegendColumn::AVG,
80 TimeseriesWidgetLegendColumn::MIN,
81 TimeseriesWidgetLegendColumn::MAX,
82 TimeseriesWidgetLegendColumn::VALUE,
83 TimeseriesWidgetLegendColumn::SUM
84 ],
85 )
86 .legend_layout(TimeseriesWidgetLegendLayout::AUTO)
87 .show_legend(true)
88 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
89 .title("".to_string()),
90 ),
91 ),
92 )
93 ],
94 ).reflow_type(DashboardReflowType::AUTO);
95 let configuration = datadog::Configuration::new();
96 let api = DashboardsAPI::with_config(configuration);
97 let resp = api.create_dashboard(body).await;
98 if let Ok(value) = resp {
99 println!("{:#?}", value);
100 } else {
101 println!("{:#?}", resp.unwrap_err());
102 }
103}
- examples/v1_dashboards_CreateDashboard_985012506.rs
- examples/v1_dashboards_CreateDashboard_2800096921.rs
- examples/v1_dashboards_CreateDashboard_4262729673.rs
- examples/v1_dashboards_CreateDashboard_3520534424.rs
- examples/v1_dashboards_CreateDashboard_3451918078.rs
- examples/v1_dashboards_CreateDashboard_3066042014.rs
Sourcepub fn restricted_roles(self, value: Vec<String>) -> Self
pub fn restricted_roles(self, value: Vec<String>) -> Self
Examples found in repository?
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
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}
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}
Examples found in repository?
18async fn main() {
19 // there is a valid "dashboard" in the system
20 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
21 let body = Dashboard::new(
22 DashboardLayoutType::ORDERED,
23 "Example-Dashboard with list_stream widget".to_string(),
24 vec![Widget::new(WidgetDefinition::ListStreamWidgetDefinition(
25 Box::new(ListStreamWidgetDefinition::new(
26 vec![ListStreamWidgetRequest::new(
27 vec![ListStreamColumn::new(
28 "timestamp".to_string(),
29 ListStreamColumnWidth::AUTO,
30 )],
31 ListStreamQuery::new(ListStreamSource::APM_ISSUE_STREAM, "".to_string()),
32 ListStreamResponseFormat::EVENT_LIST,
33 )],
34 ListStreamWidgetDefinitionType::LIST_STREAM,
35 )),
36 ))],
37 )
38 .description(Some("Updated description".to_string()))
39 .tags(Some(vec!["team:foo".to_string(), "team:bar".to_string()]));
40 let configuration = datadog::Configuration::new();
41 let api = DashboardsAPI::with_config(configuration);
42 let resp = api.update_dashboard(dashboard_id.clone(), body).await;
43 if let Ok(value) = resp {
44 println!("{:#?}", value);
45 } else {
46 println!("{:#?}", resp.unwrap_err());
47 }
48}
More examples
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}
29async fn main() {
30 let body =
31 Dashboard::new(
32 DashboardLayoutType::ORDERED,
33 "Example-Dashboard".to_string(),
34 vec![
35 Widget::new(
36 WidgetDefinition::ChangeWidgetDefinition(
37 Box::new(
38 ChangeWidgetDefinition::new(
39 vec![
40 ChangeWidgetRequest::new()
41 .change_type(WidgetChangeType::ABSOLUTE)
42 .compare_to(WidgetCompareTo::HOUR_BEFORE)
43 .formulas(
44 vec![
45 WidgetFormula::new("hour_before(query1)".to_string()),
46 WidgetFormula::new("query1".to_string())
47 ],
48 )
49 .increase_good(true)
50 .order_by(WidgetOrderBy::CHANGE)
51 .order_dir(WidgetSort::DESCENDING)
52 .queries(
53 vec![
54 FormulaAndFunctionQueryDefinition
55 ::FormulaAndFunctionEventQueryDefinition(
56 Box::new(
57 FormulaAndFunctionEventQueryDefinition::new(
58 FormulaAndFunctionEventQueryDefinitionCompute::new(
59 FormulaAndFunctionEventAggregation::COUNT,
60 ),
61 FormulaAndFunctionEventsDataSource::LOGS,
62 "query1".to_string(),
63 )
64 .group_by(vec![])
65 .indexes(vec!["*".to_string()])
66 .search(
67 FormulaAndFunctionEventQueryDefinitionSearch::new(
68 "".to_string(),
69 ),
70 ),
71 ),
72 )
73 ],
74 )
75 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
76 ],
77 ChangeWidgetDefinitionType::CHANGE,
78 )
79 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
80 .title("".to_string())
81 .title_align(WidgetTextAlign::LEFT)
82 .title_size("16".to_string()),
83 ),
84 ),
85 ).layout(WidgetLayout::new(4, 4, 0, 0))
86 ],
87 ).tags(Some(vec!["team:foobar".to_string()]));
88 let configuration = datadog::Configuration::new();
89 let api = DashboardsAPI::with_config(configuration);
90 let resp = api.create_dashboard(body).await;
91 if let Ok(value) = resp {
92 println!("{:#?}", value);
93 } else {
94 println!("{:#?}", resp.unwrap_err());
95 }
96}
Sourcepub fn template_variable_presets(
self,
value: Option<Vec<DashboardTemplateVariablePreset>>,
) -> Self
pub fn template_variable_presets( self, value: Option<Vec<DashboardTemplateVariablePreset>>, ) -> Self
Examples found in repository?
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 template_variables(
self,
value: Option<Vec<DashboardTemplateVariable>>,
) -> Self
pub fn template_variables( self, value: Option<Vec<DashboardTemplateVariable>>, ) -> Self
Examples found in repository?
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![Widget::new(WidgetDefinition::NoteWidgetDefinition(Box::new(
18 NoteWidgetDefinition::new("# Example Note".to_string(), NoteWidgetDefinitionType::NOTE),
19 )))
20 .layout(WidgetLayout::new(24, 18, 0, 0))],
21 )
22 .description(Some("".to_string()))
23 .notify_list(Some(vec![]))
24 .template_variables(Some(vec![]));
25 let configuration = datadog::Configuration::new();
26 let api = DashboardsAPI::with_config(configuration);
27 let resp = api.create_dashboard(body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
More examples
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![
18 Widget::new(WidgetDefinition::IFrameWidgetDefinition(Box::new(
19 IFrameWidgetDefinition::new(
20 IFrameWidgetDefinitionType::IFRAME,
21 "https://docs.datadoghq.com/api/latest/".to_string(),
22 ),
23 )))
24 .layout(WidgetLayout::new(12, 12, 0, 0)),
25 ],
26 )
27 .description(Some("".to_string()))
28 .notify_list(Some(vec![]))
29 .template_variables(Some(vec![]));
30 let configuration = datadog::Configuration::new();
31 let api = DashboardsAPI::with_config(configuration);
32 let resp = api.create_dashboard(body).await;
33 if let Ok(value) = resp {
34 println!("{:#?}", value);
35 } else {
36 println!("{:#?}", resp.unwrap_err());
37 }
38}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::ImageWidgetDefinition(Box::new(
20 ImageWidgetDefinition::new(
21 ImageWidgetDefinitionType::IMAGE,
22 "https://example.com/image.png".to_string(),
23 )
24 .sizing(WidgetImageSizing::COVER),
25 )))
26 .layout(WidgetLayout::new(12, 12, 0, 0)),
27 ],
28 )
29 .description(Some("".to_string()))
30 .notify_list(Some(vec![]))
31 .template_variables(Some(vec![]));
32 let configuration = datadog::Configuration::new();
33 let api = DashboardsAPI::with_config(configuration);
34 let resp = api.create_dashboard(body).await;
35 if let Ok(value) = resp {
36 println!("{:#?}", value);
37 } else {
38 println!("{:#?}", resp.unwrap_err());
39 }
40}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::FreeTextWidgetDefinition(Box::new(
20 FreeTextWidgetDefinition::new(
21 "Example free text".to_string(),
22 FreeTextWidgetDefinitionType::FREE_TEXT,
23 )
24 .color("#4d4d4d".to_string())
25 .font_size("auto".to_string())
26 .text_align(WidgetTextAlign::LEFT),
27 )))
28 .layout(WidgetLayout::new(6, 24, 0, 0)),
29 ],
30 )
31 .description(None)
32 .notify_list(Some(vec![]))
33 .template_variables(Some(vec![]));
34 let configuration = datadog::Configuration::new();
35 let api = DashboardsAPI::with_config(configuration);
36 let resp = api.create_dashboard(body).await;
37 if let Ok(value) = resp {
38 println!("{:#?}", value);
39 } else {
40 println!("{:#?}", resp.unwrap_err());
41 }
42}
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}
14async fn main() {
15 let body = Dashboard::new(
16 DashboardLayoutType::FREE,
17 "Example-Dashboard".to_string(),
18 vec![
19 Widget::new(WidgetDefinition::EventTimelineWidgetDefinition(Box::new(
20 EventTimelineWidgetDefinition::new(
21 "status:error priority:all".to_string(),
22 EventTimelineWidgetDefinitionType::EVENT_TIMELINE,
23 )
24 .tags_execution("and".to_string())
25 .title("".to_string())
26 .title_align(WidgetTextAlign::LEFT)
27 .title_size("16".to_string()),
28 )))
29 .layout(WidgetLayout::new(9, 47, 0, 0)),
30 ],
31 )
32 .description(None)
33 .notify_list(Some(vec![]))
34 .template_variables(Some(vec![]));
35 let configuration = datadog::Configuration::new();
36 let api = DashboardsAPI::with_config(configuration);
37 let resp = api.create_dashboard(body).await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
- examples/v1_dashboards_CreateDashboard_2034634967.rs
- examples/v1_dashboards_CreateDashboard_2634813877.rs
- examples/v1_dashboards_CreateDashboard_2316374332.rs
- examples/v1_dashboards_CreateDashboard_1423904722.rs
- examples/v1_dashboards_CreateDashboard_858397694.rs
- examples/v1_dashboards_CreateDashboard_1751391372.rs
- examples/v1_dashboards_CreateDashboard_2308247857.rs
- examples/v1_dashboards_CreateDashboard_2917274132.rs
- examples/v1_dashboards_CreateDashboard_1177423752.rs
- examples/v1_dashboards_CreateDashboard_173805046.rs
- examples/v1_dashboards_CreateDashboard_1094917386.rs
- examples/v1_dashboards_CreateDashboard_2610827685.rs
- examples/v1_dashboards_CreateDashboard_109450134.rs
- examples/v1_dashboards_CreateDashboard_2652180930.rs
- examples/v1_dashboards_CreateDashboard_2029850837.rs
- examples/v1_dashboards_CreateDashboard_1200099236.rs
- examples/v1_dashboards_CreateDashboard_2921337351.rs
- examples/v1_dashboards_CreateDashboard_2850365602.rs
- examples/v1_dashboards_CreateDashboard_3777304439.rs
- examples/v1_dashboards_CreateDashboard_2349863258.rs
- examples/v1_dashboards_CreateDashboard_3513586382.rs
- examples/v1_dashboards_CreateDashboard_2336428357.rs
- examples/v1_dashboards_CreateDashboard_1413226400.rs
- examples/v1_dashboards_CreateDashboard_1213075383.rs
- examples/v1_dashboards_CreateDashboard_2563642929.rs
- examples/v1_dashboards_CreateDashboard_3520534424.rs
- examples/v1_dashboards_CreateDashboard_1490099434.rs
- examples/v1_dashboards_CreateDashboard_2278756614.rs
- examples/v1_dashboards_CreateDashboard_2342457693.rs
- examples/v1_dashboards_CreateDashboard_915214113.rs
- examples/v1_dashboards_CreateDashboard_794302680.rs