aruba / pycentral Goto Github PK
View Code? Open in Web Editor NEWAruba Central Python SDK
License: MIT License
Aruba Central Python SDK
License: MIT License
Hi!
Would like to contribute msp api functionality.
Br
M.
Several API calls (for example get_all_wlans() ) need Northbound API to be enabled on account. This is not enabled by default and need to be requested from TAC.
It would be nice to have this prerequisite mentioned in documentation.
Hello.
I cloned your repository and tried using that route and it does not return anything in the JSON.
I used the token for a organization and it does not list the insights...
It list APs, Switches, Gateways... But no Insights are returned.
Hi,
As I was surfing through the code, I found that there are no unit test cases for the currently present code for Pycentral library. It will be helpful to have unit test cases in the repo before leveraging the library.
The example code always terminates with an error
AP_SETTINGS_CSV - ERROR - Failed to update ap settings for APs []
it looks like its just not checking for an empty array. Perhaps we could test for this condition.
unkown_aps = list(set(all_aps) - set(success_aps + failed_aps))
failed_aps = failed_aps + unkown_aps
print("")
LOGGER.error("Failed to update ap settings for APs %s" % failed_aps)
When performing API calls, I occasionally (but regularly and consistently) get client side timeout errors on the pycentral module which doesn't appear to be handling them well - usually a retry clears it right up, so it would probably be useful to to a better job of catching that particular exception or setting a retry count as well as a timeout value when creating the pycentral object, which can then be passed on to the requests module (it currently appears to be 60 seconds).
I believe the use of a singleton C_DEFAULT_ARGS in pycentral.base_utils is causing an issue when using multiple API connections (e.g. when connecting multiple times with different credentials).
ArubaCentralBase.init makes a call to base_utils.parseInputArgs() to get a clean set of central_info parameters. Unfortunately, parseInputArgs() uses the same return dictionary for all calls. So, calling parseInputArgs() with different values affects all previous calls.
In parseInputArgs(), the line:
default_dict = C_DEFAULT_ARGS
can be replaced by:
default_dict = dict(C_DEFAULT_ARGS)
Thanks!
...
from pycentral.base import ArubaCentralBase
File "/home/wade/.local/lib/python3.8/site-packages/pycentral/base.py", line 26, in <module>
from pycentral.base_utils import tokenLocalStoreUtil
File "/home/wade/.local/lib/python3.8/site-packages/pycentral/base_utils.py", line 28, in <module>
from pip._internal.utils.misc import get_installed_distributions
ImportError: cannot import name 'get_installed_distributions' from 'pip._internal.utils.misc
get_internal_distributions()
was removed in 21.3 (posted 10/11/2021) the previous version 21.2.4 is fine.
PR with fix #10
FYI: can be worked around prior to the fix being published on pypi by specifying the older version pip install pip==21.2.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.