pub struct Controller { /* private fields */ }Expand description
The main entry point for consumers.
Cheaply cloneable via Arc<ControllerInner>. Manages the full
connection lifecycle: authentication, background data refresh,
command routing, and reactive entity streaming.
Implementations§
Source§impl Controller
impl Controller
Sourcepub async fn connect(&self) -> Result<(), CoreError>
pub async fn connect(&self) -> Result<(), CoreError>
Connect to the controller.
Detects the platform, authenticates, performs an initial data refresh, and spawns background tasks (periodic refresh, command processor).
Sourcepub async fn disconnect(&self)
pub async fn disconnect(&self)
Disconnect from the controller.
Cancels background tasks, logs out if session-based, and resets
the connection state to Disconnected.
Source§impl Controller
impl Controller
pub async fn get_wifi_broadcast_detail( &self, id: &EntityId, ) -> Result<WifiBroadcast, CoreError>
pub async fn list_pending_devices(&self) -> Result<Vec<Value>, CoreError>
Source§impl Controller
impl Controller
pub async fn get_firewall_policy_ordering( &self, source_zone_id: &EntityId, destination_zone_id: &EntityId, ) -> Result<FirewallPolicyOrdering, CoreError>
pub async fn get_acl_rule_ordering(&self) -> Result<AclRuleOrdering, CoreError>
Source§impl Controller
impl Controller
pub async fn list_vpn_servers(&self) -> Result<Vec<VpnServer>, CoreError>
pub async fn list_vpn_tunnels(&self) -> Result<Vec<VpnTunnel>, CoreError>
pub async fn list_wans(&self) -> Result<Vec<WanInterface>, CoreError>
pub async fn list_dpi_categories(&self) -> Result<Vec<DpiCategory>, CoreError>
pub async fn list_dpi_applications( &self, ) -> Result<Vec<DpiApplication>, CoreError>
pub async fn list_radius_profiles( &self, ) -> Result<Vec<RadiusProfile>, CoreError>
pub async fn list_countries(&self) -> Result<Vec<Country>, CoreError>
pub async fn get_network_references( &self, network_id: &EntityId, ) -> Result<Value, CoreError>
Source§impl Controller
impl Controller
Sourcepub async fn full_refresh(&self) -> Result<(), CoreError>
pub async fn full_refresh(&self) -> Result<(), CoreError>
Fetch all data from the controller and update the DataStore.
Pulls devices, clients, and events from the controller APIs, converts them to domain types, and applies them to the store. Events are broadcast through the event channel after snapshot application.
Source§impl Controller
impl Controller
pub async fn list_site_to_site_vpns( &self, ) -> Result<Vec<SiteToSiteVpn>, CoreError>
pub async fn get_site_to_site_vpn( &self, id: &str, ) -> Result<SiteToSiteVpn, CoreError>
pub async fn list_remote_access_vpn_servers( &self, ) -> Result<Vec<RemoteAccessVpnServer>, CoreError>
pub async fn get_remote_access_vpn_server( &self, id: &str, ) -> Result<RemoteAccessVpnServer, CoreError>
pub async fn list_wireguard_peers( &self, server_id: Option<&str>, ) -> Result<Vec<WireGuardPeer>, CoreError>
pub async fn get_wireguard_peer( &self, server_id: &str, id: &str, ) -> Result<WireGuardPeer, CoreError>
pub async fn list_wireguard_peer_existing_subnets( &self, ) -> Result<Vec<String>, CoreError>
pub async fn list_openvpn_port_suggestions(&self) -> Result<Vec<u16>, CoreError>
pub async fn download_openvpn_configuration( &self, id: &str, ) -> Result<Vec<u8>, CoreError>
pub async fn list_vpn_client_profiles( &self, ) -> Result<Vec<VpnClientProfile>, CoreError>
pub async fn get_vpn_client_profile( &self, id: &str, ) -> Result<VpnClientProfile, CoreError>
pub async fn list_vpn_client_connections( &self, ) -> Result<Vec<VpnClientConnection>, CoreError>
pub async fn get_vpn_client_connection( &self, id: &str, ) -> Result<VpnClientConnection, CoreError>
pub async fn list_magic_site_to_site_vpn_configs( &self, ) -> Result<Vec<MagicSiteToSiteVpnConfig>, CoreError>
pub async fn get_magic_site_to_site_vpn_config( &self, id: &str, ) -> Result<MagicSiteToSiteVpnConfig, CoreError>
pub async fn list_backups(&self) -> Result<Vec<Value>, CoreError>
pub async fn download_backup( &self, filename: &str, ) -> Result<Vec<u8>, CoreError>
pub async fn get_site_stats( &self, interval: &str, start: Option<i64>, end: Option<i64>, attrs: Option<&[String]>, ) -> Result<Vec<Value>, CoreError>
pub async fn get_device_stats( &self, interval: &str, macs: Option<&[String]>, attrs: Option<&[String]>, ) -> Result<Vec<Value>, CoreError>
pub async fn get_client_stats( &self, interval: &str, macs: Option<&[String]>, attrs: Option<&[String]>, ) -> Result<Vec<Value>, CoreError>
pub async fn get_gateway_stats( &self, interval: &str, start: Option<i64>, end: Option<i64>, attrs: Option<&[String]>, ) -> Result<Vec<Value>, CoreError>
pub async fn get_dpi_stats( &self, group_by: &str, macs: Option<&[String]>, ) -> Result<Vec<Value>, CoreError>
pub async fn list_admins(&self) -> Result<Vec<Admin>, CoreError>
pub async fn list_users(&self) -> Result<Vec<SessionUserEntry>, CoreError>
pub async fn list_rogue_aps( &self, within_secs: Option<i64>, ) -> Result<Vec<RogueAp>, CoreError>
pub async fn list_channels(&self) -> Result<Vec<ChannelAvailability>, CoreError>
pub async fn get_client_roams( &self, mac: &str, limit: Option<u32>, ) -> Result<Vec<Value>, CoreError>
pub async fn get_client_wifi_experience( &self, client_ip: &str, ) -> Result<Value, CoreError>
pub async fn is_dpi_enabled(&self) -> Result<bool, CoreError>
pub async fn list_alarms(&self) -> Result<Vec<Alarm>, CoreError>
pub async fn get_system_info(&self) -> Result<SystemInfo, CoreError>
pub async fn get_site_health(&self) -> Result<Vec<HealthSummary>, CoreError>
pub async fn list_ipsec_sa(&self) -> Result<Vec<IpsecSa>, CoreError>
pub fn get_vpn_health(&self) -> Option<HealthSummary>
pub async fn get_sysinfo(&self) -> Result<SysInfo, CoreError>
pub async fn list_vpn_settings(&self) -> Result<Vec<VpnSetting>, CoreError>
pub async fn get_vpn_setting(&self, key: &str) -> Result<VpnSetting, CoreError>
pub async fn update_vpn_setting( &self, key: &str, body: &Value, ) -> Result<VpnSetting, CoreError>
pub async fn get_all_site_settings(&self) -> Result<Vec<Value>, CoreError>
pub async fn get_site_setting(&self, key: &str) -> Result<Value, CoreError>
pub async fn update_site_setting( &self, key: &str, body: &Value, ) -> Result<(), CoreError>
Sourcepub async fn raw_get(&self, path: &str) -> Result<Value, CoreError>
pub async fn raw_get(&self, path: &str) -> Result<Value, CoreError>
Send a raw GET request to an arbitrary path on the controller.
The path is appended to the controller base URL + platform prefix
(e.g. /proxy/network/). The response is returned as raw JSON
without session envelope unwrapping.
Sourcepub async fn raw_post(
&self,
path: &str,
body: &Value,
) -> Result<Value, CoreError>
pub async fn raw_post( &self, path: &str, body: &Value, ) -> Result<Value, CoreError>
Send a raw POST request to an arbitrary path on the controller.
Sourcepub async fn raw_put(
&self,
path: &str,
body: &Value,
) -> Result<Value, CoreError>
pub async fn raw_put( &self, path: &str, body: &Value, ) -> Result<Value, CoreError>
Send a raw PUT request to an arbitrary path on the controller.
Source§impl Controller
impl Controller
Sourcepub fn connection_state(&self) -> Receiver<ConnectionState>
pub fn connection_state(&self) -> Receiver<ConnectionState>
Subscribe to connection state changes.
pub fn devices_snapshot(&self) -> Arc<Vec<Arc<Device>>>
pub fn clients_snapshot(&self) -> Arc<Vec<Arc<Client>>>
pub fn networks_snapshot(&self) -> Arc<Vec<Arc<Network>>>
pub fn wifi_broadcasts_snapshot(&self) -> Arc<Vec<Arc<WifiBroadcast>>>
pub fn firewall_policies_snapshot(&self) -> Arc<Vec<Arc<FirewallPolicy>>>
pub fn firewall_zones_snapshot(&self) -> Arc<Vec<Arc<FirewallZone>>>
pub fn acl_rules_snapshot(&self) -> Arc<Vec<Arc<AclRule>>>
pub fn nat_policies_snapshot(&self) -> Arc<Vec<Arc<NatPolicy>>>
pub fn dns_policies_snapshot(&self) -> Arc<Vec<Arc<DnsPolicy>>>
pub fn vouchers_snapshot(&self) -> Arc<Vec<Arc<Voucher>>>
pub fn sites_snapshot(&self) -> Arc<Vec<Arc<Site>>>
pub fn events_snapshot(&self) -> Arc<Vec<Arc<Event>>>
pub fn traffic_matching_lists_snapshot( &self, ) -> Arc<Vec<Arc<TrafficMatchingList>>>
pub fn devices(&self) -> EntityStream<Device>
pub fn clients(&self) -> EntityStream<Client>
pub fn networks(&self) -> EntityStream<Network>
pub fn wifi_broadcasts(&self) -> EntityStream<WifiBroadcast>
pub fn firewall_policies(&self) -> EntityStream<FirewallPolicy>
pub fn firewall_zones(&self) -> EntityStream<FirewallZone>
pub fn acl_rules(&self) -> EntityStream<AclRule>
pub fn nat_policies(&self) -> EntityStream<NatPolicy>
pub fn dns_policies(&self) -> EntityStream<DnsPolicy>
pub fn vouchers(&self) -> EntityStream<Voucher>
pub fn sites(&self) -> EntityStream<Site>
pub fn traffic_matching_lists(&self) -> EntityStream<TrafficMatchingList>
Sourcepub fn site_health(&self) -> Receiver<Arc<Vec<HealthSummary>>>
pub fn site_health(&self) -> Receiver<Arc<Vec<HealthSummary>>>
Subscribe to site health updates (WAN IP, latency, bandwidth rates).
Sourcepub async fn take_warnings(&self) -> Vec<String>
pub async fn take_warnings(&self) -> Vec<String>
Drain warnings accumulated during connect (e.g. Session auth failure).
Sourcepub async fn has_session_access(&self) -> bool
pub async fn has_session_access(&self) -> bool
Whether any Session API client is available.
Sourcepub async fn has_live_event_access(&self) -> bool
pub async fn has_live_event_access(&self) -> bool
Whether live event streaming is available via a cookie-backed session.
Sourcepub async fn has_integration_access(&self) -> bool
pub async fn has_integration_access(&self) -> bool
Whether the Integration API is available for integration-backed features.
Source§impl Controller
impl Controller
Sourcepub fn new(config: ControllerConfig) -> Self
pub fn new(config: ControllerConfig) -> Self
Create a new Controller from configuration. Does NOT connect –
call connect() to authenticate and start background tasks.
Sourcepub fn config(&self) -> &ControllerConfig
pub fn config(&self) -> &ControllerConfig
Access the controller configuration.
Sourcepub async fn execute(&self, cmd: Command) -> Result<CommandResult, CoreError>
pub async fn execute(&self, cmd: Command) -> Result<CommandResult, CoreError>
Execute a command against the controller.
Sends the command through the internal channel to the command processor task and awaits the result.
Sourcepub async fn oneshot<F, Fut, T>(
config: ControllerConfig,
f: F,
) -> Result<T, CoreError>
pub async fn oneshot<F, Fut, T>( config: ControllerConfig, f: F, ) -> Result<T, CoreError>
One-shot: connect, run closure, disconnect.
Optimized for CLI: disables WebSocket and periodic refresh since we only need a single request-response cycle.
Trait Implementations§
Source§impl Clone for Controller
impl Clone for Controller
Source§fn clone(&self) -> Controller
fn clone(&self) -> Controller
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more