SOLIDserverRest 2.3.9__tar.gz → 2.3.11__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.9 → SOLIDserverRest-2.3.11}/PKG-INFO +156 -153
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/README.md +0 -1
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/SOLIDserverRest.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/__init__.py +10 -2
- SOLIDserverRest-2.3.11/SOLIDserverRest/adv/dns_record.py +1200 -0
- SOLIDserverRest-2.3.11/SOLIDserverRest/adv/validators.py +50 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest.egg-info/PKG-INFO +156 -153
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest.egg-info/SOURCES.txt +4 -1
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest.egg-info/entry_points.txt +0 -1
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest.egg-info/not-zip-safe +1 -1
- SOLIDserverRest-2.3.11/SOLIDserverRest.egg-info/requires.txt +7 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/setup.cfg +4 -4
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/setup.py +6 -6
- SOLIDserverRest-2.3.11/tests/test_simple.py +104 -0
- SOLIDserverRest-2.3.11/tests/tests.py +287 -0
- SOLIDserverRest-2.3.9/SOLIDserverRest/adv/dns_record.py +0 -414
- SOLIDserverRest-2.3.9/SOLIDserverRest.egg-info/requires.txt +0 -7
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/LICENSE +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/Exception.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/__init__.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/base.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/class_params.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/device.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/device_tools.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/devif.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/dns.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/dns_zone.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/ipaddress.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/network.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/sds.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/adv/space.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest/mapper.py +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest.egg-info/dependency_links.txt +0 -0
- {SOLIDserverRest-2.3.9 → SOLIDserverRest-2.3.11}/SOLIDserverRest.egg-info/top_level.txt +0 -0
|
@@ -1,153 +1,156 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: SOLIDserverRest
|
|
3
|
-
Version: 2.3.
|
|
4
|
-
Summary: The SOLIDserverRest is a library to drive EfficientIP API
|
|
5
|
-
Home-page: https://gitlab.com/efficientip/solidserverrest
|
|
6
|
-
Author: Gregory CUGAT / Alex Chauvin
|
|
7
|
-
Author-email: gregory.cugat@efficientip.com, ach@efficientip.com
|
|
8
|
-
License: BSD 2
|
|
9
|
-
|
|
10
|
-
Classifier:
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
This 'SOLIDserverRest'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: SOLIDserverRest
|
|
3
|
+
Version: 2.3.11
|
|
4
|
+
Summary: The SOLIDserverRest is a library to drive EfficientIP API
|
|
5
|
+
Home-page: https://gitlab.com/efficientip/solidserverrest
|
|
6
|
+
Author: Gregory CUGAT / Alex Chauvin
|
|
7
|
+
Author-email: gregory.cugat@efficientip.com, ach@efficientip.com
|
|
8
|
+
License: BSD 2
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Requires-Python: >=3.7
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: requests~=2.31
|
|
18
|
+
Requires-Dist: PySocks~=1.7
|
|
19
|
+
Requires-Dist: urllib3~=1.26
|
|
20
|
+
Requires-Dist: idna~=3.6
|
|
21
|
+
Requires-Dist: chardet~=5.2
|
|
22
|
+
Requires-Dist: pyopenssl~=24.0
|
|
23
|
+
Requires-Dist: packaging~=23.2
|
|
24
|
+
|
|
25
|
+
[](https://opensource.org/licenses/BSD-2-Clause)
|
|
26
|
+
|
|
27
|
+
[](https://gitlab.com/efficientip/solidserverrest/commits/master)
|
|
28
|
+
|
|
29
|
+
# SOLIDserverRest
|
|
30
|
+
|
|
31
|
+
This 'SOLIDserverRest' allows to easily interact with [SOLIDserver](https://www.efficientip.com/products/solidserver/)'s REST API.
|
|
32
|
+
It allows managing all IPAM objects through CRUD operations.
|
|
33
|
+
|
|
34
|
+
* ***Free software***: BSD2 License
|
|
35
|
+
|
|
36
|
+
This 'SOLIDserverRest' is compatible with [SOLIDserver](https://www.efficientip.com/products/solidserver/) version 7 and ownward.
|
|
37
|
+
|
|
38
|
+
# Install
|
|
39
|
+
Install 'SOLIDserverRest' using pip in your virtualenv:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
pip install SOLIDserverRest
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
# Usage
|
|
46
|
+
|
|
47
|
+
## Using the SOLIDserverRest advanced object (recommended)
|
|
48
|
+
|
|
49
|
+
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
|
+
```
|
|
51
|
+
from SOLIDserverRest import *
|
|
52
|
+
from SOLIDserverRest import adv as sdsadv
|
|
53
|
+
|
|
54
|
+
SDS_HOST = "192.168.254.254"
|
|
55
|
+
SDS_LOGIN = "foo"
|
|
56
|
+
SDS_PWD = "bar"
|
|
57
|
+
|
|
58
|
+
sds = sdsadv.SDS(ip_address=SDS_HOST,
|
|
59
|
+
user=SDS_LOGIN,
|
|
60
|
+
pwd=SDS_PWD)
|
|
61
|
+
try:
|
|
62
|
+
sds.connect(method="native")
|
|
63
|
+
except SDSError as e:
|
|
64
|
+
logging.error(e)
|
|
65
|
+
exit(1)
|
|
66
|
+
|
|
67
|
+
print(adv)
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
More examples in the example directory.
|
|
72
|
+
|
|
73
|
+
## Using the SOLIDserverRest object
|
|
74
|
+
|
|
75
|
+
The raw API is mapped using the SOLIDserverRest object which handle the connection, prepare the formating and handle some errors. It can be usefull twhen the advanced library is not yet implementing an object that you require in your code.
|
|
76
|
+
|
|
77
|
+
### 1. Declare endpoint API point
|
|
78
|
+
Set the API endpoint you want to talk with through API. Could use an IP address
|
|
79
|
+
(v4 or v6) or a host name
|
|
80
|
+
* host = IP address of the SOLIDserver server
|
|
81
|
+
```
|
|
82
|
+
con = SOLIDserverRest("fqdn_host.org")
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 2. Specify connection method
|
|
86
|
+
You can use native connection mode using SOLIDserver default method which provide
|
|
87
|
+
authentication through headers in the requests with information
|
|
88
|
+
encoded in base64
|
|
89
|
+
|
|
90
|
+
* user = user who want to use
|
|
91
|
+
* password = password of the user
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
con.use_native_sds(user="apiuser", password="apipwd")
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
You can also use the basic authentication method for connecting the SOLIDserver.
|
|
98
|
+
|
|
99
|
+
* user = user who want to use
|
|
100
|
+
* password = password of the user
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
con.use_basicauth_sds(user="apiuser", password="apipwd")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 3. Set TLS security
|
|
107
|
+
SSL certificate chain is validated by default, to disable it, use the set_ssl_verify method
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
con.set_ssl_verify(False) # True by default
|
|
111
|
+
rest_answer = con.query("method", "parameters")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Otherwise, you have to provide the certificate file:
|
|
115
|
+
```python
|
|
116
|
+
con = SOLIDserverRest(SERVER)
|
|
117
|
+
```
|
|
118
|
+
If the certificate file is not valide, an exception ```SDSInitError``` is raised.
|
|
119
|
+
|
|
120
|
+
### 4. Request to SOLIDserver API
|
|
121
|
+
|
|
122
|
+
You need parameters:
|
|
123
|
+
* method = choose your method in the list below
|
|
124
|
+
* parameters = Python dictionary with parameters you want to use
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
rest_answer = con.query("method", "parameters")
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 5. Analyze answer
|
|
131
|
+
|
|
132
|
+
* rest_answer => object name
|
|
133
|
+
* rest_answer.status_code => current http answer code set in the object
|
|
134
|
+
* rest_answer.content => Answer core from SOLIDserver API set in the object
|
|
135
|
+
|
|
136
|
+
Example:
|
|
137
|
+
```python
|
|
138
|
+
print(rest_answer)
|
|
139
|
+
print(rest_answer.status_code)
|
|
140
|
+
print(rest_answer.content)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
# Methods that could be used
|
|
144
|
+
Methods are organized to match the ontology used in SOLIDServer, you will find:
|
|
145
|
+
* Sites - address spaces
|
|
146
|
+
* Subnets (v4 and v6)
|
|
147
|
+
* Pools (v4 and v6)
|
|
148
|
+
* Addresses (v4 and v6)
|
|
149
|
+
* Aliases (v4 and v6)
|
|
150
|
+
* DNS servers, views, zones, RR, acl, key
|
|
151
|
+
* application manager
|
|
152
|
+
* DHCP server, scope, shared net, range, static, group
|
|
153
|
+
* device manager
|
|
154
|
+
* VLAN manager
|
|
155
|
+
|
|
156
|
+
More information about supported methods in the [specific document](docs/METHODS.md)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
[](https://opensource.org/licenses/BSD-2-Clause)
|
|
2
2
|
|
|
3
3
|
[](https://gitlab.com/efficientip/solidserverrest/commits/master)
|
|
4
|
-
[](https://codecov.io/gl/efficientip/solidserverrest)
|
|
5
4
|
|
|
6
5
|
# SOLIDserverRest
|
|
7
6
|
|
|
File without changes
|
|
@@ -17,6 +17,14 @@ from .network import Network
|
|
|
17
17
|
from .ipaddress import IpAddress
|
|
18
18
|
from .dns import DNS
|
|
19
19
|
from .dns_zone import DNS_zone
|
|
20
|
-
from .dns_record import
|
|
21
|
-
|
|
20
|
+
from .dns_record import (
|
|
21
|
+
DNS_record,
|
|
22
|
+
NAPTRRecord,
|
|
23
|
+
TXTRecord,
|
|
24
|
+
ARecord,
|
|
25
|
+
AAAARecord,
|
|
26
|
+
CNAMERecord,
|
|
27
|
+
MXRecord,
|
|
28
|
+
NSRecord
|
|
29
|
+
)
|
|
22
30
|
from .device_tools import list_devices
|