Skip to main content

A simple library to control Citrix Netscaler 9.2+ with NITRO API.

Project description

###############################################################################
# TODO
# 1. Right now setup.py install creates an extra nsnitro.py along with the folder nsnitro. This creates trouble when running from nsnitro import *
###############################################################################

Simple Python Library to control Citrix Netscaler 9.2+ load balancers with NITRO API.
What we're trying here is implement Citrix NITRO API SDK (that's available for Java and C#) in Python.

You can find simple command-line interface using this library in contrib/.
Feedback/comments welcome.


Very basic usage:

import nsnitro

nitro = NSNitro('192.168.1.100', 'user', 'password')
nitro.login()

# add service test

addservice = NSService()
addservice.set_name("testnitroadd")
addservice.set_servername("existingserver")
addservice.set_servicetype("HTTP")
addservice.set_port(11111)
NSService.add(nitro, addservice)

# get service test

service = NSService()
service.set_name("testnitroadd")
service = service.get(nitro, service)
print service.get_name() + ": " + service.get_svrstate()

# disable service test

disservice = NSService()
disservice.set_name("testnitroadd")
NSService.disable(nitro, disservice)

service = NSService()
service.set_name("testnitroadd")
service = service.get(nitro, service)
print service.get_name() + ": " + service.get_svrstate()

# enable service test

enservice = NSService()
enservice.set_name("testnitroadd")
NSService.enable(nitro, enservice)

service = NSService()
service.set_name("testnitroadd")
service = service.get(nitro, service)
print service.get_name() + ": " + service.get_svrstate()


# rename service test

renservice = NSService()
renservice.set_name("testnitroadd")
renservice.set_newname("testnitroadd_rename")
NSService.rename(nitro, renservice)

# rename service back test

renservice = NSService()
renservice.set_name("testnitroadd_rename")
renservice.set_newname("testnitroadd")
NSService.rename(nitro, renservice)

# delete service test

delservice = NSService()
delservice.set_name("testnitroadd")
NSService.delete(nitro, delservice)

try:
service = NSService()
service.set_name("testnitroadd")
service = service.get(nitro, service)
print service.get_name() + ": " + service.get_svrstate()
except NSNitroError, e:
print e.message

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nsnitro, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size nsnitro-1.0.4-py2.7.egg (175.8 kB) File type Egg Python version 2.7 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page