Giter Site home page Giter Site logo

slauger / python-nitro Goto Github PK

View Code? Open in Web Editor NEW
7.0 5.0 3.0 24 KB

Examples for connecting to the NITRO API on a Citrix NetScaler ADC with Python

License: Apache License 2.0

Python 97.73% Makefile 2.27%
nitro citrix netscaler adc python api nitro-api examples

python-nitro's Introduction

python-nitro

Examples for connecting to the NITRO API for the Citrix NetScaler ADC with Python (using Requests)

Config

[netscaler]
url = https://netscaler.customer.local
verify_ssl = True
username = nsroot
password = nsroot

Usage

Print out all lbvservers

./cli.py get stat lbvserver

Download a file with systemfile

./cli.py get config systemfile --params 'args=filename:fullbackup.tgz,filelocation:%2Fvar%2Fns_sys_backup%2F'

Push bulk configuration

./config.py post configs/xenmobile-01.json
./config.py put configs/xenmobile-02.json

Hints

python-nitro's People

Contributors

slauger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

python-nitro's Issues

Nitro api client timing out

I am trying to use your client to run some commands on my netscaler. Have sourced the login creds from my config file ns.conf

(pywork) โžœ  python-nitro git:(master) ./cli.py --config ~/.config/ns.conf get config nsversion
Traceback (most recent call last):
  File "./cli.py", line 130, in <module>
    params=args.params
  File "/Users/srlawang/workspace/netscalers/python-nitro/nitro.py", line 61, in request
    verify=self._verify,
  File "/Users/srlawang/.virtualenv/pywork/lib/python2.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/srlawang/.virtualenv/pywork/lib/python2.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/srlawang/.virtualenv/pywork/lib/python2.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/srlawang/.virtualenv/pywork/lib/python2.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/Users/srlawang/.virtualenv/pywork/lib/python2.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='xx.xx.xx.xx', port=80): Max retries exceeded with url: /nitro/v1/config/nsversion (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x105cef9d0>: Failed to establish a new connection: [Errno 60] Operation timed out',))

I also verified against the api reference document to be sure that the call url: /nitro/v1/config/nsversion is indeed correct : https://developer-docs.citrix.com/projects/netscaler-nitro-api/en/12.0/configuration/ns/nsversion/nsversion/#get-all

I am not sure what i might have missed here? Or if it is a python version error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.