platypush/plugins/pihole/__init__.py
def status(self, server: Optional[str] = None, password: Optional[str] = None, api_key: Optional[str] = None,
               ssl: bool = None) \
            -> PiholeStatusResponse:
        """
        Get the status and statistics of a running Pi-hole server.

        :param server: Server IP address (default: default configured ``server`` value).
        :param password: Server password (default: default configured ``password`` value).
        :param api_key: Server API key (default: default configured ``api_key`` value).
        :param ssl: Set to True if the server uses SSL (default: False).
        :return: :class:`platypush.message.response.pihole.PiholeStatusResponse`
        """
        status = requests.get(self._get_url('summary', server=server, password=password, api_key=api_key,
                                            ssl=ssl), verify=self.verify_ssl).json()
        version = requests.get(self._get_url('versions', server=server, password=password, api_key=api_key,
                                             ssl=ssl), verify=self.verify_ssl).json()

        return PiholeStatusResponse(
            server=server or self.server,
            status=PiholeStatus(status.get('status')).value,
            ads_percentage=float(status.get('ads_percentage_today')),
            blocked=self._normalize_number(status.get('ads_blocked_today')),
            cached=self._normalize_number(status.get('queries_cached')),
            domain_count=self._normalize_number(status.get('domains_being_blocked')),
            forwarded=self._normalize_number(status.get('queries_forwarded')),
            queries=self._normalize_number(status.get('dns_queries_today')),
            total_clients=self._normalize_number(status.get('clients_ever_seen')),
            total_queries=self._normalize_number(status.get('dns_queries_all_types')),
            unique_clients=self._normalize_number(status.get('unique_clients')),
            unique_domains=self._normalize_number(status.get('unique_domains')),
            version=version.get('core_current'),
        )

        Get the status and statistics of a running Pi-hole server.

        :param server: Server IP address (default: default configured ``server`` value).
        :param password: Server password (default: default configured ``password`` value).
        :param api_key: Server API key (default: default configured ``api_key`` value).
        :param ssl: Set to True if the server uses SSL (default: False).
        :return: :class:`platypush.message.response.pihole.PiholeStatusResponse`
        
Get the status and statistics of a running Pi-hole server.
Get the status and statistics of a running Pi - hole server .
def status(self, server: Optional[str] = None, password: Optional[str] = None, api_key: Optional[str] = None,
               ssl: bool = None) \
            -> PiholeStatusResponse:
        status = requests.get(self._get_url('summary', server=server, password=password, api_key=api_key,
                                            ssl=ssl), verify=self.verify_ssl).json()
        version = requests.get(self._get_url('versions', server=server, password=password, api_key=api_key,
                                             ssl=ssl), verify=self.verify_ssl).json()
        return PiholeStatusResponse(
            server=server or self.server,
            status=PiholeStatus(status.get('status')).value,
            ads_percentage=float(status.get('ads_percentage_today')),
            blocked=self._normalize_number(status.get('ads_blocked_today')),
            cached=self._normalize_number(status.get('queries_cached')),
            domain_count=self._normalize_number(status.get('domains_being_blocked')),
            forwarded=self._normalize_number(status.get('queries_forwarded')),
            queries=self._normalize_number(status.get('dns_queries_today')),
            total_clients=self._normalize_number(status.get('clients_ever_seen')),
            total_queries=self._normalize_number(status.get('dns_queries_all_types')),
            unique_clients=self._normalize_number(status.get('unique_clients')),
            unique_domains=self._normalize_number(status.get('unique_domains')),
            version=version.get('core_current'),
        )
def status ( self , server : Optional [ str ] = None , password : Optional [ str ] = None , api_key : Optional [ str ] = None , ssl : bool = None ) -> PiholeStatusResponse : status = requests . get ( self . _get_url ( 'summary' , server = server , password = password , api_key = api_key , ssl = ssl ) , verify = self . verify_ssl ) . json ( ) version = requests . get ( self . _get_url ( 'versions' , server = server , password = password , api_key = api_key , ssl = ssl ) , verify = self . verify_ssl ) . json ( ) return PiholeStatusResponse ( server = server or self . server , status = PiholeStatus ( status . get ( 'status' ) ) . value , ads_percentage = float ( status . get ( 'ads_percentage_today' ) ) , blocked = self . _normalize_number ( status . get ( 'ads_blocked_today' ) ) , cached = self . _normalize_number ( status . get ( 'queries_cached' ) ) , domain_count = self . _normalize_number ( status . get ( 'domains_being_blocked' ) ) , forwarded = self . _normalize_number ( status . get ( 'queries_forwarded' ) ) , queries = self . _normalize_number ( status . get ( 'dns_queries_today' ) ) , total_clients = self . _normalize_number ( status . get ( 'clients_ever_seen' ) ) , total_queries = self . _normalize_number ( status . get ( 'dns_queries_all_types' ) ) , unique_clients = self . _normalize_number ( status . get ( 'unique_clients' ) ) , unique_domains = self . _normalize_number ( status . get ( 'unique_domains' ) ) , version = version . get ( 'core_current' ) , )
Get the status and statistics of a running Pi-hole server.
Get the status and statistics of a running Pi - hole server .
"""
        Get the status and statistics of a running Pi-hole server.

        :param server: Server IP address (default: default configured ``server`` value).
        :param password: Server password (default: default configured ``password`` value).
        :param api_key: Server API key (default: default configured ``api_key`` value).
        :param ssl: Set to True if the server uses SSL (default: False).
        :return: :class:`platypush.message.response.pihole.PiholeStatusResponse`
        """
None
self
server
Optional[str]
Server IP address (default: default configured ``server`` value).
Server IP address ( default : default configured ` ` server ` ` value ) .
password
Optional[str]
Server password (default: default configured ``password`` value).
Server password ( default : default configured ` ` password ` ` value ) .
api_key
Optional[str]
Server API key (default: default configured ``api_key`` value).
Server API key ( default : default configured ` ` api_key ` ` value ) .
ssl
bool
Set to True if the server uses SSL (default: False).
Set to True if the server uses SSL ( default : False ) .