Python asyncio client for IP Fabric
Project description
Python Asyncio Client for IP Fabric
This package contains a Python 3.8+ asyncio client for use wih the IP Fabric product.
- About IP Fabric: https://ipfabric.io/
- About IP Fabric API: https://docs.ipfabric.io/api/
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
import asyncio
from aioipfabric import IPFabricClient
loop = asyncio.get_event_loop()
# create a client using environment variables (see next section)
ipf = IPFabricClient()
# alternatively create instance with parameters
# ipf = IPFabricClient(base_url='https://myipfserver.com', username='admin', password='admin12345')
# ipf = IPFabricClient(base_url='https://myipfserver.com', token='TOKENFROMIPF')
# login to IP Fabric system
loop.run_until_complete(ipf.login())
# fetch the complete device inventory
device_list = loop.run_until_complete(ipf.fetch_devices())
# close asyncio connection, otherwise you will see a warning.
loop.run_until_complete(ipf.logout())
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.
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
aio-ipfabric-0.16.0.tar.gz
(23.6 kB
view hashes)
Built Distribution
Close
Hashes for aio_ipfabric-0.16.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fac2992af64c3a6a80df4e594ba80b3fdb0c7b684f0288b4fe12d475a8e35bf |
|
MD5 | 1b58f878ca844b9c206ea4fac245f17e |
|
BLAKE2b-256 | 4c83d6041ec2b7ba4daae61561dbe7c7f37bf9b96101502e8212a88a5f8ea4ac |