Skip to main content

IntegrationClient

Struct IntegrationClient 

Source
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

Source

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/.

Source

pub fn from_reqwest( base_url: &str, http: Client, platform: ControllerPlatform, ) -> Result<Self, Error>

Wrap an existing reqwest::Client (caller manages auth headers).

Source

pub async fn paginate_all<T, F, Fut>( &self, limit: i32, fetch: F, ) -> Result<Vec<T>, Error>
where F: Fn(i64, i32) -> Fut, Fut: Future<Output = Result<Page<T>, Error>>,

Collect all pages into a single Vec<T>.

Source

pub async fn get_info(&self) -> Result<ApplicationInfoResponse, Error>

Source

pub async fn list_sites( &self, offset: i64, limit: i32, ) -> Result<Page<SiteResponse>, Error>

Source

pub async fn list_devices( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DeviceResponse>, Error>

Source

pub async fn get_device( &self, site_id: &Uuid, device_id: &Uuid, ) -> Result<DeviceDetailsResponse, Error>

Source

pub async fn get_device_statistics( &self, site_id: &Uuid, device_id: &Uuid, ) -> Result<DeviceStatisticsResponse, Error>

Source

pub async fn adopt_device( &self, site_id: &Uuid, mac: &str, ignore_device_limit: bool, ) -> Result<DeviceDetailsResponse, Error>

Source

pub async fn remove_device( &self, site_id: &Uuid, device_id: &Uuid, ) -> Result<(), Error>

Source

pub async fn device_action( &self, site_id: &Uuid, device_id: &Uuid, action: &str, ) -> Result<(), Error>

Source

pub async fn port_action( &self, site_id: &Uuid, device_id: &Uuid, port_idx: u32, action: &str, ) -> Result<(), Error>

Source

pub async fn list_pending_devices( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<PendingDeviceResponse>, Error>

Source

pub async fn list_device_tags( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DeviceTagResponse>, Error>

Source

pub async fn list_clients( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<ClientResponse>, Error>

Source

pub async fn get_client( &self, site_id: &Uuid, client_id: &Uuid, ) -> Result<ClientDetailsResponse, Error>

Source

pub async fn client_action( &self, site_id: &Uuid, client_id: &Uuid, action: &str, ) -> Result<ClientActionResponse, Error>

Source

pub async fn list_networks( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<NetworkResponse>, Error>

Source

pub async fn get_network( &self, site_id: &Uuid, network_id: &Uuid, ) -> Result<NetworkDetailsResponse, Error>

Source

pub async fn create_network( &self, site_id: &Uuid, body: &NetworkCreateUpdate, ) -> Result<NetworkDetailsResponse, Error>

Source

pub async fn update_network( &self, site_id: &Uuid, network_id: &Uuid, body: &NetworkCreateUpdate, ) -> Result<NetworkDetailsResponse, Error>

Source

pub async fn delete_network( &self, site_id: &Uuid, network_id: &Uuid, ) -> Result<(), Error>

Source

pub async fn get_network_references( &self, site_id: &Uuid, network_id: &Uuid, ) -> Result<NetworkReferencesResponse, Error>

Source

pub async fn list_wifi_broadcasts( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<WifiBroadcastResponse>, Error>

Source

pub async fn get_wifi_broadcast( &self, site_id: &Uuid, broadcast_id: &Uuid, ) -> Result<WifiBroadcastDetailsResponse, Error>

Source

pub async fn create_wifi_broadcast( &self, site_id: &Uuid, body: &WifiBroadcastCreateUpdate, ) -> Result<WifiBroadcastDetailsResponse, Error>

Source

pub async fn update_wifi_broadcast( &self, site_id: &Uuid, broadcast_id: &Uuid, body: &WifiBroadcastCreateUpdate, ) -> Result<WifiBroadcastDetailsResponse, Error>

Source

pub async fn delete_wifi_broadcast( &self, site_id: &Uuid, broadcast_id: &Uuid, ) -> Result<(), Error>

Source

pub async fn list_firewall_policies( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<FirewallPolicyResponse>, Error>

Source

pub async fn get_firewall_policy( &self, site_id: &Uuid, policy_id: &Uuid, ) -> Result<FirewallPolicyResponse, Error>

Source

pub async fn create_firewall_policy( &self, site_id: &Uuid, body: &FirewallPolicyCreateUpdate, ) -> Result<FirewallPolicyResponse, Error>

Source

pub async fn update_firewall_policy( &self, site_id: &Uuid, policy_id: &Uuid, body: &FirewallPolicyCreateUpdate, ) -> Result<FirewallPolicyResponse, Error>

Source

pub async fn patch_firewall_policy( &self, site_id: &Uuid, policy_id: &Uuid, body: &FirewallPolicyPatch, ) -> Result<FirewallPolicyResponse, Error>

Source

pub async fn delete_firewall_policy( &self, site_id: &Uuid, policy_id: &Uuid, ) -> Result<(), Error>

Source

pub async fn get_firewall_policy_ordering( &self, site_id: &Uuid, ) -> Result<FirewallPolicyOrdering, Error>

Source

pub async fn set_firewall_policy_ordering( &self, site_id: &Uuid, body: &FirewallPolicyOrdering, ) -> Result<FirewallPolicyOrdering, Error>

Source

pub async fn list_firewall_zones( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<FirewallZoneResponse>, Error>

Source

pub async fn get_firewall_zone( &self, site_id: &Uuid, zone_id: &Uuid, ) -> Result<FirewallZoneResponse, Error>

Source

pub async fn create_firewall_zone( &self, site_id: &Uuid, body: &FirewallZoneCreateUpdate, ) -> Result<FirewallZoneResponse, Error>

Source

pub async fn update_firewall_zone( &self, site_id: &Uuid, zone_id: &Uuid, body: &FirewallZoneCreateUpdate, ) -> Result<FirewallZoneResponse, Error>

Source

pub async fn delete_firewall_zone( &self, site_id: &Uuid, zone_id: &Uuid, ) -> Result<(), Error>

Source

pub async fn list_acl_rules( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<AclRuleResponse>, Error>

Source

pub async fn get_acl_rule( &self, site_id: &Uuid, rule_id: &Uuid, ) -> Result<AclRuleResponse, Error>

Source

pub async fn create_acl_rule( &self, site_id: &Uuid, body: &AclRuleCreateUpdate, ) -> Result<AclRuleResponse, Error>

Source

pub async fn update_acl_rule( &self, site_id: &Uuid, rule_id: &Uuid, body: &AclRuleCreateUpdate, ) -> Result<AclRuleResponse, Error>

Source

pub async fn delete_acl_rule( &self, site_id: &Uuid, rule_id: &Uuid, ) -> Result<(), Error>

Source

pub async fn get_acl_rule_ordering( &self, site_id: &Uuid, ) -> Result<AclRuleOrdering, Error>

Source

pub async fn set_acl_rule_ordering( &self, site_id: &Uuid, body: &AclRuleOrdering, ) -> Result<AclRuleOrdering, Error>

Source

pub async fn list_dns_policies( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DnsPolicyResponse>, Error>

Source

pub async fn get_dns_policy( &self, site_id: &Uuid, dns_id: &Uuid, ) -> Result<DnsPolicyResponse, Error>

Source

pub async fn create_dns_policy( &self, site_id: &Uuid, body: &DnsPolicyCreateUpdate, ) -> Result<DnsPolicyResponse, Error>

Source

pub async fn update_dns_policy( &self, site_id: &Uuid, dns_id: &Uuid, body: &DnsPolicyCreateUpdate, ) -> Result<DnsPolicyResponse, Error>

Source

pub async fn delete_dns_policy( &self, site_id: &Uuid, dns_id: &Uuid, ) -> Result<(), Error>

Source

pub async fn list_traffic_matching_lists( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<TrafficMatchingListResponse>, Error>

Source

pub async fn get_traffic_matching_list( &self, site_id: &Uuid, list_id: &Uuid, ) -> Result<TrafficMatchingListResponse, Error>

Source

pub async fn create_traffic_matching_list( &self, site_id: &Uuid, body: &TrafficMatchingListCreateUpdate, ) -> Result<TrafficMatchingListResponse, Error>

Source

pub async fn update_traffic_matching_list( &self, site_id: &Uuid, list_id: &Uuid, body: &TrafficMatchingListCreateUpdate, ) -> Result<TrafficMatchingListResponse, Error>

Source

pub async fn delete_traffic_matching_list( &self, site_id: &Uuid, list_id: &Uuid, ) -> Result<(), Error>

Source

pub async fn list_vouchers( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<VoucherResponse>, Error>

Source

pub async fn get_voucher( &self, site_id: &Uuid, voucher_id: &Uuid, ) -> Result<VoucherResponse, Error>

Source

pub async fn create_vouchers( &self, site_id: &Uuid, body: &VoucherCreateRequest, ) -> Result<Vec<VoucherResponse>, Error>

Source

pub async fn delete_voucher( &self, site_id: &Uuid, voucher_id: &Uuid, ) -> Result<VoucherDeletionResults, Error>

Source

pub async fn purge_vouchers( &self, site_id: &Uuid, filter: &str, ) -> Result<VoucherDeletionResults, Error>

Source

pub async fn list_vpn_servers( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<VpnServerResponse>, Error>

Source

pub async fn list_vpn_tunnels( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<VpnTunnelResponse>, Error>

Source

pub async fn list_wans( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<WanResponse>, Error>

Source

pub async fn list_dpi_categories( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DpiCategoryResponse>, Error>

Source

pub async fn list_dpi_applications( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<DpiApplicationResponse>, Error>

Source

pub async fn list_radius_profiles( &self, site_id: &Uuid, offset: i64, limit: i32, ) -> Result<Page<RadiusProfileResponse>, Error>

Source

pub async fn list_countries( &self, offset: i64, limit: i32, ) -> Result<Page<CountryResponse>, Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more