Skip to main content

Python module for SOLIDserver REST API

Project description

EipRest - Simple Solidserver REST client

Python implementation of SOLIDserver REST client.

Install

python3 -m pip install eiprest

Usage

As standalone executable script:

  • Using simple parameter format
    python -m eiprest -s solidserver.test.com dns_server_info dns_id=3
  • Using json format
    python -m eiprest --server 10.0.99.99 dns_server_info '{"dns_id":3}'

Run python -m eiprest -h to see all command line options.

As python module in another script:

from eiprest import EipRest
rest = EipRest(host='1.2.3.4', user='ipmadmin', password='admin', debug=True)
params = {'dns_id': 3}
rest.query('GET', 'dns_server_info',  params)
if rest.resp is not None:
  print('Response status: ', rest.resp.status_code)
  response_data = rest.getData()

Advanced Usage

EipRest Object Methods

EipRest(host, user, password, debug=False)

  • host: SOLIDserver hostname or IP address
  • user: SOLIDserver valid login name
  • password: SOLIDserver valid login password
  • debug: enable more verbose output

query(method, service, params=None, payload=None)

  • method: HTTP methods support only GET, POST, PUT, DELETE, and OPTIONS
    Use GET for all *_list services (dns_server_list, dhcp_scope_list, etc.) and *_info services (dns_server_info, dhcp_scope_info, etc.).
    DELETE are reserved for all *_delete services.
    For *_add services, PUT (create) or POST (update) should be used.
    Use OPTIONS without any parameters to get all available input and output parameters of the service.
  • service: SOLIDserver API service name
  • params: Python dictionary containing service parameters
  • payload: Python dictionary containing additional parameters (optional)

rpc(method, service, params=None, payload=None)

Same as query method except that there is no input parameter validation check. Also this is the only way to call SOLIDserver macro in REST API.

Ex.

rest.rpc('POST', 'clish_force_ntp_update.php')

getLastUrl()

Return last URL called.

getData()

Return HTTP response data.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eiprest-1.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eiprest-1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file eiprest-1.1.tar.gz.

File metadata

  • Download URL: eiprest-1.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for eiprest-1.1.tar.gz
Algorithm Hash digest
SHA256 6787dc939bc3a2630f5dbb203204ecc7496c2bdbc4d1156a5a276b6ef4bec844
MD5 1ff6ddb8d4f7fc91608e5b273cf1ff35
BLAKE2b-256 692ff710c3fba8818247426331ccf3ff4a9acd4553be49ffc7a38a3dfd01a92a

See more details on using hashes here.

File details

Details for the file eiprest-1.1-py3-none-any.whl.

File metadata

  • Download URL: eiprest-1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for eiprest-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c3ed76af982eb107bcb0a6788fded4f7f7b6b28ab1aca46553321d339e92d3a
MD5 d2fe2052a9f20d060e54c8f915c996ab
BLAKE2b-256 ee685c715e8c01501d373ef0302ee6b31ecfb3f13631e3d64a4939a8757806c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page