Struct DashboardsAPI

Source
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

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v1_dashboards_DeletePublicDashboard.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DashboardsAPI::with_config(configuration);
9    let resp = api.delete_public_dashboard("token".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v1_dashboards_ListDashboards.rs (line 9)
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}
examples/v1_dashboards_ListDashboards_1773932563.rs (line 9)
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}
examples/v1_dashboards_GetDashboard.rs (line 10)
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}
examples/v1_dashboards_GetDashboard_4262333854.rs (line 10)
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}
examples/v1_dashboards_DeleteDashboard.rs (line 10)
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}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

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?
examples/v1_dashboards_CreateDashboard_417992286.rs (line 27)
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
Hide additional examples
examples/v1_dashboards_CreateDashboard_927141680.rs (line 32)
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}
examples/v1_dashboards_CreateDashboard_913313564.rs (line 32)
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}
examples/v1_dashboards_CreateDashboard_651038379.rs (line 34)
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}
examples/v1_dashboards_CreateDashboard_1738608750.rs (line 36)
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}
examples/v1_dashboards_CreateDashboard_2338918735.rs (line 38)
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}
Source

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.

Source

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?
examples/v1_dashboards_CreatePublicDashboard.rs (line 21)
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
Hide additional examples
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (line 30)
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}
Source

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.

Source

pub async fn delete_dashboard( &self, dashboard_id: String, ) -> Result<DashboardDeleteResponse, Error<DeleteDashboardError>>

Delete a dashboard using the specified ID.

Examples found in repository?
examples/v1_dashboards_DeleteDashboard.rs (line 11)
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}
Source

pub async fn delete_dashboard_with_http_info( &self, dashboard_id: String, ) -> Result<ResponseContent<DashboardDeleteResponse>, Error<DeleteDashboardError>>

Delete a dashboard using the specified ID.

Source

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?
examples/v1_dashboards_DeleteDashboards.rs (line 18)
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}
Source

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).

Source

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.

Examples found in repository?
examples/v1_dashboards_DeletePublicDashboard.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = DashboardsAPI::with_config(configuration);
9    let resp = api.delete_public_dashboard("token".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

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?
examples/v1_dashboards_DeletePublicDashboardInvitation.rs (line 23)
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}
Source

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.

Source

pub async fn get_dashboard( &self, dashboard_id: String, ) -> Result<Dashboard, Error<GetDashboardError>>

Get a dashboard using the specified ID.

Examples found in repository?
examples/v1_dashboards_GetDashboard.rs (line 11)
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
Hide additional examples
examples/v1_dashboards_GetDashboard_4262333854.rs (line 11)
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}
Source

pub async fn get_dashboard_with_http_info( &self, dashboard_id: String, ) -> Result<ResponseContent<Dashboard>, Error<GetDashboardError>>

Get a dashboard using the specified ID.

Source

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?
examples/v1_dashboards_GetPublicDashboard.rs (line 12)
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}
Source

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.

Source

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?
examples/v1_dashboards_GetPublicDashboardInvitations.rs (lines 13-16)
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}
Source

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).

Source

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?
examples/v1_dashboards_ListDashboards.rs (line 11)
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
Hide additional examples
examples/v1_dashboards_ListDashboards_1773932563.rs (line 11)
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}
Source

pub fn list_dashboards_with_pagination( &self, params: ListDashboardsOptionalParams, ) -> impl Stream<Item = Result<DashboardSummaryDefinition, Error<ListDashboardsError>>> + '_

Examples found in repository?
examples/v1_dashboards_ListDashboards_1062671515.rs (line 13)
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}
Source

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.

Source

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?
examples/v1_dashboards_RestoreDashboards.rs (line 18)
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}
Source

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).

Source

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?
examples/v1_dashboards_SendPublicDashboardInvitation.rs (line 26)
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}
Source

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.

Source

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?
examples/v1_dashboards_UpdateDashboard.rs (line 41)
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
Hide additional examples
examples/v1_dashboards_UpdateDashboard_3454865944.rs (line 42)
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}
Source

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.

Source

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?
examples/v1_dashboards_UpdatePublicDashboard.rs (line 23)
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
Hide additional examples
examples/v1_dashboards_UpdatePublicDashboard_1708268778.rs (line 32)
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}
Source

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

Source§

fn clone(&self) -> DashboardsAPI

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DashboardsAPI

Source§

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

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

impl Default for DashboardsAPI

Source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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