Skip to main content

eero_api/api/
diagnostics.rs

1use crate::client::EeroClient;
2use crate::error::Result;
3use crate::types::diagnostic::DiagnosticReport;
4
5impl EeroClient {
6    /// Get the latest diagnostic report for a network.
7    #[tracing::instrument(skip(self))]
8    pub async fn get_diagnostics(&self, network_id: u64) -> Result<DiagnosticReport> {
9        let url = self.url(&format!("/networks/{network_id}/diagnostics"));
10        self.get(&url).await
11    }
12
13    /// Run a new diagnostic check on the network.
14    #[tracing::instrument(skip(self))]
15    pub async fn run_diagnostics(&self, network_id: u64) -> Result<DiagnosticReport> {
16        let url = self.url(&format!("/networks/{network_id}/diagnostics"));
17        self.post_empty(&url).await
18    }
19}