-
Notifications
You must be signed in to change notification settings - Fork 0
/
adxsuds.py
47 lines (37 loc) · 1.23 KB
/
adxsuds.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import pprint
from namespaces import SysService, NetworkService, SlbService, SecurityService, GslbService
class Adx(object):
"""
This is the ADX object for interaction with the ADX device.
You should instantiate the device in the following manner.
device = ADX(host, username, password)
"""
NAMESPACES = {
"sys": SysService,
"network": NetworkService,
"slb": SlbService,
"security": SecurityService,
"gslb": GslbService
}
def __init__(self, host, username, password, port=443, protocol="https", verify_ssl=True, debug=0, cache=True):
"""
Class Constructor.
"""
self.host = host
self.username = username
self.password = password
self.port = port
self.PREFIX = protocol + "://"
self.SSL_VERIFY = verify_ssl
self.debug = debug
self.cache = cache
self._build_namespaces()
def _build_namespaces(self):
for key, val in self.NAMESPACES.iteritems():
self.__setattr__(key, val(self))
def get_namespaces(self):
"""
Method to show the available Namespaces.
:return:
"""
pprint.pprint(self.NAMESPACES.keys())