Python interface interacting with a Citrix NetScaler application delivery controller, utilizing the SOAP API to execute commands.
Special thanks to Allen Sanabria (asanabria@linuxdynasty.org) for the initial work on getting the API working with python-suds.
Original post: http://tinyurl.com/yl4o6vq
Pass any kwargs to init that you would to the suds.client.Client constructor. A little bit of magic is performed with the ImportDoctor to cover missing types used in the WSDL.
- If you specify wsdl, this file will be pulled from the default http URL
- If you specify wsdl_url, it will override the wsdl file. Local
“file://” URLs work just fine.
- If you do not specify autosave, it will be enabled by default for volatile operations.
To save time for re-usable code, it is a good idea subclassing this to create methods for commonly used commands in your application. Example:
class MyAPI(netscaler.API):
def change_password(self, username, newpass):
return self.run("setsystemuser_password",
username=username, password=newpass)
Validates whether a command is read-only based on READONLY_COMMANDS
Performs API login.
Performs API logout.
Runs the equivalent of self.client.service.command(**kwargs).
Will perform login() if self.logged_in == False. Will perform save() on volatile operations if self.autosave == True.
Saves NS Config.
Generic API error