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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nsnitro-1.0.3-py2.7.egg (175.8 kB view details)

Uploaded Source

File details

Details for the file nsnitro-1.0.3-py2.7.egg.

File metadata

  • Download URL: nsnitro-1.0.3-py2.7.egg
  • Upload date:
  • Size: 175.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nsnitro-1.0.3-py2.7.egg
Algorithm Hash digest
SHA256 4c3169ccb3bc11aa11d25c7ebb302118cc842757b0a07adad409b5d995577896
MD5 bd08362cfeb58a34afe70a7cb59ecf78
BLAKE2b-256 92ec42b424da9d84912e4c712d8b2eb9beb66437579e77accd65ec0de69c01fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page