Struct pi_hole_api::PiHoleAPIConfigWithKey
source · [−]pub struct PiHoleAPIConfigWithKey { /* private fields */ }
Expand description
Pi Hole API Struct
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for PiHoleAPIConfigWithKey
impl Send for PiHoleAPIConfigWithKey
impl Sync for PiHoleAPIConfigWithKey
impl Unpin for PiHoleAPIConfigWithKey
impl UnwindSafe for PiHoleAPIConfigWithKey
Blanket Implementations
sourceimpl<T> AuthenticatedPiHoleAPI for T where
T: PiHoleAPIHost + PiHoleAPIKey,
impl<T> AuthenticatedPiHoleAPI for T where
T: PiHoleAPIHost + PiHoleAPIKey,
sourcefn get_top_items(&self, count: &Option<u32>) -> Result<TopItems, APIError>
fn get_top_items(&self, count: &Option<u32>) -> Result<TopItems, APIError>
Get the top domains and ads and the number of queries for each. Limit the number of items with count
.
sourcefn get_top_clients(&self, count: &Option<u32>) -> Result<TopClients, APIError>
fn get_top_clients(&self, count: &Option<u32>) -> Result<TopClients, APIError>
Get the top clients and the number of queries for each. Limit the number of items with count
.
sourcefn get_top_clients_blocked(
&self,
count: Option<u32>
) -> Result<TopClientsBlocked, APIError>
fn get_top_clients_blocked(
&self,
count: Option<u32>
) -> Result<TopClientsBlocked, APIError>
Get the top clients blocked and the number of queries for each. Limit the number of items with count
.
sourcefn get_forward_destinations(
&self,
unsorted: bool
) -> Result<ForwardDestinations, APIError>
fn get_forward_destinations(
&self,
unsorted: bool
) -> Result<ForwardDestinations, APIError>
Get the percentage of queries forwarded to each target.
sourcefn get_query_types(&self) -> Result<QueryTypes, APIError>
fn get_query_types(&self) -> Result<QueryTypes, APIError>
Get the number of queries per type.
sourcefn get_all_queries(&self, count: u32) -> Result<Vec<Query, Global>, APIError>
fn get_all_queries(&self, count: u32) -> Result<Vec<Query, Global>, APIError>
Get all DNS query data. Limit the number of items with count
.
sourcefn disable(&self, seconds: u64) -> Result<Status, APIError>
fn disable(&self, seconds: u64) -> Result<Status, APIError>
Disable the Pi-Hole for seconds
seconds.
sourcefn get_cache_info(&self) -> Result<CacheInfo, APIError>
fn get_cache_info(&self) -> Result<CacheInfo, APIError>
Get statistics about the DNS cache.
sourcefn get_client_names(&self) -> Result<Vec<ClientName, Global>, APIError>
fn get_client_names(&self) -> Result<Vec<ClientName, Global>, APIError>
Get hostname and IP for hosts
sourcefn get_over_time_data_clients(
&self
) -> Result<HashMap<String, Vec<u64, Global>, RandomState>, APIError>
fn get_over_time_data_clients(
&self
) -> Result<HashMap<String, Vec<u64, Global>, RandomState>, APIError>
Get queries by client over time. Maps timestamp to the number of queries by clients. Order of clients in the Vector is the same as for get_client_names Read more
sourcefn get_network(&self) -> Result<Network, APIError>
fn get_network(&self) -> Result<Network, APIError>
Get information about network clients.
sourcefn get_queries_count(&self) -> Result<u64, APIError>
fn get_queries_count(&self) -> Result<u64, APIError>
Get the total number of queries received.
sourcefn list_add(
&self,
domain: &str,
list: &str
) -> Result<ListModificationResponse, APIError>
fn list_add(
&self,
domain: &str,
list: &str
) -> Result<ListModificationResponse, APIError>
Add domains to a custom white/blacklist.
Acceptable lists are: white
, black
, white_regex
, black_regex
, white_wild
, black_wild
, audit
. Read more
sourcefn list_remove(
&self,
domain: &str,
list: &str
) -> Result<ListModificationResponse, APIError>
fn list_remove(
&self,
domain: &str,
list: &str
) -> Result<ListModificationResponse, APIError>
Remove domain to a custom white/blacklist.
Acceptable lists are: white
, black
, white_regex
, black_regex
, white_wild
, black_wild
, audit
. Read more
sourcefn list_get_domains(
&self,
list: &str
) -> Result<Vec<CustomListDomainDetails, Global>, APIError>
fn list_get_domains(
&self,
list: &str
) -> Result<Vec<CustomListDomainDetails, Global>, APIError>
Get a list of domains on a particular custom white/blacklist
Acceptable lists are: white
, black
, white_regex
, black_regex
, white_wild
, black_wild
, audit
. Read more
sourcefn get_custom_dns_records(
&self
) -> Result<Vec<CustomDNSRecord, Global>, APIError>
fn get_custom_dns_records(
&self
) -> Result<Vec<CustomDNSRecord, Global>, APIError>
Get a list of custom DNS records
sourcefn add_custom_dns_record(
&self,
ip: &IpAddr,
domain: &str
) -> Result<ListModificationResponse, APIError>
fn add_custom_dns_record(
&self,
ip: &IpAddr,
domain: &str
) -> Result<ListModificationResponse, APIError>
Add a custom DNS record
sourcefn delete_custom_dns_record(
&self,
ip: &IpAddr,
domain: &str
) -> Result<ListModificationResponse, APIError>
fn delete_custom_dns_record(
&self,
ip: &IpAddr,
domain: &str
) -> Result<ListModificationResponse, APIError>
Delete a custom DNS record
sourcefn get_custom_cname_records(
&self
) -> Result<Vec<CustomCNAMERecord, Global>, APIError>
fn get_custom_cname_records(
&self
) -> Result<Vec<CustomCNAMERecord, Global>, APIError>
Get a list of custom CNAME records
sourcefn add_custom_cname_record(
&self,
domain: &str,
target_domain: &str
) -> Result<ListModificationResponse, APIError>
fn add_custom_cname_record(
&self,
domain: &str,
target_domain: &str
) -> Result<ListModificationResponse, APIError>
Add a custom CNAME record
sourcefn delete_custom_cname_record(
&self,
domain: &str,
target_domain: &str
) -> Result<ListModificationResponse, APIError>
fn delete_custom_cname_record(
&self,
domain: &str,
target_domain: &str
) -> Result<ListModificationResponse, APIError>
Delete a custom CNAME record
sourcefn get_max_logage(&self) -> Result<f32, APIError>
fn get_max_logage(&self) -> Result<f32, APIError>
Get max logage
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> UnauthenticatedPiHoleAPI for T where
T: PiHoleAPIHost,
impl<T> UnauthenticatedPiHoleAPI for T where
T: PiHoleAPIHost,
sourcefn get_version(&self) -> Result<u32, APIError>
fn get_version(&self) -> Result<u32, APIError>
Get simple PiHole version
sourcefn get_versions(&self) -> Result<Versions, APIError>
fn get_versions(&self) -> Result<Versions, APIError>
Get versions of core, FTL and web and if updates are available
sourcefn get_summary_raw(&self) -> Result<SummaryRaw, APIError>
fn get_summary_raw(&self) -> Result<SummaryRaw, APIError>
Get statistics in a raw format (no number format)
sourcefn get_summary(&self) -> Result<Summary, APIError>
fn get_summary(&self) -> Result<Summary, APIError>
Get statistics in a formatted style
sourcefn get_over_time_data_10_mins(&self) -> Result<OverTimeData, APIError>
fn get_over_time_data_10_mins(&self) -> Result<OverTimeData, APIError>
Get statistics on the number of domains and ads for each 10 minute period