Giter VIP home page Giter VIP logo

aio-ipfabric's People

Contributors

huttmf avatar jeremy-schulman-copilot avatar jeremyschulman avatar jmanteau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aio-ipfabric's Issues

PyPI wheel contains old mixin structure

mixin_configs.py, mixin_inventory.py and mixin_diagrams.py are still present in the PyPI wheel.

Proof:

Install wheel and check -> old mixin_NAME at the root PRESENT

❯ pip install aio-ipfabric &&  cd ~/.pye/v/3.8/P/Versions/3.8/lib/python3.8/site-packages/aioipfabric
❯ ls
__init__.py        aiofut.py          base_client.py     consts.py          mixin_configs.py   mixin_inventory.py
__pycache__        api.py             client.py          filters.py         mixin_diagrams.py  mixins

Download .tar.gz and check -> old mixin_NAME at the root NOT present

❯ cd ~/Downloads/aio-ipfabric-0.6.2 
❯ ls aioipfabric
__init__.py    aiofut.py      api.py         base_client.py client.py      consts.py      filters.py     mixins

Add "exists" to parse_filter

Presently the parse_filter function supports the question mark to be the "is empty" operator, for example:

"desc ? true"

Would be the filter of "Is the description column empty". This doe not read very well. Will add a new operator "exists" so that filters can be written

"desc exists true"
"desc exists false"

Which is more readable.

Parse Filter Bug

When trying to filter the fetch_devices with "hostname ~ 4200" we get an invalid response.

How to replicate:

import asyncio
from aioipfabric import IPFabricClient

loop = asyncio.get_event_loop()

ipf = IPFabricClient()
loop.run_until_complete(ipf.login())

hostname_filter = ipf.parse_filter("hostname ~ 4200")

test = loop.run_until_complete(ipf.fetch_devices(filters=hostname_filter))
ipf.logout()

This errors out:

422 Client Error: Unprocessable Entity for url: https://192.168.35.1/api/v1/tables/inventory/devices
For more information check: https://httpstatuses.com/422

This is because the filter looks like the following:
{'hostname': ['like', 4200]}

it should look like:
{'hostname': ['like', '4200']}

Refactor in a consistent way the inventory.py variables

Today, there are several ways that data are get for their URIs / Columns parameters.

I propose that we create either under inventory.py or const.py a structure keeping together the URI and the columns associated (with several named variations possible).
We could/(should?) also include filter/reports into this structure.

The current function will have to be retrofitted.

This will allow potentially further fetch_function to be instantiated from one function.

Correct the about description

The about description on Github (hence on Google) is: "Python 3.8 asycnio client for IP Fabric"

There is a typo, it should be "Python 3.8+ asyncio client for IP Fabric"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.