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.4-py2.7.egg (175.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for nsnitro-1.0.4-py2.7.egg
Algorithm Hash digest
SHA256 1b2dbc3220e2a0efe0fc5728af4a45f6ec300d7d8282f1f7b91729a22a035068
MD5 bde960160822ade6ea8b0c43c1ffe676
BLAKE2b-256 f6090c7a8eacbe1ef5618a8dd7aaa667c5dce63bce7cdc9cacc6bcdf82059830

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