Skip to content

Use Requests for NetboxAPI#57

Merged
matt852 merged 4 commits intomatt852:developmentfrom
layertwo:feature/netbox-requests
Feb 10, 2018
Merged

Use Requests for NetboxAPI#57
matt852 merged 4 commits intomatt852:developmentfrom
layertwo:feature/netbox-requests

Conversation

@layertwo
Copy link
Copy Markdown
Contributor

Here's the basic overview of what I did in this PR:

  • Use requests module for API calls (cleaner code and better for Python3)
  • Turned NetboxHost into its own object handled at the top level of the app.
    • This way we don't have to check app.config['NETBOXSERVER'] every single time we want to make a request to Netbox.

Future work here (different PR) is building a handler between the views and data sources.
This will be some future object that knows if it needs to pull from Netbox or add/modify/delete from the local database. This would clear up the problem of checking which data source to use in the view and allow for some building modularity if the need to use some other IPAM system comes up. Plus, it simplifies the code!

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 73

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at ?%

Totals Coverage Status
Change from base Build 71: 0.0%
Covered Lines:
Relevant Lines: 0

💛 - Coveralls

@matt852 matt852 merged commit f5a3ec2 into matt852:development Feb 10, 2018
matt852 added a commit that referenced this pull request Feb 10, 2018
* add travis integration to slack (#53)

* Add flaskenv to gitignore

* Added tracking .txt file for which functions have a test written already

* Add tests.  Begin Python3 conversion.

* Fix broken NXOS unit test

* Add TravisCI badge to Readme.  Updated docs

* Add coveralls support

* Update docs with coveralls badge

* Fix travis file type

* Fix #54 bug when adding new device with local credentials

* Fix #55 and #56 issues with underscores in iShell and interface edit Modal

* Cleanup code for issue #47.  Still WIP

* Fix #46 issue

* Add description display for NX-OS interfaces

* Use Requests for NetboxAPI (#57)

* Refactor all Netbox API calls to use Python requests.

* Convert NetboxAPI into its own object, define that object in __init__.py, and reference the object in views.py and db_modifyDatabase.py.

* Workaround for not having a NetboxServer defined (unittesting)

* Update to version 1.3.4
@layertwo layertwo deleted the feature/netbox-requests branch February 10, 2018 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants