Package: barracuda-api
Barracuda APIThis is a more convenient wrapper around the Barracuda REST api than using plain REST API methods. Following methods are implemented:add/get/delete listsadd/get/delete network objectsadd/get/delete service objectsadd/get/delete firewall rulesTests(py310_venv)peter\barracuda-api\coverage run -m pytest=========================== test session starts ===========================platform win32 -- Python 3.10.5, pytest-6.2.5, py-1.11.0, pluggy-1.0.0rootdir: peter\barracuda-apicollected 19 itemstests\test_01_box_info.py ...tests\test_02_ff_lists.py .....tests\test_03_ff_networks.py .......tests\test_04_ff_services.py ........tests\test_05_ff_rules.py ............=========================== 35 passed in 4.06s ===========================(py310_venv)peter\barracuda-api\coverage report -mName                           Stmts   Miss  Cover   Missing------------------------------------------------------------barracuda_api\__init__.py          9      0   100%barracuda_api\barracuda.py       199      2    99%   101, 112barracuda_api\endpoints.py        15      0   100%barracuda_api\exceptions.py       12      0   100%tests\__init__.py                  1      0   100%tests\test_01_box_info.py         22      0   100%tests\test_02_ff_lists.py         38      0   100%tests\test_03_ff_networks.py      64      0   100%tests\test_04_ff_services.py      56      0   100%tests\test_05_ff_rules.py         86      0   100%------------------------------------------------------------TOTAL                            502      2    99%Build wheel (recommended over an egg)(py310_venv)peter\barracuda-api\pip wheel .Processing peter\barracuda-apiPreparing metadata (setup.py) ... doneBuilding wheels for collected packages: barracuda-apiBuilding wheel for barracuda-api (setup.py) ... doneCreated wheel for barracuda-api: filename=barracuda_api-0.2-py3-none-any.whl size=13749 sha256=789fe40d9c08c1826e5c7a0d34168f68fa4cee5c16d59341bb4ff10b2998bb63Stored in directory: c:\users\peter210\appdata\local\pip\cache\wheels\72\a4\9b\2789e9879d99a602283d1ae10b9abf2cba8442fd7cfbc876a5Successfully built barracuda-apipeter\barracuda-api\python setup.py bdist_wheelrunning bdist_wheelrunning buildrunning build_pyinstalling to build\bdist.win-amd64\wheelrunning installrunning install_libcreating build\bdist.win-amd64\wheelcreating build\bdist.win-amd64\wheel\barracuda_apicopying build\lib\barracuda_api\barracuda.py -> build\bdist.win-amd64\wheel\.\barracuda_apicopying build\lib\barracuda_api\endpoints.py -> build\bdist.win-amd64\wheel\.\barracuda_apicopying build\lib\barracuda_api\exceptions.py -> build\bdist.win-amd64\wheel\.\barracuda_apicopying build\lib\barracuda_api\__init__.py -> build\bdist.win-amd64\wheel\.\barracuda_apicreating build\bdist.win-amd64\wheel\testscopying build\lib\tests\test_01_box_info.py -> build\bdist.win-amd64\wheel\.\testscopying build\lib\tests\test_02_ff_lists copy.py -> build\bdist.win-amd64\wheel\.\testscopying build\lib\tests\test_02_ff_lists.py -> build\bdist.win-amd64\wheel\.\testscopying build\lib\tests\test_03_ff_networks.py -> build\bdist.win-amd64\wheel\.\testscopying build\lib\tests\test_04_ff_services.py -> build\bdist.win-amd64\wheel\.\testscopying build\lib\tests\test_05_ff_rules.py -> build\bdist.win-amd64\wheel\.\testscopying build\lib\tests\__init__.py -> build\bdist.win-amd64\wheel\.\testsrunning install_egg_inforunning egg_infowriting barracuda_api.egg-info\PKG-INFOwriting dependency_links to barracuda_api.egg-info\dependency_links.txtwriting top-level names to barracuda_api.egg-info\top_level.txtreading manifest file 'barracuda_api.egg-info\SOURCES.txt'writing manifest file 'barracuda_api.egg-info\SOURCES.txt'Copying barracuda_api.egg-info to build\bdist.win-amd64\wheel\.\barracuda_api-0.1-py3.10.egg-inforunning install_scriptscreating build\bdist.win-amd64\wheel\barracuda_api-0.1.dist-info\WHEELcreating 'dist\barracuda_api-0.1-py3-none-any.whl' and adding 'build\bdist.win-amd64\wheel' to itadding 'barracuda_api/__init__.py'adding 'barracuda_api/barracuda.py'adding 'barracuda_api/endpoints.py'adding 'barracuda_api/exceptions.py'adding 'tests/__init__.py'adding 'tests/test_01_box_info.py'adding 'tests/test_02_ff_lists copy.py'adding 'tests/test_02_ff_lists.py'adding 'tests/test_03_ff_networks.py'adding 'tests/test_04_ff_services.py'adding 'tests/test_05_ff_rules.py'adding 'barracuda_api-0.1.dist-info/METADATA'adding 'barracuda_api-0.1.dist-info/WHEEL'adding 'barracuda_api-0.1.dist-info/top_level.txt'adding 'barracuda_api-0.1.dist-info/RECORD'removing build\bdist.win-amd64\wheelInstallation(py310_venv)peter\barracuda-api\pip install .Processing peter\barracuda-apiPreparing metadata (setup.py) ... doneBuilding wheels for collected packages: barracuda-apiBuilding wheel for barracuda-api (setup.py) ... doneCreated wheel for barracuda-api: filename=barracuda_api-0.2-py3-none-any.whl size=13750 sha256=31750ac6cb23266159453a68d0e499b005a6208ea9db1bdaab1be35ab42ed13cStored in directory: c:\users\peter210\appdata\local\pip\cache\wheels\72\a4\9b\2789e9879d99a602283d1ae10b9abf2cba8442fd7cfbc876a5Successfully built barracuda-apiInstalling collected packages: barracuda-apiAttempting uninstall: barracuda-apiFound existing installation: barracuda-api 0.1Uninstalling barracuda-api-0.1:Successfully uninstalled barracuda-api-0.1Successfully installed barracuda-api-0.2Basic usagefrom barracuda_api.barracuda import BarracudaSession

cc_ip = "10.2.3.4"

with BarracudaSession(
    cc_ip, "apitoken", endpoint_port=8443, debug=False
) as bs:
    cc_info = bs.get_box_info()
    print(cc_info)