Struct DashboardListsAPI

Source
pub struct DashboardListsAPI { /* private fields */ }
Expand description

Interact with your dashboard lists through the API to organize, find, and share all of your dashboards with your team and organization.

Implementations§

Source§

impl DashboardListsAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_dashboard-lists_GetDashboardListItems.rs (line 10)
6async fn main() {
7    // there is a valid "dashboard_list" in the system
8    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
9    let configuration = datadog::Configuration::new();
10    let api = DashboardListsAPI::with_config(configuration);
11    let resp = api
12        .get_dashboard_list_items(dashboard_list_id.clone())
13        .await;
14    if let Ok(value) = resp {
15        println!("{:#?}", value);
16    } else {
17        println!("{:#?}", resp.unwrap_err());
18    }
19}
More examples
Hide additional examples
examples/v2_dashboard-lists_CreateDashboardListItems.rs (line 15)
9async fn main() {
10    let body = DashboardListAddItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
11        "q5j-nti-fv6".to_string(),
12        DashboardType::HOST_TIMEBOARD,
13    )]);
14    let configuration = datadog::Configuration::new();
15    let api = DashboardListsAPI::with_config(configuration);
16    let resp = api
17        .create_dashboard_list_items(9223372036854775807, body)
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
examples/v2_dashboard-lists_DeleteDashboardListItems.rs (line 16)
9async fn main() {
10    let body =
11        DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
12            "q5j-nti-fv6".to_string(),
13            DashboardType::HOST_TIMEBOARD,
14        )]);
15    let configuration = datadog::Configuration::new();
16    let api = DashboardListsAPI::with_config(configuration);
17    let resp = api
18        .delete_dashboard_list_items(9223372036854775807, body)
19        .await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}
examples/v2_dashboard-lists_CreateDashboardListItems_3995409989.rs (line 21)
10async fn main() {
11    // there is a valid "dashboard_list" in the system
12    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
13
14    // there is a valid "dashboard" in the system
15    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
16    let body = DashboardListAddItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
17        dashboard_id.clone(),
18        DashboardType::CUSTOM_TIMEBOARD,
19    )]);
20    let configuration = datadog::Configuration::new();
21    let api = DashboardListsAPI::with_config(configuration);
22    let resp = api
23        .create_dashboard_list_items(dashboard_list_id.clone(), body)
24        .await;
25    if let Ok(value) = resp {
26        println!("{:#?}", value);
27    } else {
28        println!("{:#?}", resp.unwrap_err());
29    }
30}
examples/v2_dashboard-lists_DeleteDashboardListItems_2656706656.rs (line 22)
10async fn main() {
11    // there is a valid "dashboard_list" in the system
12    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
13
14    // there is a valid "dashboard" in the system
15    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
16    let body =
17        DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
18            dashboard_id.clone(),
19            DashboardType::CUSTOM_TIMEBOARD,
20        )]);
21    let configuration = datadog::Configuration::new();
22    let api = DashboardListsAPI::with_config(configuration);
23    let resp = api
24        .delete_dashboard_list_items(dashboard_list_id.clone(), body)
25        .await;
26    if let Ok(value) = resp {
27        println!("{:#?}", value);
28    } else {
29        println!("{:#?}", resp.unwrap_err());
30    }
31}
examples/v2_dashboard-lists_CreateDashboardListItems_825696022.rs (line 21)
10async fn main() {
11    // there is a valid "dashboard_list" in the system
12    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
13
14    // there is a valid "screenboard_dashboard" in the system
15    let screenboard_dashboard_id = std::env::var("SCREENBOARD_DASHBOARD_ID").unwrap();
16    let body = DashboardListAddItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
17        screenboard_dashboard_id.clone(),
18        DashboardType::CUSTOM_SCREENBOARD,
19    )]);
20    let configuration = datadog::Configuration::new();
21    let api = DashboardListsAPI::with_config(configuration);
22    let resp = api
23        .create_dashboard_list_items(dashboard_list_id.clone(), body)
24        .await;
25    if let Ok(value) = resp {
26        println!("{:#?}", value);
27    } else {
28        println!("{:#?}", resp.unwrap_err());
29    }
30}
Source

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

Source

pub async fn create_dashboard_list_items( &self, dashboard_list_id: i64, body: DashboardListAddItemsRequest, ) -> Result<DashboardListAddItemsResponse, Error<CreateDashboardListItemsError>>

Add dashboards to an existing dashboard list.

Examples found in repository?
examples/v2_dashboard-lists_CreateDashboardListItems.rs (line 17)
9async fn main() {
10    let body = DashboardListAddItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
11        "q5j-nti-fv6".to_string(),
12        DashboardType::HOST_TIMEBOARD,
13    )]);
14    let configuration = datadog::Configuration::new();
15    let api = DashboardListsAPI::with_config(configuration);
16    let resp = api
17        .create_dashboard_list_items(9223372036854775807, body)
18        .await;
19    if let Ok(value) = resp {
20        println!("{:#?}", value);
21    } else {
22        println!("{:#?}", resp.unwrap_err());
23    }
24}
More examples
Hide additional examples
examples/v2_dashboard-lists_CreateDashboardListItems_3995409989.rs (line 23)
10async fn main() {
11    // there is a valid "dashboard_list" in the system
12    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
13
14    // there is a valid "dashboard" in the system
15    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
16    let body = DashboardListAddItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
17        dashboard_id.clone(),
18        DashboardType::CUSTOM_TIMEBOARD,
19    )]);
20    let configuration = datadog::Configuration::new();
21    let api = DashboardListsAPI::with_config(configuration);
22    let resp = api
23        .create_dashboard_list_items(dashboard_list_id.clone(), body)
24        .await;
25    if let Ok(value) = resp {
26        println!("{:#?}", value);
27    } else {
28        println!("{:#?}", resp.unwrap_err());
29    }
30}
examples/v2_dashboard-lists_CreateDashboardListItems_825696022.rs (line 23)
10async fn main() {
11    // there is a valid "dashboard_list" in the system
12    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
13
14    // there is a valid "screenboard_dashboard" in the system
15    let screenboard_dashboard_id = std::env::var("SCREENBOARD_DASHBOARD_ID").unwrap();
16    let body = DashboardListAddItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
17        screenboard_dashboard_id.clone(),
18        DashboardType::CUSTOM_SCREENBOARD,
19    )]);
20    let configuration = datadog::Configuration::new();
21    let api = DashboardListsAPI::with_config(configuration);
22    let resp = api
23        .create_dashboard_list_items(dashboard_list_id.clone(), 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 create_dashboard_list_items_with_http_info( &self, dashboard_list_id: i64, body: DashboardListAddItemsRequest, ) -> Result<ResponseContent<DashboardListAddItemsResponse>, Error<CreateDashboardListItemsError>>

Add dashboards to an existing dashboard list.

Source

pub async fn delete_dashboard_list_items( &self, dashboard_list_id: i64, body: DashboardListDeleteItemsRequest, ) -> Result<DashboardListDeleteItemsResponse, Error<DeleteDashboardListItemsError>>

Delete dashboards from an existing dashboard list.

Examples found in repository?
examples/v2_dashboard-lists_DeleteDashboardListItems.rs (line 18)
9async fn main() {
10    let body =
11        DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
12            "q5j-nti-fv6".to_string(),
13            DashboardType::HOST_TIMEBOARD,
14        )]);
15    let configuration = datadog::Configuration::new();
16    let api = DashboardListsAPI::with_config(configuration);
17    let resp = api
18        .delete_dashboard_list_items(9223372036854775807, body)
19        .await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}
More examples
Hide additional examples
examples/v2_dashboard-lists_DeleteDashboardListItems_2656706656.rs (line 24)
10async fn main() {
11    // there is a valid "dashboard_list" in the system
12    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
13
14    // there is a valid "dashboard" in the system
15    let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
16    let body =
17        DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
18            dashboard_id.clone(),
19            DashboardType::CUSTOM_TIMEBOARD,
20        )]);
21    let configuration = datadog::Configuration::new();
22    let api = DashboardListsAPI::with_config(configuration);
23    let resp = api
24        .delete_dashboard_list_items(dashboard_list_id.clone(), body)
25        .await;
26    if let Ok(value) = resp {
27        println!("{:#?}", value);
28    } else {
29        println!("{:#?}", resp.unwrap_err());
30    }
31}
examples/v2_dashboard-lists_DeleteDashboardListItems_3851624753.rs (line 24)
10async fn main() {
11    // there is a valid "dashboard_list" in the system
12    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
13
14    // there is a valid "screenboard_dashboard" in the system
15    let screenboard_dashboard_id = std::env::var("SCREENBOARD_DASHBOARD_ID").unwrap();
16    let body =
17        DashboardListDeleteItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
18            screenboard_dashboard_id.clone(),
19            DashboardType::CUSTOM_SCREENBOARD,
20        )]);
21    let configuration = datadog::Configuration::new();
22    let api = DashboardListsAPI::with_config(configuration);
23    let resp = api
24        .delete_dashboard_list_items(dashboard_list_id.clone(), body)
25        .await;
26    if let Ok(value) = resp {
27        println!("{:#?}", value);
28    } else {
29        println!("{:#?}", resp.unwrap_err());
30    }
31}
Source

pub async fn delete_dashboard_list_items_with_http_info( &self, dashboard_list_id: i64, body: DashboardListDeleteItemsRequest, ) -> Result<ResponseContent<DashboardListDeleteItemsResponse>, Error<DeleteDashboardListItemsError>>

Delete dashboards from an existing dashboard list.

Source

pub async fn get_dashboard_list_items( &self, dashboard_list_id: i64, ) -> Result<DashboardListItems, Error<GetDashboardListItemsError>>

Fetch the dashboard list’s dashboard definitions.

Examples found in repository?
examples/v2_dashboard-lists_GetDashboardListItems.rs (line 12)
6async fn main() {
7    // there is a valid "dashboard_list" in the system
8    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
9    let configuration = datadog::Configuration::new();
10    let api = DashboardListsAPI::with_config(configuration);
11    let resp = api
12        .get_dashboard_list_items(dashboard_list_id.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_dashboard_list_items_with_http_info( &self, dashboard_list_id: i64, ) -> Result<ResponseContent<DashboardListItems>, Error<GetDashboardListItemsError>>

Fetch the dashboard list’s dashboard definitions.

Source

pub async fn update_dashboard_list_items( &self, dashboard_list_id: i64, body: DashboardListUpdateItemsRequest, ) -> Result<DashboardListUpdateItemsResponse, Error<UpdateDashboardListItemsError>>

Update dashboards of an existing dashboard list.

Examples found in repository?
examples/v2_dashboard-lists_UpdateDashboardListItems.rs (line 23)
9async fn main() {
10    // there is a valid "dashboard_list" in the system
11    let dashboard_list_id: i64 = std::env::var("DASHBOARD_LIST_ID").unwrap().parse().unwrap();
12
13    // there is a valid "screenboard_dashboard" in the system
14    let screenboard_dashboard_id = std::env::var("SCREENBOARD_DASHBOARD_ID").unwrap();
15    let body =
16        DashboardListUpdateItemsRequest::new().dashboards(vec![DashboardListItemRequest::new(
17            screenboard_dashboard_id.clone(),
18            DashboardType::CUSTOM_SCREENBOARD,
19        )]);
20    let configuration = datadog::Configuration::new();
21    let api = DashboardListsAPI::with_config(configuration);
22    let resp = api
23        .update_dashboard_list_items(dashboard_list_id.clone(), 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 update_dashboard_list_items_with_http_info( &self, dashboard_list_id: i64, body: DashboardListUpdateItemsRequest, ) -> Result<ResponseContent<DashboardListUpdateItemsResponse>, Error<UpdateDashboardListItemsError>>

Update dashboards of an existing dashboard list.

Trait Implementations§

Source§

impl Clone for DashboardListsAPI

Source§

fn clone(&self) -> DashboardListsAPI

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 DashboardListsAPI

Source§

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

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

impl Default for DashboardListsAPI

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,