Metadata-Version: 2.1
Name: netscaler-module
Version: 1.0
Summary: A Python package to get REST API Netscaler Information
Home-page: https://github.com/cocuni80/netscaler_module
Author: Jorge Riveros
Author-email: christian.riveros@outlook.com
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.x
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: nitro-python

# Netscaler Module
Simple parallel processing interface for python

## Requirements
Python 3+

## Installation
```shell
$ pip install netscaler_module
```

## Quickstart
Use the `threaded` decorator to turn a method into a threaded method.
```python
from netscaler_module import nitro

....
```
Create a `DATABASE` variable and append the dicts response from nitro class.
Below an example.
```python

def get_ns(**kwargs):
    global DATABASE
    ns = NitroClass(**kwargs)
    ns.login()
    if ns.master:
        data = ns.get_lbvservers_binding_partitions()
        DATABASE.extend(data)        
    else:
        print('NS: {}, is not master'.format(ns.ip))
    ns.logout()
    return None

DATABASE = list()

if __name__ == '__main__':
    ns_pool = [
        '192.168.1.1',
        '192.168.1.2',
    ]
    password = {
        'username': 'nsroot',
        'password': 'XXXXXXX'
    }
    for ns_ip in ns_pool:
        temp = {'ip': ns_ip} | password
        get_ns(**temp)
    
    print(DATABASE)
```

