Python client for the pfSense-FauxAPI on a pfSense host
Project description
PfsenseFauxapi - Python Interface
Python client for pfSense-FauxAPI - https://github.com/ndejong/pfsense_fauxapi
Install
via PyPi
pip3 install pfsense-fauxapi
Install via Source
# obtain the source material
git clone https://github.com/ndejong/pfsense_fauxapi_client_python.git
cd pfsense_fauxapi_client_python
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
python3 setup.py clean
python3 setup.py test
python3 setup.py install
Code Examples
Three Python code samples are provided that demonstrate interface usage
function-iterate.py
- iterates (almost) all the FauxAPI functions to confirm operation.update-aws-aliases.py
- downloads the latest AWSip-ranges.json
and populates the pfsense alias table(s).usergroup-management.py
- demonstrates the ability to manage users and groups programmatically.
Command Line
Additionally this pip-package provides a command-line interface to work with FauxAPI
usage: fauxapi [-h] [--host [host]] [--apikey [key]] [--apisecret [secret]]
[--verified-ssl] [--debug]
[function] [[function] ...] [[function-args]]
FauxAPI
optional arguments:
-h, --help show this help message and exit
Call:
--host [host] Host address of the target pfSense host with the
PfsenseFauxapi package installed.
--apikey [key] FauxAPI apikey value - alternatively via the
FAUXAPI_APIKEY environment variable.
--apisecret [secret] FauxAPI apisecret value - alternatively via the
FAUXAPI_APIKEY environment variable.
--verified-ssl Enable SSL certificate checks - default does NOT check
SSL certificates.
--debug Enable debug response from the remote FauxAPI -
helpful in tracking down issues.
[function] The FauxAPI function being called
[function-args] Arguments to the function, space separated
Command line example, using environment variables to pass the FAUXAPI_APIKEY
and FAUXAPI_APIKEY
credentials.
$ fauxapi --host 192.168.1.200 gateway_status | jq .
{
"callid": "5c8d0f7361cba",
"action": "gateway_status",
"message": "ok",
"data": {
"gateway_status": {
"10.11.12.1": {
"monitorip": "10.10.10.1",
"srcip": "10.10.10.200",
"name": "WAN_DHCP",
"delay": "0.422ms",
"stddev": "0.073ms",
"loss": "0.0%",
"status": "none"
}
}
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for pfsense-fauxapi-20200531.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4dcd86f2a14c3e4126a2d7ae0bd979dfe9d50cb08dcbab1d8dd0b1b65fc2e19 |
|
MD5 | 6fffd9e28be930d2c011c1e93bd33c2c |
|
BLAKE2b-256 | 774f216013636ea973aed41c65a1c5e681041ce1403be334f4cbc6e66467aa6b |
Close
Hashes for pfsense_fauxapi-20200531.1-py3.8.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 429ae50981ac7d84f19b333c7352eb3ce86f2e34734b153fe473a2c5f4eafdcb |
|
MD5 | a9a965c28e06a8c84012a1dcf87571e1 |
|
BLAKE2b-256 | eca045bfd61f356d66ce2a6e78920b4bdf8da615181315c0cd092bd68eb02c37 |
Close
Hashes for pfsense_fauxapi-20200531.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c2a6bbe78d137484582c5d730f2618ce4235ac1fc16df2fd8a5a121c0502e3e |
|
MD5 | 765de7c96a69d298d01f8af2be44abc7 |
|
BLAKE2b-256 | 6398d770938b39db6e509cdcf4580061ed9c417ba38d600c7f3ca63dd1ed54ae |