Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Python client library for FauxAPI available on PyPi

    Scheduled Pinned Locked Moved pfSense Packages
    1 Posts 1 Posters 436 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      ndj
      last edited by ndj

      Recently pushed PyPi package pfsense-fauxapi that implements a client-side wrapper to the pfSense-FauxAPI package.

      Install using pip:-

      pip3 install pfsense-fauxapi
      

      Check it out here:-
      https://github.com/ndejong/pfsense_fauxapi_client_python

      The pip package additionally wraps the Python interface as a command-line tool thus making FauxAPI calls to pfSense even easier, for example:-

      $ fauxapi --host 192.168.1.200 gateway_status | jq .
      {
        "callid": "5c8d0f7361cba",
        "action": "gateway_status",
        "message": "ok",
        "data": {
          "gateway_status": {
            "10.10.10.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"
            }
          }
        }
      }
      

      The Python client library and the command-line tool support the full set of FauxAPI calls:-

      • alias_update_urltables
      • config_backup
      • config_backup_list
      • config_get
      • config_patch
      • config_reload
      • config_restore
      • config_set
      • function_call
      • gateway_status
      • interface_stats
      • rule_get
      • send_event
      • system_reboot
      • system_stats

      There are now four client-side implementations for FauxAPI to choose from:-

      • Python: https://github.com/ndejong/pfsense_fauxapi_client_python
      • NodeJS: https://github.com/Elucidia/faux-api-client
      • PHP: https://github.com/travisghansen/pfsense_fauxapi_php_client
      • Shell/Bash: https://github.com/ndejong/pfsense_fauxapi_client_bash
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.