SOLIDserverRest 2.3.12__tar.gz → 2.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/PKG-INFO +29 -4
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/README.md +28 -3
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/SOLIDserverRest.py +69 -5
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/sds.py +33 -6
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/mapper.py +34 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest.egg-info/PKG-INFO +29 -4
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/setup.py +1 -1
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/LICENSE +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/Exception.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/__init__.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/__init__.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/base.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/class_params.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/device.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/device_tools.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/devif.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/dns.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/dns_record.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/dns_zone.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/ipaddress.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/network.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/space.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest/adv/validators.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest.egg-info/SOURCES.txt +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest.egg-info/dependency_links.txt +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest.egg-info/entry_points.txt +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest.egg-info/not-zip-safe +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest.egg-info/requires.txt +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest.egg-info/top_level.txt +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/setup.cfg +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/tests/test_simple.py +0 -0
- {SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/tests/tests.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SOLIDserverRest
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: The SOLIDserverRest is a library to drive EfficientIP API
|
|
5
5
|
Home-page: https://gitlab.com/efficientip/solidserverrest
|
|
6
6
|
Author: Gregory CUGAT / Alex Chauvin
|
|
@@ -46,6 +46,8 @@ Install 'SOLIDserverRest' using pip in your virtualenv:
|
|
|
46
46
|
|
|
47
47
|
## Using the SOLIDserverRest advanced object (recommended)
|
|
48
48
|
|
|
49
|
+
### With basic authentication
|
|
50
|
+
|
|
49
51
|
All commands and object manipulation are going through a SOLIDserver main object, handling the connection to the manager and pushing API calls. The creation of a SOLIDserver object is done like that:
|
|
50
52
|
```
|
|
51
53
|
from SOLIDserverRest import *
|
|
@@ -59,12 +61,35 @@ sds = sdsadv.SDS(ip_address=SDS_HOST,
|
|
|
59
61
|
user=SDS_LOGIN,
|
|
60
62
|
pwd=SDS_PWD)
|
|
61
63
|
try:
|
|
62
|
-
sds.connect(
|
|
64
|
+
sds.connect()
|
|
65
|
+
except SDSError as e:
|
|
66
|
+
logging.error(e)
|
|
67
|
+
exit(1)
|
|
68
|
+
|
|
69
|
+
print(sds)
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## With token authentication (SDS release >= 8.4.0)
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
from SOLIDserverRest import *
|
|
77
|
+
from SOLIDserverRest import adv as sdsadv
|
|
78
|
+
|
|
79
|
+
SDS_HOST = "192.168.254.254"
|
|
80
|
+
SDS_TOKEN_ID = "8628f88cbd40df99903d6f385caa0462"
|
|
81
|
+
SDS_TOKEN_SEC = "ca8ec3c0f07b380c4723349230901d40a84ba4b4987c12863b66b0b5297ad922"
|
|
82
|
+
|
|
83
|
+
sds = sdsadv.SDS(ip_address=SDS_HOST)
|
|
84
|
+
sds.set_token_creds(keyid=SDS_TOKEN_ID,
|
|
85
|
+
keysecret=SDS_TOKEN_SEC)
|
|
86
|
+
try:
|
|
87
|
+
sds.connect(method="token")
|
|
63
88
|
except SDSError as e:
|
|
64
89
|
logging.error(e)
|
|
65
90
|
exit(1)
|
|
66
91
|
|
|
67
|
-
print(
|
|
92
|
+
print(sds)
|
|
68
93
|
|
|
69
94
|
```
|
|
70
95
|
|
|
@@ -149,7 +174,7 @@ Methods are organized to match the ontology used in SOLIDServer, you will find:
|
|
|
149
174
|
* Aliases (v4 and v6)
|
|
150
175
|
* DNS servers, views, zones, RR, acl, key
|
|
151
176
|
* application manager
|
|
152
|
-
* DHCP server, scope, shared net, range, static, group
|
|
177
|
+
* DHCP server, scope, shared net, range, static, group, options
|
|
153
178
|
* device manager
|
|
154
179
|
* VLAN manager
|
|
155
180
|
|
|
@@ -22,6 +22,8 @@ Install 'SOLIDserverRest' using pip in your virtualenv:
|
|
|
22
22
|
|
|
23
23
|
## Using the SOLIDserverRest advanced object (recommended)
|
|
24
24
|
|
|
25
|
+
### With basic authentication
|
|
26
|
+
|
|
25
27
|
All commands and object manipulation are going through a SOLIDserver main object, handling the connection to the manager and pushing API calls. The creation of a SOLIDserver object is done like that:
|
|
26
28
|
```
|
|
27
29
|
from SOLIDserverRest import *
|
|
@@ -35,12 +37,35 @@ sds = sdsadv.SDS(ip_address=SDS_HOST,
|
|
|
35
37
|
user=SDS_LOGIN,
|
|
36
38
|
pwd=SDS_PWD)
|
|
37
39
|
try:
|
|
38
|
-
sds.connect(
|
|
40
|
+
sds.connect()
|
|
41
|
+
except SDSError as e:
|
|
42
|
+
logging.error(e)
|
|
43
|
+
exit(1)
|
|
44
|
+
|
|
45
|
+
print(sds)
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## With token authentication (SDS release >= 8.4.0)
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
from SOLIDserverRest import *
|
|
53
|
+
from SOLIDserverRest import adv as sdsadv
|
|
54
|
+
|
|
55
|
+
SDS_HOST = "192.168.254.254"
|
|
56
|
+
SDS_TOKEN_ID = "8628f88cbd40df99903d6f385caa0462"
|
|
57
|
+
SDS_TOKEN_SEC = "ca8ec3c0f07b380c4723349230901d40a84ba4b4987c12863b66b0b5297ad922"
|
|
58
|
+
|
|
59
|
+
sds = sdsadv.SDS(ip_address=SDS_HOST)
|
|
60
|
+
sds.set_token_creds(keyid=SDS_TOKEN_ID,
|
|
61
|
+
keysecret=SDS_TOKEN_SEC)
|
|
62
|
+
try:
|
|
63
|
+
sds.connect(method="token")
|
|
39
64
|
except SDSError as e:
|
|
40
65
|
logging.error(e)
|
|
41
66
|
exit(1)
|
|
42
67
|
|
|
43
|
-
print(
|
|
68
|
+
print(sds)
|
|
44
69
|
|
|
45
70
|
```
|
|
46
71
|
|
|
@@ -125,7 +150,7 @@ Methods are organized to match the ontology used in SOLIDServer, you will find:
|
|
|
125
150
|
* Aliases (v4 and v6)
|
|
126
151
|
* DNS servers, views, zones, RR, acl, key
|
|
127
152
|
* application manager
|
|
128
|
-
* DHCP server, scope, shared net, range, static, group
|
|
153
|
+
* DHCP server, scope, shared net, range, static, group, options
|
|
129
154
|
* device manager
|
|
130
155
|
* VLAN manager
|
|
131
156
|
|
|
@@ -21,6 +21,8 @@ import base64
|
|
|
21
21
|
import re
|
|
22
22
|
import logging
|
|
23
23
|
import urllib
|
|
24
|
+
import time
|
|
25
|
+
import hashlib
|
|
24
26
|
import requests
|
|
25
27
|
|
|
26
28
|
|
|
@@ -55,6 +57,7 @@ class SOLIDserverRest:
|
|
|
55
57
|
CNX_NATIVE = 1
|
|
56
58
|
CNX_APIKEY = 2
|
|
57
59
|
CNX_BASIC = 3
|
|
60
|
+
CNX_TOKEN = 4
|
|
58
61
|
|
|
59
62
|
# -------------------------------------
|
|
60
63
|
def __init__(self, host, debug=False):
|
|
@@ -81,6 +84,10 @@ class SOLIDserverRest:
|
|
|
81
84
|
self.ssl_verify = True
|
|
82
85
|
self.proxies = None
|
|
83
86
|
|
|
87
|
+
# token authentication
|
|
88
|
+
self.cred_token_keyid = None
|
|
89
|
+
self.cred_token_keysecret = None
|
|
90
|
+
|
|
84
91
|
# set specific features for python v2 (<=2020, not supported after)
|
|
85
92
|
if sys.version_info[0] == 2: # pragma: no cover
|
|
86
93
|
# pylint: disable=E1101
|
|
@@ -145,6 +152,30 @@ class SOLIDserverRest:
|
|
|
145
152
|
'content-type': 'application/json'
|
|
146
153
|
}
|
|
147
154
|
|
|
155
|
+
# -------------------------------------
|
|
156
|
+
def use_token_sds(self, keyid=None, keysecret=None):
|
|
157
|
+
""" propose to use the basic auth implementation on the SDS
|
|
158
|
+
"""
|
|
159
|
+
logging.debug("useTokenAuthSDS")
|
|
160
|
+
|
|
161
|
+
# check if SDS connection is established
|
|
162
|
+
if self.host is None:
|
|
163
|
+
raise SDSInitError()
|
|
164
|
+
|
|
165
|
+
if keyid is None or keysecret is None:
|
|
166
|
+
msg = "missing token information in credentials"
|
|
167
|
+
raise SDSInitError(message=msg)
|
|
168
|
+
|
|
169
|
+
self.cred_token_keyid = keyid
|
|
170
|
+
self.cred_token_keysecret = keysecret
|
|
171
|
+
|
|
172
|
+
self.cnx_type = self.CNX_TOKEN
|
|
173
|
+
# self.session.auth = requests.auth.HTTPBasicAuth(user, password)
|
|
174
|
+
|
|
175
|
+
self.headers = {
|
|
176
|
+
'content-type': 'application/json'
|
|
177
|
+
}
|
|
178
|
+
|
|
148
179
|
# -------------------------------------
|
|
149
180
|
def set_certificate_file(self, file_path):
|
|
150
181
|
"""set the certificate that will be used to authenticate the server"""
|
|
@@ -157,7 +188,6 @@ class SOLIDserverRest:
|
|
|
157
188
|
logging.warning("cannot load CA file")
|
|
158
189
|
raise SDSInitError(f"cannot load CA file {file_path}") from ioe
|
|
159
190
|
except crypto.Error as error:
|
|
160
|
-
logging.warning(error)
|
|
161
191
|
raise SDSInitError(f"invalid CA file {file_path}") from error
|
|
162
192
|
|
|
163
193
|
self.session.verify = file_path
|
|
@@ -232,9 +262,11 @@ class SOLIDserverRest:
|
|
|
232
262
|
self.last_url = f"{svc_mapped}{params}".strip()
|
|
233
263
|
|
|
234
264
|
if re.match('.*_find_free$', service) is not None:
|
|
235
|
-
|
|
265
|
+
url_path = f"/rpc/{self.last_url}"
|
|
266
|
+
url = f"{self.prefix_url}{url_path}"
|
|
236
267
|
else:
|
|
237
|
-
|
|
268
|
+
url_path = f"/{self.default_method}/{self.last_url}"
|
|
269
|
+
url = f"{self.prefix_url}{url_path}"
|
|
238
270
|
|
|
239
271
|
try:
|
|
240
272
|
logging.debug("m=%s u=%s h=%s v=%s a=%s",
|
|
@@ -244,6 +276,29 @@ class SOLIDserverRest:
|
|
|
244
276
|
self.ssl_verify,
|
|
245
277
|
self.auth)
|
|
246
278
|
|
|
279
|
+
if self.cnx_type == self.CNX_TOKEN:
|
|
280
|
+
_string_to_sign = self.cred_token_keysecret
|
|
281
|
+
_sign_time = int(time.time())
|
|
282
|
+
_string_to_sign += f"\n{_sign_time}"
|
|
283
|
+
_string_to_sign += f"\n{method}"
|
|
284
|
+
_string_to_sign += f"\n{url}"
|
|
285
|
+
|
|
286
|
+
_signature = hashlib.sha3_256(
|
|
287
|
+
_string_to_sign.encode()).hexdigest()
|
|
288
|
+
|
|
289
|
+
_headers = self.headers.copy()
|
|
290
|
+
_headers['Authorization'] = (f"SDS {self.cred_token_keyid}:"
|
|
291
|
+
f"{_signature}")
|
|
292
|
+
_headers['X-SDS-TS'] = str(_sign_time)
|
|
293
|
+
|
|
294
|
+
return self.session.request(
|
|
295
|
+
method,
|
|
296
|
+
url,
|
|
297
|
+
headers=_headers,
|
|
298
|
+
proxies=self.proxies,
|
|
299
|
+
verify=self.ssl_verify,
|
|
300
|
+
timeout=timeout)
|
|
301
|
+
|
|
247
302
|
return self.session.request(
|
|
248
303
|
method,
|
|
249
304
|
url,
|
|
@@ -252,6 +307,7 @@ class SOLIDserverRest:
|
|
|
252
307
|
verify=self.ssl_verify,
|
|
253
308
|
timeout=timeout,
|
|
254
309
|
auth=self.auth)
|
|
310
|
+
|
|
255
311
|
except requests.exceptions.SSLError as error:
|
|
256
312
|
raise SDSRequestError(method,
|
|
257
313
|
url,
|
|
@@ -299,11 +355,19 @@ class SOLIDserverRest:
|
|
|
299
355
|
self.session = None
|
|
300
356
|
self.ssl_verify = True
|
|
301
357
|
self.proxies = None
|
|
358
|
+
self.cred_token_keyid = None
|
|
359
|
+
self.cred_token_keysecret = None
|
|
302
360
|
|
|
303
361
|
# -------------------------------------
|
|
304
362
|
def __str__(self): # pragma: no cover
|
|
305
|
-
_s = "SOLIDserverRest: API={}
|
|
306
|
-
|
|
363
|
+
_s = f"SOLIDserverRest: API={self.prefix_url}"
|
|
364
|
+
|
|
365
|
+
if self.user:
|
|
366
|
+
_s += f", user={self.user}"
|
|
367
|
+
elif self.cred_token_keyid:
|
|
368
|
+
_s += f" token={self.cred_token_keyid[:8]}"
|
|
369
|
+
|
|
370
|
+
return _s
|
|
307
371
|
|
|
308
372
|
# deprecated method to be suppressed
|
|
309
373
|
|
|
@@ -54,6 +54,10 @@ class SDS(ClassParams):
|
|
|
54
54
|
self.auth_method = None
|
|
55
55
|
self.check_certificate = False
|
|
56
56
|
|
|
57
|
+
# token authentication
|
|
58
|
+
self.cred_token_keyid = None
|
|
59
|
+
self.cred_token_keysecret = None
|
|
60
|
+
|
|
57
61
|
self.sds = None
|
|
58
62
|
self.timeout = 1
|
|
59
63
|
|
|
@@ -66,7 +70,7 @@ class SDS(ClassParams):
|
|
|
66
70
|
ipaddress.IPv4Address(ip_address)
|
|
67
71
|
except ipaddress.AddressValueError as error:
|
|
68
72
|
raise SDSInitError(message=f"IPv4 address of"
|
|
69
|
-
" server error: {error}") from error
|
|
73
|
+
f" server error: {error}") from error
|
|
70
74
|
|
|
71
75
|
self.sds_ip = ip_address
|
|
72
76
|
|
|
@@ -96,6 +100,14 @@ class SDS(ClassParams):
|
|
|
96
100
|
self.user = user
|
|
97
101
|
self.pwd = pwd
|
|
98
102
|
|
|
103
|
+
def set_token_creds(self, keyid=None, keysecret=None):
|
|
104
|
+
"""add token credentials to this session"""
|
|
105
|
+
if keyid is None or keysecret is None:
|
|
106
|
+
msg = "missing token information in credentials"
|
|
107
|
+
raise SDSInitError(message=msg)
|
|
108
|
+
self.cred_token_keyid = keyid
|
|
109
|
+
self.cred_token_keysecret = keysecret
|
|
110
|
+
|
|
99
111
|
# ---------------------------
|
|
100
112
|
def set_check_cert(self, check=True):
|
|
101
113
|
"""whether we have to check the certificate, even if not provided"""
|
|
@@ -106,24 +118,37 @@ class SDS(ClassParams):
|
|
|
106
118
|
"""connects to SOLIDserver and check everything is OK by
|
|
107
119
|
querying the version of the admin node in the member list
|
|
108
120
|
|
|
109
|
-
method -- basicauth (default) or native (header based)
|
|
121
|
+
method -- basicauth (default) or native (header based) or token
|
|
110
122
|
cert_file_path -- disable SSL check if None (default)
|
|
111
123
|
file with cert if check enabled
|
|
112
124
|
"""
|
|
113
|
-
|
|
114
|
-
msg = "missing user or password in credentials for connect"
|
|
115
|
-
raise SDSInitError(message=msg)
|
|
125
|
+
|
|
116
126
|
if self.sds_ip is None:
|
|
117
127
|
raise SDSInitError(message="missing ip for server for connect")
|
|
118
128
|
|
|
119
129
|
self.sds = SOLIDserverRest(self.sds_ip)
|
|
120
130
|
|
|
121
131
|
if method == "basicauth":
|
|
132
|
+
if self.user is None or self.pwd is None:
|
|
133
|
+
msg = "missing user or password in credentials for connect"
|
|
134
|
+
raise SDSInitError(message=msg)
|
|
122
135
|
self.sds.use_basicauth_sds(self.user, self.pwd)
|
|
123
136
|
self.auth_method = "basic auth"
|
|
124
137
|
elif method == "native":
|
|
138
|
+
if self.user is None or self.pwd is None:
|
|
139
|
+
msg = "missing user or password in credentials for connect"
|
|
140
|
+
raise SDSInitError(message=msg)
|
|
125
141
|
self.sds.use_native_sds(self.user, self.pwd)
|
|
126
142
|
self.auth_method = "native"
|
|
143
|
+
elif method == "token":
|
|
144
|
+
if (self.cred_token_keyid is None
|
|
145
|
+
or self.cred_token_keysecret is None):
|
|
146
|
+
msg = "missing token in credentials for connect"
|
|
147
|
+
raise SDSInitError(message=msg)
|
|
148
|
+
|
|
149
|
+
self.sds.use_token_sds(keyid=self.cred_token_keyid,
|
|
150
|
+
keysecret=self.cred_token_keysecret)
|
|
151
|
+
self.auth_method = "token"
|
|
127
152
|
|
|
128
153
|
# certificate & SSL check
|
|
129
154
|
if cert_file_path is not None:
|
|
@@ -155,6 +180,8 @@ class SDS(ClassParams):
|
|
|
155
180
|
self.auth_method = None
|
|
156
181
|
self.check_certificate = False
|
|
157
182
|
self.timeout = 1
|
|
183
|
+
self.cred_token_keyid = None
|
|
184
|
+
self.cred_token_keysecret = None
|
|
158
185
|
|
|
159
186
|
# ---------------------------
|
|
160
187
|
def get_version(self):
|
|
@@ -242,7 +269,7 @@ class SDS(ClassParams):
|
|
|
242
269
|
j = json.loads(f'[{answer_req.content.decode()}]')
|
|
243
270
|
if isinstance(j, list):
|
|
244
271
|
return j[0]
|
|
245
|
-
except
|
|
272
|
+
except ValueError:
|
|
246
273
|
pass
|
|
247
274
|
|
|
248
275
|
logging.error("no json in return")
|
|
@@ -235,6 +235,19 @@ SERVICE_MAPPER.update({
|
|
|
235
235
|
'dhcp_lease_manual_delete': 'dhcp_lease_manual_delete'
|
|
236
236
|
})
|
|
237
237
|
|
|
238
|
+
SERVICE_MAPPER.update({
|
|
239
|
+
# dhcp options
|
|
240
|
+
'dhcp_option_create': 'dhcp_option_add',
|
|
241
|
+
'dhcp_option_update': 'dhcp_option_add',
|
|
242
|
+
# no delete, please use update and empty value
|
|
243
|
+
|
|
244
|
+
'dhcp_options_group_list': 'dhcp_group_options_list',
|
|
245
|
+
'dhcp_options_range_list': 'dhcp_range_options_list',
|
|
246
|
+
'dhcp_options_scope_list': 'dhcp_scope_options_list',
|
|
247
|
+
'dhcp_options_server_list': 'dhcp_server_options_list',
|
|
248
|
+
'dhcp_options_static_list': 'dhcp_static_options_list'
|
|
249
|
+
})
|
|
250
|
+
|
|
238
251
|
SERVICE_MAPPER.update({
|
|
239
252
|
# dhcp6
|
|
240
253
|
'dhcp_server6_create': 'dhcp6_add',
|
|
@@ -265,6 +278,27 @@ SERVICE_MAPPER.update({
|
|
|
265
278
|
'dhcp_static6_count': 'dhcp6_static6_count',
|
|
266
279
|
'dhcp_static6_delete': 'dhcp6_static6_delete',
|
|
267
280
|
|
|
281
|
+
'dhcp_prefix6_create': 'dhcp6_prefix6_add',
|
|
282
|
+
'dhcp_prefix6_update': 'dhcp6_prefix6_add',
|
|
283
|
+
'dhcp_prefix6_list': 'dhcp6_prefix6_list',
|
|
284
|
+
'dhcp_prefix6_info': 'dhcp6_prefix6_info',
|
|
285
|
+
'dhcp_prefix6_count': 'dhcp6_prefix6_count',
|
|
286
|
+
'dhcp_prefix6_delete': 'dhcp6_prefix6_delete',
|
|
287
|
+
|
|
288
|
+
'dhcp_delegated_prefix6_create': 'dhcp6_delegated_prefix6_add',
|
|
289
|
+
'dhcp_delegated_prefix6_update': 'dhcp6_delegated_prefix6_add',
|
|
290
|
+
'dhcp_delegated_prefix6_list': 'dhcp6_delegatedprefix6_list',
|
|
291
|
+
'dhcp_delegated_prefix6_info': 'dhcp6_delegatedprefix6_info',
|
|
292
|
+
'dhcp_delegated_prefix6_count': 'dhcp6_delegatedprefix6_count',
|
|
293
|
+
'dhcp_delegated_prefix6_delete': 'dhcp6_delegated_prefix6_delete',
|
|
294
|
+
|
|
295
|
+
'dhcp_shared_network6_create': 'dhcp6_sn6_add',
|
|
296
|
+
'dhcp_shared_network6_update': 'dhcp6_sn6_add',
|
|
297
|
+
'dhcp_shared_network6_list': 'dhcp6_shared_network6v2_list',
|
|
298
|
+
'dhcp_shared_network6_info': 'dhcp6_shared_network6v2_info',
|
|
299
|
+
'dhcp_shared_network6_count': 'dhcp6_shared_network6v2_count',
|
|
300
|
+
'dhcp_shared_network6_delete': 'dhcp6_sn6_delete',
|
|
301
|
+
|
|
268
302
|
})
|
|
269
303
|
|
|
270
304
|
SERVICE_MAPPER.update({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SOLIDserverRest
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: The SOLIDserverRest is a library to drive EfficientIP API
|
|
5
5
|
Home-page: https://gitlab.com/efficientip/solidserverrest
|
|
6
6
|
Author: Gregory CUGAT / Alex Chauvin
|
|
@@ -46,6 +46,8 @@ Install 'SOLIDserverRest' using pip in your virtualenv:
|
|
|
46
46
|
|
|
47
47
|
## Using the SOLIDserverRest advanced object (recommended)
|
|
48
48
|
|
|
49
|
+
### With basic authentication
|
|
50
|
+
|
|
49
51
|
All commands and object manipulation are going through a SOLIDserver main object, handling the connection to the manager and pushing API calls. The creation of a SOLIDserver object is done like that:
|
|
50
52
|
```
|
|
51
53
|
from SOLIDserverRest import *
|
|
@@ -59,12 +61,35 @@ sds = sdsadv.SDS(ip_address=SDS_HOST,
|
|
|
59
61
|
user=SDS_LOGIN,
|
|
60
62
|
pwd=SDS_PWD)
|
|
61
63
|
try:
|
|
62
|
-
sds.connect(
|
|
64
|
+
sds.connect()
|
|
65
|
+
except SDSError as e:
|
|
66
|
+
logging.error(e)
|
|
67
|
+
exit(1)
|
|
68
|
+
|
|
69
|
+
print(sds)
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## With token authentication (SDS release >= 8.4.0)
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
from SOLIDserverRest import *
|
|
77
|
+
from SOLIDserverRest import adv as sdsadv
|
|
78
|
+
|
|
79
|
+
SDS_HOST = "192.168.254.254"
|
|
80
|
+
SDS_TOKEN_ID = "8628f88cbd40df99903d6f385caa0462"
|
|
81
|
+
SDS_TOKEN_SEC = "ca8ec3c0f07b380c4723349230901d40a84ba4b4987c12863b66b0b5297ad922"
|
|
82
|
+
|
|
83
|
+
sds = sdsadv.SDS(ip_address=SDS_HOST)
|
|
84
|
+
sds.set_token_creds(keyid=SDS_TOKEN_ID,
|
|
85
|
+
keysecret=SDS_TOKEN_SEC)
|
|
86
|
+
try:
|
|
87
|
+
sds.connect(method="token")
|
|
63
88
|
except SDSError as e:
|
|
64
89
|
logging.error(e)
|
|
65
90
|
exit(1)
|
|
66
91
|
|
|
67
|
-
print(
|
|
92
|
+
print(sds)
|
|
68
93
|
|
|
69
94
|
```
|
|
70
95
|
|
|
@@ -149,7 +174,7 @@ Methods are organized to match the ontology used in SOLIDServer, you will find:
|
|
|
149
174
|
* Aliases (v4 and v6)
|
|
150
175
|
* DNS servers, views, zones, RR, acl, key
|
|
151
176
|
* application manager
|
|
152
|
-
* DHCP server, scope, shared net, range, static, group
|
|
177
|
+
* DHCP server, scope, shared net, range, static, group, options
|
|
153
178
|
* device manager
|
|
154
179
|
* VLAN manager
|
|
155
180
|
|
|
@@ -10,7 +10,7 @@ with open(os.path.join(here, 'README.md')) as f:
|
|
|
10
10
|
|
|
11
11
|
setup(
|
|
12
12
|
name='SOLIDserverRest',
|
|
13
|
-
version='2.
|
|
13
|
+
version='2.4.1',
|
|
14
14
|
author='Gregory CUGAT / Alex Chauvin',
|
|
15
15
|
url='https://gitlab.com/efficientip/solidserverrest',
|
|
16
16
|
description='The SOLIDserverRest is a library to drive EfficientIP API',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{SOLIDserverRest-2.3.12 → solidserverrest-2.4.1}/SOLIDserverRest.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|