This 'SOLIDserverRest' allows to easily interact with SOLIDserver's REST API. It allows managing all IPAM objects through CRUD operations.
This 'SOLIDserverRest' is compatible with SOLIDserver version 6.0.1P3 and higher.
Install 'SOLIDserverRest' using pip in your virtualenv:
pip install SOLIDserverRest
Set the API endpoint you want to talk with through API. Could use an IP address (v4 or v6) or a host name
con = SOLIDserverRest("fqdn_host.org")
You can use native connection mode using SOLIDserver default method which provide authentication through headers in the requests with information encoded in base64
You can also use the basic authentication method for connecting the SOLIDserver.
SSL certificate chain is validated by default, to disable it, use the set_ssl_verify method
con.set_ssl_verify(False) # True by default rest_answer = con.query("method", "parameters")
Otherwise, you have to provide the certificate file:
con = SOLIDserverRest(SERVER)
If the certificate file is not valide, an exception
SDSInitError is raised.
You need parameters:
rest_answer = con.query("method", "parameters")
print(rest_answer) print(rest_answer.status_code) print(rest_answer.content)
Methods are organized to match the ontology used in SOLIDServer, you will find:
More information about supported methods in the specific document