pub struct IntegrationClient { /* private fields */ }Expand description
Async client for the UniFi Integration API.
Uses API-key authentication and communicates via JSON REST endpoints
under /integration/v1/.
Implementations§
Source§impl IntegrationClient
impl IntegrationClient
Sourcepub fn from_api_key(
base_url: &str,
api_key: &SecretString,
transport: &TransportConfig,
platform: ControllerPlatform,
) -> Result<Self, Error>
pub fn from_api_key( base_url: &str, api_key: &SecretString, transport: &TransportConfig, platform: ControllerPlatform, ) -> Result<Self, Error>
Build from an API key, transport config, and detected platform.
Injects X-API-KEY as a default header on every request.
On UniFi OS the base path is /proxy/network/integration/;
on standalone controllers it’s just /integration/.
Sourcepub fn from_reqwest(
base_url: &str,
http: Client,
platform: ControllerPlatform,
) -> Result<Self, Error>
pub fn from_reqwest( base_url: &str, http: Client, platform: ControllerPlatform, ) -> Result<Self, Error>
Wrap an existing reqwest::Client (caller manages auth headers).
Sourcepub async fn paginate_all<T, F, Fut>(
&self,
limit: i32,
fetch: F,
) -> Result<Vec<T>, Error>
pub async fn paginate_all<T, F, Fut>( &self, limit: i32, fetch: F, ) -> Result<Vec<T>, Error>
Collect all pages into a single Vec<T>.
pub async fn get_info(&self) -> Result<ApplicationInfoResponse, Error>
pub async fn list_sites( &self, offset: i64, limit: i32, ) -> Result<Page<SiteResponse>, Error>
pub async fn list_devices( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DeviceResponse>, Error>
pub async fn get_device( &self, site_id: &Uuid, device_id: &Uuid, ) -> Result<DeviceDetailsResponse, Error>
pub async fn get_device_statistics( &self, site_id: &Uuid, device_id: &Uuid, ) -> Result<DeviceStatisticsResponse, Error>
pub async fn adopt_device( &self, site_id: &Uuid, mac: &str, ) -> Result<DeviceDetailsResponse, Error>
pub async fn remove_device( &self, site_id: &Uuid, device_id: &Uuid, ) -> Result<(), Error>
pub async fn device_action( &self, site_id: &Uuid, device_id: &Uuid, action: &str, ) -> Result<(), Error>
pub async fn port_action( &self, site_id: &Uuid, device_id: &Uuid, port_idx: u32, action: &str, ) -> Result<(), Error>
pub async fn list_pending_devices( &self, offset: i64, limit: i32, ) -> Result<Page<PendingDeviceResponse>, Error>
pub async fn list_clients( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<ClientResponse>, Error>
pub async fn get_client( &self, site_id: &Uuid, client_id: &Uuid, ) -> Result<ClientDetailsResponse, Error>
pub async fn client_action( &self, site_id: &Uuid, client_id: &Uuid, action: &str, ) -> Result<ClientActionResponse, Error>
pub async fn list_networks( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<NetworkResponse>, Error>
pub async fn get_network( &self, site_id: &Uuid, network_id: &Uuid, ) -> Result<NetworkDetailsResponse, Error>
pub async fn create_network( &self, site_id: &Uuid, body: &NetworkCreateUpdate, ) -> Result<NetworkDetailsResponse, Error>
pub async fn update_network( &self, site_id: &Uuid, network_id: &Uuid, body: &NetworkCreateUpdate, ) -> Result<NetworkDetailsResponse, Error>
pub async fn delete_network( &self, site_id: &Uuid, network_id: &Uuid, ) -> Result<(), Error>
pub async fn get_network_references( &self, site_id: &Uuid, network_id: &Uuid, ) -> Result<NetworkReferencesResponse, Error>
pub async fn list_wifi_broadcasts( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<WifiBroadcastResponse>, Error>
pub async fn get_wifi_broadcast( &self, site_id: &Uuid, broadcast_id: &Uuid, ) -> Result<WifiBroadcastDetailsResponse, Error>
pub async fn create_wifi_broadcast( &self, site_id: &Uuid, body: &WifiBroadcastCreateUpdate, ) -> Result<WifiBroadcastDetailsResponse, Error>
pub async fn update_wifi_broadcast( &self, site_id: &Uuid, broadcast_id: &Uuid, body: &WifiBroadcastCreateUpdate, ) -> Result<WifiBroadcastDetailsResponse, Error>
pub async fn delete_wifi_broadcast( &self, site_id: &Uuid, broadcast_id: &Uuid, ) -> Result<(), Error>
pub async fn list_firewall_policies( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<FirewallPolicyResponse>, Error>
pub async fn get_firewall_policy( &self, site_id: &Uuid, policy_id: &Uuid, ) -> Result<FirewallPolicyResponse, Error>
pub async fn create_firewall_policy( &self, site_id: &Uuid, body: &FirewallPolicyCreateUpdate, ) -> Result<FirewallPolicyResponse, Error>
pub async fn update_firewall_policy( &self, site_id: &Uuid, policy_id: &Uuid, body: &FirewallPolicyCreateUpdate, ) -> Result<FirewallPolicyResponse, Error>
pub async fn patch_firewall_policy( &self, site_id: &Uuid, policy_id: &Uuid, body: &FirewallPolicyPatch, ) -> Result<FirewallPolicyResponse, Error>
pub async fn delete_firewall_policy( &self, site_id: &Uuid, policy_id: &Uuid, ) -> Result<(), Error>
pub async fn get_firewall_policy_ordering( &self, site_id: &Uuid, ) -> Result<FirewallPolicyOrdering, Error>
pub async fn set_firewall_policy_ordering( &self, site_id: &Uuid, body: &FirewallPolicyOrdering, ) -> Result<FirewallPolicyOrdering, Error>
pub async fn list_firewall_zones( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<FirewallZoneResponse>, Error>
pub async fn get_firewall_zone( &self, site_id: &Uuid, zone_id: &Uuid, ) -> Result<FirewallZoneResponse, Error>
pub async fn create_firewall_zone( &self, site_id: &Uuid, body: &FirewallZoneCreateUpdate, ) -> Result<FirewallZoneResponse, Error>
pub async fn update_firewall_zone( &self, site_id: &Uuid, zone_id: &Uuid, body: &FirewallZoneCreateUpdate, ) -> Result<FirewallZoneResponse, Error>
pub async fn delete_firewall_zone( &self, site_id: &Uuid, zone_id: &Uuid, ) -> Result<(), Error>
pub async fn list_acl_rules( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<AclRuleResponse>, Error>
pub async fn get_acl_rule( &self, site_id: &Uuid, rule_id: &Uuid, ) -> Result<AclRuleResponse, Error>
pub async fn create_acl_rule( &self, site_id: &Uuid, body: &AclRuleCreateUpdate, ) -> Result<AclRuleResponse, Error>
pub async fn update_acl_rule( &self, site_id: &Uuid, rule_id: &Uuid, body: &AclRuleCreateUpdate, ) -> Result<AclRuleResponse, Error>
pub async fn delete_acl_rule( &self, site_id: &Uuid, rule_id: &Uuid, ) -> Result<(), Error>
pub async fn get_acl_rule_ordering( &self, site_id: &Uuid, ) -> Result<AclRuleOrdering, Error>
pub async fn set_acl_rule_ordering( &self, site_id: &Uuid, body: &AclRuleOrdering, ) -> Result<AclRuleOrdering, Error>
pub async fn list_dns_policies( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DnsPolicyResponse>, Error>
pub async fn get_dns_policy( &self, site_id: &Uuid, dns_id: &Uuid, ) -> Result<DnsPolicyResponse, Error>
pub async fn create_dns_policy( &self, site_id: &Uuid, body: &DnsPolicyCreateUpdate, ) -> Result<DnsPolicyResponse, Error>
pub async fn update_dns_policy( &self, site_id: &Uuid, dns_id: &Uuid, body: &DnsPolicyCreateUpdate, ) -> Result<DnsPolicyResponse, Error>
pub async fn delete_dns_policy( &self, site_id: &Uuid, dns_id: &Uuid, ) -> Result<(), Error>
pub async fn list_traffic_matching_lists( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<TrafficMatchingListResponse>, Error>
pub async fn get_traffic_matching_list( &self, site_id: &Uuid, list_id: &Uuid, ) -> Result<TrafficMatchingListResponse, Error>
pub async fn create_traffic_matching_list( &self, site_id: &Uuid, body: &TrafficMatchingListCreateUpdate, ) -> Result<TrafficMatchingListResponse, Error>
pub async fn update_traffic_matching_list( &self, site_id: &Uuid, list_id: &Uuid, body: &TrafficMatchingListCreateUpdate, ) -> Result<TrafficMatchingListResponse, Error>
pub async fn delete_traffic_matching_list( &self, site_id: &Uuid, list_id: &Uuid, ) -> Result<(), Error>
pub async fn list_vouchers( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<VoucherResponse>, Error>
pub async fn get_voucher( &self, site_id: &Uuid, voucher_id: &Uuid, ) -> Result<VoucherResponse, Error>
pub async fn create_vouchers( &self, site_id: &Uuid, body: &VoucherCreateRequest, ) -> Result<Vec<VoucherResponse>, Error>
pub async fn delete_voucher( &self, site_id: &Uuid, voucher_id: &Uuid, ) -> Result<VoucherDeletionResults, Error>
pub async fn purge_vouchers( &self, site_id: &Uuid, filter: &str, ) -> Result<VoucherDeletionResults, Error>
pub async fn list_vpn_servers( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<VpnServerResponse>, Error>
pub async fn list_vpn_tunnels( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<VpnTunnelResponse>, Error>
pub async fn list_wans( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<WanResponse>, Error>
pub async fn list_dpi_categories( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DpiCategoryResponse>, Error>
pub async fn list_dpi_applications( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DpiApplicationResponse>, Error>
pub async fn list_radius_profiles( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<RadiusProfileResponse>, Error>
pub async fn list_countries( &self, offset: i64, limit: i32, ) -> Result<Page<CountryResponse>, Error>
Auto Trait Implementations§
impl Freeze for IntegrationClient
impl !RefUnwindSafe for IntegrationClient
impl Send for IntegrationClient
impl Sync for IntegrationClient
impl Unpin for IntegrationClient
impl !UnwindSafe for IntegrationClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more