pub struct DashboardsAPI { /* private fields */ }
Expand description
Manage all your dashboards, as well as access to your shared dashboards, through the API. See the Dashboards page for more information.
Implementations§
Source§impl DashboardsAPI
impl DashboardsAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = DashboardsAPI::with_config(configuration);
10 let resp = api
11 .list_dashboards(ListDashboardsOptionalParams::default().filter_shared(false))
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = DashboardsAPI::with_config(configuration);
10 let resp = api
11 .list_dashboards(ListDashboardsOptionalParams::default().filter_deleted(true))
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
6async fn main() {
7 // there is a valid "dashboard" in the system
8 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = DashboardsAPI::with_config(configuration);
11 let resp = api.get_dashboard(dashboard_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
6async fn main() {
7 // there is a valid "dashboard" in the system
8 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = DashboardsAPI::with_config(configuration);
11 let resp = api.get_dashboard(dashboard_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
6async fn main() {
7 // there is a valid "dashboard" in the system
8 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = DashboardsAPI::with_config(configuration);
11 let resp = api.delete_dashboard(dashboard_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
- examples/v1_dashboards_ListDashboards_1062671515.rs
- examples/v1_dashboards_GetPublicDashboard.rs
- examples/v1_dashboards_RestoreDashboards.rs
- examples/v1_dashboards_DeleteDashboards.rs
- examples/v1_dashboards_GetPublicDashboardInvitations.rs
- examples/v1_dashboards_CreatePublicDashboard.rs
- examples/v1_dashboards_DeletePublicDashboardInvitation.rs
- examples/v1_dashboards_CreateDashboard_417992286.rs
- examples/v1_dashboards_UpdatePublicDashboard.rs
- examples/v1_dashboards_CreateDashboard_927141680.rs
- examples/v1_dashboards_CreateDashboard_913313564.rs
- examples/v1_dashboards_SendPublicDashboardInvitation.rs
- examples/v1_dashboards_CreateDashboard_651038379.rs
- examples/v1_dashboards_CreateDashboard_1738608750.rs
- examples/v1_dashboards_CreateDashboard_2338918735.rs
- examples/v1_dashboards_CreateDashboard_4026341408.rs
- examples/v1_dashboards_CreateDashboard_4076476470.rs
- examples/v1_dashboards_CreatePublicDashboard_1668947073.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_UpdatePublicDashboard_1708268778.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 with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_dashboard(
&self,
body: Dashboard,
) -> Result<Dashboard, Error<CreateDashboardError>>
pub async fn create_dashboard( &self, body: Dashboard, ) -> Result<Dashboard, Error<CreateDashboardError>>
Create a dashboard using the specified options. When defining queries in your widgets, take note of which queries should have the as_count()
or as_rate()
modifiers appended.
Refer to the following documentation for more information on these modifiers.
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_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_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
Sourcepub async fn create_dashboard_with_http_info(
&self,
body: Dashboard,
) -> Result<ResponseContent<Dashboard>, Error<CreateDashboardError>>
pub async fn create_dashboard_with_http_info( &self, body: Dashboard, ) -> Result<ResponseContent<Dashboard>, Error<CreateDashboardError>>
Create a dashboard using the specified options. When defining queries in your widgets, take note of which queries should have the as_count()
or as_rate()
modifiers appended.
Refer to the following documentation for more information on these modifiers.
Sourcepub async fn create_public_dashboard(
&self,
body: SharedDashboard,
) -> Result<SharedDashboard, Error<CreatePublicDashboardError>>
pub async fn create_public_dashboard( &self, body: SharedDashboard, ) -> Result<SharedDashboard, Error<CreatePublicDashboardError>>
Share a specified private dashboard, generating a URL at which it can be publicly viewed.
Examples found in repository?
11async fn main() {
12 // there is a valid "dashboard" in the system
13 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
14 let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
15 .global_time(
16 DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
17 )
18 .share_type(Some(DashboardShareType::OPEN));
19 let configuration = datadog::Configuration::new();
20 let api = DashboardsAPI::with_config(configuration);
21 let resp = api.create_public_dashboard(body).await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
More examples
12async fn main() {
13 // there is a valid "dashboard" in the system
14 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15 let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16 .global_time(
17 DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18 )
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_type(Some(DashboardShareType::OPEN));
28 let configuration = datadog::Configuration::new();
29 let api = DashboardsAPI::with_config(configuration);
30 let resp = api.create_public_dashboard(body).await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
Sourcepub async fn create_public_dashboard_with_http_info(
&self,
body: SharedDashboard,
) -> Result<ResponseContent<SharedDashboard>, Error<CreatePublicDashboardError>>
pub async fn create_public_dashboard_with_http_info( &self, body: SharedDashboard, ) -> Result<ResponseContent<SharedDashboard>, Error<CreatePublicDashboardError>>
Share a specified private dashboard, generating a URL at which it can be publicly viewed.
Sourcepub async fn delete_dashboard(
&self,
dashboard_id: String,
) -> Result<DashboardDeleteResponse, Error<DeleteDashboardError>>
pub async fn delete_dashboard( &self, dashboard_id: String, ) -> Result<DashboardDeleteResponse, Error<DeleteDashboardError>>
Delete a dashboard using the specified ID.
Examples found in repository?
6async fn main() {
7 // there is a valid "dashboard" in the system
8 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = DashboardsAPI::with_config(configuration);
11 let resp = api.delete_dashboard(dashboard_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn delete_dashboard_with_http_info(
&self,
dashboard_id: String,
) -> Result<ResponseContent<DashboardDeleteResponse>, Error<DeleteDashboardError>>
pub async fn delete_dashboard_with_http_info( &self, dashboard_id: String, ) -> Result<ResponseContent<DashboardDeleteResponse>, Error<DeleteDashboardError>>
Delete a dashboard using the specified ID.
Sourcepub async fn delete_dashboards(
&self,
body: DashboardBulkDeleteRequest,
) -> Result<(), Error<DeleteDashboardsError>>
pub async fn delete_dashboards( &self, body: DashboardBulkDeleteRequest, ) -> Result<(), Error<DeleteDashboardsError>>
Delete dashboards using the specified IDs. If there are any failures, no dashboards will be deleted (partial success is not allowed).
Examples found in repository?
9async fn main() {
10 // there is a valid "dashboard" in the system
11 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
12 let body = DashboardBulkDeleteRequest::new(vec![DashboardBulkActionData::new(
13 dashboard_id.clone(),
14 DashboardResourceType::DASHBOARD,
15 )]);
16 let configuration = datadog::Configuration::new();
17 let api = DashboardsAPI::with_config(configuration);
18 let resp = api.delete_dashboards(body).await;
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24}
Sourcepub async fn delete_dashboards_with_http_info(
&self,
body: DashboardBulkDeleteRequest,
) -> Result<ResponseContent<()>, Error<DeleteDashboardsError>>
pub async fn delete_dashboards_with_http_info( &self, body: DashboardBulkDeleteRequest, ) -> Result<ResponseContent<()>, Error<DeleteDashboardsError>>
Delete dashboards using the specified IDs. If there are any failures, no dashboards will be deleted (partial success is not allowed).
Sourcepub async fn delete_public_dashboard(
&self,
token: String,
) -> Result<DeleteSharedDashboardResponse, Error<DeletePublicDashboardError>>
pub async fn delete_public_dashboard( &self, token: String, ) -> Result<DeleteSharedDashboardResponse, Error<DeletePublicDashboardError>>
Revoke the public URL for a dashboard (rendering it private) associated with the specified token.
Sourcepub async fn delete_public_dashboard_with_http_info(
&self,
token: String,
) -> Result<ResponseContent<DeleteSharedDashboardResponse>, Error<DeletePublicDashboardError>>
pub async fn delete_public_dashboard_with_http_info( &self, token: String, ) -> Result<ResponseContent<DeleteSharedDashboardResponse>, Error<DeletePublicDashboardError>>
Revoke the public URL for a dashboard (rendering it private) associated with the specified token.
Sourcepub async fn delete_public_dashboard_invitation(
&self,
token: String,
body: SharedDashboardInvites,
) -> Result<(), Error<DeletePublicDashboardInvitationError>>
pub async fn delete_public_dashboard_invitation( &self, token: String, body: SharedDashboardInvites, ) -> Result<(), Error<DeletePublicDashboardInvitationError>>
Revoke previously sent invitation emails and active sessions used to access a given shared dashboard for specific email addresses.
Examples found in repository?
11async fn main() {
12 let body =
13 SharedDashboardInvites::new(SharedDashboardInvitesData::SharedDashboardInvitesDataList(
14 vec![SharedDashboardInvitesDataObject::new(
15 SharedDashboardInvitesDataObjectAttributes::new()
16 .email("test@datadoghq.com".to_string()),
17 DashboardInviteType::PUBLIC_DASHBOARD_INVITATION,
18 )],
19 ));
20 let configuration = datadog::Configuration::new();
21 let api = DashboardsAPI::with_config(configuration);
22 let resp = api
23 .delete_public_dashboard_invitation("token".to_string(), body)
24 .await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
Sourcepub async fn delete_public_dashboard_invitation_with_http_info(
&self,
token: String,
body: SharedDashboardInvites,
) -> Result<ResponseContent<()>, Error<DeletePublicDashboardInvitationError>>
pub async fn delete_public_dashboard_invitation_with_http_info( &self, token: String, body: SharedDashboardInvites, ) -> Result<ResponseContent<()>, Error<DeletePublicDashboardInvitationError>>
Revoke previously sent invitation emails and active sessions used to access a given shared dashboard for specific email addresses.
Sourcepub async fn get_dashboard(
&self,
dashboard_id: String,
) -> Result<Dashboard, Error<GetDashboardError>>
pub async fn get_dashboard( &self, dashboard_id: String, ) -> Result<Dashboard, Error<GetDashboardError>>
Get a dashboard using the specified ID.
Examples found in repository?
6async fn main() {
7 // there is a valid "dashboard" in the system
8 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = DashboardsAPI::with_config(configuration);
11 let resp = api.get_dashboard(dashboard_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
More examples
6async fn main() {
7 // there is a valid "dashboard" in the system
8 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = DashboardsAPI::with_config(configuration);
11 let resp = api.get_dashboard(dashboard_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn get_dashboard_with_http_info(
&self,
dashboard_id: String,
) -> Result<ResponseContent<Dashboard>, Error<GetDashboardError>>
pub async fn get_dashboard_with_http_info( &self, dashboard_id: String, ) -> Result<ResponseContent<Dashboard>, Error<GetDashboardError>>
Get a dashboard using the specified ID.
Sourcepub async fn get_public_dashboard(
&self,
token: String,
) -> Result<SharedDashboard, Error<GetPublicDashboardError>>
pub async fn get_public_dashboard( &self, token: String, ) -> Result<SharedDashboard, Error<GetPublicDashboardError>>
Fetch an existing shared dashboard’s sharing metadata associated with the specified token.
Examples found in repository?
6async fn main() {
7 // there is a valid "shared_dashboard" in the system
8 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = DashboardsAPI::with_config(configuration);
11 let resp = api
12 .get_public_dashboard(shared_dashboard_token.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn get_public_dashboard_with_http_info(
&self,
token: String,
) -> Result<ResponseContent<SharedDashboard>, Error<GetPublicDashboardError>>
pub async fn get_public_dashboard_with_http_info( &self, token: String, ) -> Result<ResponseContent<SharedDashboard>, Error<GetPublicDashboardError>>
Fetch an existing shared dashboard’s sharing metadata associated with the specified token.
Sourcepub async fn get_public_dashboard_invitations(
&self,
token: String,
params: GetPublicDashboardInvitationsOptionalParams,
) -> Result<SharedDashboardInvites, Error<GetPublicDashboardInvitationsError>>
pub async fn get_public_dashboard_invitations( &self, token: String, params: GetPublicDashboardInvitationsOptionalParams, ) -> Result<SharedDashboardInvites, Error<GetPublicDashboardInvitationsError>>
Describe the invitations that exist for the given shared dashboard (paginated).
Examples found in repository?
7async fn main() {
8 // there is a valid "shared_dashboard" in the system
9 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
10 let configuration = datadog::Configuration::new();
11 let api = DashboardsAPI::with_config(configuration);
12 let resp = api
13 .get_public_dashboard_invitations(
14 shared_dashboard_token.clone(),
15 GetPublicDashboardInvitationsOptionalParams::default(),
16 )
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Sourcepub async fn get_public_dashboard_invitations_with_http_info(
&self,
token: String,
params: GetPublicDashboardInvitationsOptionalParams,
) -> Result<ResponseContent<SharedDashboardInvites>, Error<GetPublicDashboardInvitationsError>>
pub async fn get_public_dashboard_invitations_with_http_info( &self, token: String, params: GetPublicDashboardInvitationsOptionalParams, ) -> Result<ResponseContent<SharedDashboardInvites>, Error<GetPublicDashboardInvitationsError>>
Describe the invitations that exist for the given shared dashboard (paginated).
Sourcepub async fn list_dashboards(
&self,
params: ListDashboardsOptionalParams,
) -> Result<DashboardSummary, Error<ListDashboardsError>>
pub async fn list_dashboards( &self, params: ListDashboardsOptionalParams, ) -> Result<DashboardSummary, Error<ListDashboardsError>>
Get all dashboards.
Note: This query will only return custom created or cloned dashboards. This query will not return preset dashboards.
Examples found in repository?
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = DashboardsAPI::with_config(configuration);
10 let resp = api
11 .list_dashboards(ListDashboardsOptionalParams::default().filter_shared(false))
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
More examples
7async fn main() {
8 let configuration = datadog::Configuration::new();
9 let api = DashboardsAPI::with_config(configuration);
10 let resp = api
11 .list_dashboards(ListDashboardsOptionalParams::default().filter_deleted(true))
12 .await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub fn list_dashboards_with_pagination(
&self,
params: ListDashboardsOptionalParams,
) -> impl Stream<Item = Result<DashboardSummaryDefinition, Error<ListDashboardsError>>> + '_
pub fn list_dashboards_with_pagination( &self, params: ListDashboardsOptionalParams, ) -> impl Stream<Item = Result<DashboardSummaryDefinition, Error<ListDashboardsError>>> + '_
Examples found in repository?
9async fn main() {
10 let configuration = datadog::Configuration::new();
11 let api = DashboardsAPI::with_config(configuration);
12 let response =
13 api.list_dashboards_with_pagination(ListDashboardsOptionalParams::default().count(2));
14 pin_mut!(response);
15 while let Some(resp) = response.next().await {
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21 }
22}
Sourcepub async fn list_dashboards_with_http_info(
&self,
params: ListDashboardsOptionalParams,
) -> Result<ResponseContent<DashboardSummary>, Error<ListDashboardsError>>
pub async fn list_dashboards_with_http_info( &self, params: ListDashboardsOptionalParams, ) -> Result<ResponseContent<DashboardSummary>, Error<ListDashboardsError>>
Get all dashboards.
Note: This query will only return custom created or cloned dashboards. This query will not return preset dashboards.
Sourcepub async fn restore_dashboards(
&self,
body: DashboardRestoreRequest,
) -> Result<(), Error<RestoreDashboardsError>>
pub async fn restore_dashboards( &self, body: DashboardRestoreRequest, ) -> Result<(), Error<RestoreDashboardsError>>
Restore dashboards using the specified IDs. If there are any failures, no dashboards will be restored (partial success is not allowed).
Examples found in repository?
9async fn main() {
10 // there is a valid "dashboard" in the system
11 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
12 let body = DashboardRestoreRequest::new(vec![DashboardBulkActionData::new(
13 dashboard_id.clone(),
14 DashboardResourceType::DASHBOARD,
15 )]);
16 let configuration = datadog::Configuration::new();
17 let api = DashboardsAPI::with_config(configuration);
18 let resp = api.restore_dashboards(body).await;
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24}
Sourcepub async fn restore_dashboards_with_http_info(
&self,
body: DashboardRestoreRequest,
) -> Result<ResponseContent<()>, Error<RestoreDashboardsError>>
pub async fn restore_dashboards_with_http_info( &self, body: DashboardRestoreRequest, ) -> Result<ResponseContent<()>, Error<RestoreDashboardsError>>
Restore dashboards using the specified IDs. If there are any failures, no dashboards will be restored (partial success is not allowed).
Sourcepub async fn send_public_dashboard_invitation(
&self,
token: String,
body: SharedDashboardInvites,
) -> Result<SharedDashboardInvites, Error<SendPublicDashboardInvitationError>>
pub async fn send_public_dashboard_invitation( &self, token: String, body: SharedDashboardInvites, ) -> Result<SharedDashboardInvites, Error<SendPublicDashboardInvitationError>>
Send emails to specified email addresses containing links to access a given authenticated shared dashboard. Email addresses must already belong to the authenticated shared dashboard’s share_list.
Examples found in repository?
11async fn main() {
12 // there is a valid "shared_dashboard" in the system
13 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
14 let body = SharedDashboardInvites::new(
15 SharedDashboardInvitesData::SharedDashboardInvitesDataObject(Box::new(
16 SharedDashboardInvitesDataObject::new(
17 SharedDashboardInvitesDataObjectAttributes::new()
18 .email("exampledashboard@datadoghq.com".to_string()),
19 DashboardInviteType::PUBLIC_DASHBOARD_INVITATION,
20 ),
21 )),
22 );
23 let configuration = datadog::Configuration::new();
24 let api = DashboardsAPI::with_config(configuration);
25 let resp = api
26 .send_public_dashboard_invitation(shared_dashboard_token.clone(), body)
27 .await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
Sourcepub async fn send_public_dashboard_invitation_with_http_info(
&self,
token: String,
body: SharedDashboardInvites,
) -> Result<ResponseContent<SharedDashboardInvites>, Error<SendPublicDashboardInvitationError>>
pub async fn send_public_dashboard_invitation_with_http_info( &self, token: String, body: SharedDashboardInvites, ) -> Result<ResponseContent<SharedDashboardInvites>, Error<SendPublicDashboardInvitationError>>
Send emails to specified email addresses containing links to access a given authenticated shared dashboard. Email addresses must already belong to the authenticated shared dashboard’s share_list.
Sourcepub async fn update_dashboard(
&self,
dashboard_id: String,
body: Dashboard,
) -> Result<Dashboard, Error<UpdateDashboardError>>
pub async fn update_dashboard( &self, dashboard_id: String, body: Dashboard, ) -> Result<Dashboard, Error<UpdateDashboardError>>
Update a dashboard using the specified ID.
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 let configuration = datadog::Configuration::new();
40 let api = DashboardsAPI::with_config(configuration);
41 let resp = api.update_dashboard(dashboard_id.clone(), body).await;
42 if let Ok(value) = resp {
43 println!("{:#?}", value);
44 } else {
45 println!("{:#?}", resp.unwrap_err());
46 }
47}
More examples
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}
Sourcepub async fn update_dashboard_with_http_info(
&self,
dashboard_id: String,
body: Dashboard,
) -> Result<ResponseContent<Dashboard>, Error<UpdateDashboardError>>
pub async fn update_dashboard_with_http_info( &self, dashboard_id: String, body: Dashboard, ) -> Result<ResponseContent<Dashboard>, Error<UpdateDashboardError>>
Update a dashboard using the specified ID.
Sourcepub async fn update_public_dashboard(
&self,
token: String,
body: SharedDashboardUpdateRequest,
) -> Result<SharedDashboard, Error<UpdatePublicDashboardError>>
pub async fn update_public_dashboard( &self, token: String, body: SharedDashboardUpdateRequest, ) -> Result<SharedDashboard, Error<UpdatePublicDashboardError>>
Update a shared dashboard associated with the specified token.
Examples found in repository?
10async fn main() {
11 // there is a valid "shared_dashboard" in the system
12 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
13 let body = SharedDashboardUpdateRequest::new()
14 .global_time(Some(
15 SharedDashboardUpdateRequestGlobalTime::new()
16 .live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
17 ))
18 .share_list(Some(vec![]))
19 .share_type(Some(DashboardShareType::OPEN));
20 let configuration = datadog::Configuration::new();
21 let api = DashboardsAPI::with_config(configuration);
22 let resp = api
23 .update_public_dashboard(shared_dashboard_token.clone(), body)
24 .await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
More examples
11async fn main() {
12 // there is a valid "shared_dashboard" in the system
13 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
14 let body = SharedDashboardUpdateRequest::new()
15 .global_time(Some(
16 SharedDashboardUpdateRequestGlobalTime::new()
17 .live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
18 ))
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_list(Some(vec![]))
28 .share_type(Some(DashboardShareType::OPEN));
29 let configuration = datadog::Configuration::new();
30 let api = DashboardsAPI::with_config(configuration);
31 let resp = api
32 .update_public_dashboard(shared_dashboard_token.clone(), body)
33 .await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
Sourcepub async fn update_public_dashboard_with_http_info(
&self,
token: String,
body: SharedDashboardUpdateRequest,
) -> Result<ResponseContent<SharedDashboard>, Error<UpdatePublicDashboardError>>
pub async fn update_public_dashboard_with_http_info( &self, token: String, body: SharedDashboardUpdateRequest, ) -> Result<ResponseContent<SharedDashboard>, Error<UpdatePublicDashboardError>>
Update a shared dashboard associated with the specified token.
Trait Implementations§
Source§impl Clone for DashboardsAPI
impl Clone for DashboardsAPI
Source§fn clone(&self) -> DashboardsAPI
fn clone(&self) -> DashboardsAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more