Open favoretti opened 10 years ago
Honestly, I'd really like to see this used as a session constructor (and requests while we're at it!), but either path would be great. What do you think the relative complexity would be, between the two options?
Also, I've heard from some sources that a full Python API is being planned for 10.5 or sooner... not sure what the actual timeframe is on that, however.
What I don't like about this implementation is how it's supposed to be used later on...
clearconfig_obj = {}
clearconfig_obj['force'] = "1"
clearconfig_obj['level'] = "full"
response = post(session, "clear", "nsconfig", clearconfig_obj)
Basically it looks more like combining json objects by hand, rather than an "object-like" syntax.. Dunno, maybe it's just me.
Got access to 10.5 beta from Citrix. As soon as I get hands on official Python API, I'll report back.
My greatest fear is is that it's all dict()
based, which would mean we, for instance, at eCG, will need to rewrite everything we've done so far using nsnitro.. and we have a lot.
Good thing is that in the meantime I could just steal the base object from them, integrate here and support this one until official Python SDK will be adopted by everyone.
Anyway, I'll use this issue to share some insights on how official Python SDK looks like.
I've got a copy of the Python SDK. The base login object (base_resource.py) uses requests, json, abc, urllib2, and inspect. Also, looks like it's a near-direct port of the Java SDK, complete with the class naming scheme, i.e.:
from src.com.citrix.netscaler.nitro.service.options import options from src.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_exception from src.com.citrix.netscaler.nitro.resource.base.Json import Json
Also: bulk operations look to be fully supported! Digging into it more this morning.
Is it dict-based or getter/setter based?
Also, whyyyy are they using both requests and urllib2?
Hey,
We've just upgraded our netscalers to 10.1 and I found Python samples (using
requests
lib) inside netscaler itself.It's located at
/var/netscaler/nitro/ns-10.1-123.11-nitro-python-samples.tgz
(YMMV depending on the build you're using).Looking at it.. It looks somewhat raw.. Do we want to implement that into nsnitro as an alternative session constructor?
My other thought was to redo the nsnitro object in such a way that one can specify version to use and go from there. Whereas we could use the Nitro.py that Netscaler supplies.
Here's the implementation they made:
Any opinions?