Python Asyncio Client for IP Fabric
This package contains a Python 3.8+ asyncio client for use wih the IP Fabric product.
Installating aio-ipfabric and supported versions
aio-ipfabric is available on PyPI:
pip install aio-ipfabric
Direct installation
pip install git+https://github.com/jeremyschulman/aio-ipfabric@master#egg=aio-ipfabric
Requests officially supports Python 3.8+.
Quick Start
from aioipfabric import IPFabricClient
async def demo_1_devices_list():
"""
Example code that uses IPFabricClient without contextmanager
"""
ipf = IPFabricClient()
await ipf.login()
device_list = await ipf.fetch_devices()
await ipf.logout()
return device_list
async def demo_2_devices_list():
"""
Example code that uses IPFabricClient as contextmanager
"""
async with IPFabricClient() as ipf:
return await ipf.fetch_devices()
Environment Variables
The following environment variable can be used so that you do no need to
provide them in your program:
IPF_ADDR
- IP Fabric server URL, for example "https://my-ipfabric-server.com/"IPF_USERNAME
- Login usernameIPF_PASSWORD
- Login passwordIPF_TOKEN
- A persistent API token
You can use either the login credentials or the token to login.
If you prefer not to use environment variables, the call to IPFabricClient()
accepts
parameters; refer to the help(IPFabricClient)
for details.
Documentation
See the docs directory.