Skip to main content

ugos_client/
lib.rs

1//! UGOS NAS API client library.
2//!
3//! Provides typed access to the UGREEN NAS (UGOS) REST API,
4//! including authentication (RSA + session tokens) and all
5//! service modules (KVM, storage, network, etc.).
6//!
7//! # Quick start
8//!
9//! ```rust,no_run
10//! use ugos_client::{UgosClient, Credentials};
11//! use ugos_client::api::kvm::KvmApi;
12//!
13//! # async fn example() -> ugos_client::error::Result<()> {
14//! let creds = Credentials {
15//!     username: "admin".into(),
16//!     password: "secret".into(),
17//! };
18//! let tls = ugos_client::TlsPolicy::Pinned(
19//!     ugos_client::tls::probe_fingerprint("192.168.1.10", 9443).await?,
20//! );
21//! let client = UgosClient::connect("192.168.1.10", 9443, creds, &tls).await?;
22//! let vms = client.vm_list().await?;
23//! # Ok(())
24//! # }
25//! ```
26
27pub mod api;
28pub mod auth;
29pub mod client;
30pub mod crypto;
31pub mod error;
32pub mod tls;
33pub mod types;
34
35// Re-export the most commonly used items at the crate root.
36pub use auth::{Credentials, Session};
37pub use client::UgosClient;
38pub use tls::{CertFingerprint, TlsPolicy};
39
40#[cfg(test)]
41mod tests;