Expand description
Async Rust client and reactive data layer for UniFi controller APIs.
This crate provides both the HTTP transport layer and the domain model for communicating with UniFi Network controllers.
§Transport layer
-
Integration API (
IntegrationClient) — RESTful OpenAPI-based interface authenticated viaX-API-KEYheader. Primary surface for CRUD operations on devices, clients, networks, firewall rules, and other managed entities. -
Session API (
SessionClient) — UniFi’s internal/api/and/v2/api/surface, authenticated by session cookie + CSRF (username/password login) or by IntegrationX-API-KEYon UniFi OS. Covers data not yet exposed by the Integration API: events, traffic stats, admin users, DPI data, system info, and real-time WebSocket events (WebSocket still requires the cookie session).
Both clients share a common TransportConfig for reqwest-based HTTP transport
with configurable TLS (TlsMode: system CA, custom PEM, or danger-accept for
self-signed controllers) and timeout settings.
§Domain layer
-
Controller— Central facade managing the full lifecycle: authentication, background refresh, and command routing. -
DataStore— Lock-free reactive storage built onDashMap+watchchannels. -
EntityStream<T>— Subscription handle for TUI reactive rendering. -
Domain model (
model) — Canonical types (Device,Client,Network,FirewallPolicy,Event, etc.) withEntityIdsupporting both UUID and string-based identifiers.
Re-exports§
pub use auth::AuthStrategy;pub use auth::ControllerPlatform;pub use auth::Credentials;pub use error::Error;pub use integration::IntegrationClient;pub use integration::types as integration_types;pub use session::SessionClient;pub use session::models as session_models;pub use site_manager::SiteManagerClient;pub use site_manager::types as site_manager_types;pub use transport::TlsMode;pub use transport::TransportConfig;pub use command::Command;pub use command::CommandResult;pub use config::AuthCredentials;pub use config::ControllerConfig;pub use config::TlsVerification;pub use controller::ConnectionState;pub use controller::Controller;pub use core_error::CoreError;pub use store::DataStore;pub use stream::EntityStream;pub use model::AclRule;pub use model::Admin;pub use model::Alarm;pub use model::Client;pub use model::ClientType;pub use model::Country;pub use model::Device;pub use model::DeviceState;pub use model::DeviceType;pub use model::DpiApplication;pub use model::DpiCategory;pub use model::EntityId;pub use model::Event;pub use model::EventCategory;pub use model::EventSeverity;pub use model::FirewallPolicy;pub use model::FirewallZone;pub use model::HealthSummary;pub use model::IpsecSa;pub use model::MacAddress;pub use model::MagicSiteToSiteVpnConfig;pub use model::NatPolicy;pub use model::NatType;pub use model::Network;pub use model::RadiusProfile;pub use model::RemoteAccessVpnServer;pub use model::Site;pub use model::SiteToSiteVpn;pub use model::SysInfo;pub use model::SystemInfo;pub use model::TrafficMatchingList;pub use model::VpnClientConnection;pub use model::VpnClientProfile;pub use model::VpnServer;pub use model::VpnSetting;pub use model::VpnTunnel;pub use model::WanInterface;pub use model::WireGuardPeer;pub use command::requests::*;
Modules§
- auth
- command
- config
- controller
- convert
- core_
error - error
- integration
- model
- session
- site_
manager - store
- stream
- transport
- websocket
- WebSocket event stream with auto-reconnect.