Skip to main content

Python library for using the RCDevs API (Manager and SOAP APIs)

Project description

pyrcdevs

Manager API

Example (requesting Server_Status method)

from pyrcdevs import WebADMManager

webadm_manager_api = WebADMManager(
    "my_webadm_host_or_ip", "443", "UserDomain\\api_username", "api_password", "/path/to/ca_file.crt"
)
server_status_response = webadm_manager_api.server_status(servers=True, websrvs=True, webapps=True)

Output is:

{'version': '2.3.24', 'servers': {'ldap': True, 'sql': True, 'session': True, 'pki': True, 'mail': True}, 'webapps': {'HelpDesk': {'version': '1.1.5', 'status': 'Invalid'}, 'OpenID': {'version': '1.6.7', 'status': 'Invalid'}, 'PwReset': {'version': '1.3.4', 'status': 'Ok'}, 'SelfDesk': {'version': '1.4.7', 'status': 'Ok'}, 'SelfReg': {'version': '1.4.4', 'status': 'Ok'}}, 'websrvs': {'OpenOTP': {'version': '2.2.22', 'status': 'Ok', 'license': 'Ok'}, 'SMSHub': {'version': '1.3.1', 'status': 'Ok'}, 'SpanKey': {'version': '2.1.5', 'status': 'Ok', 'license': 'Ok'}}, 'status': False}

TLS client authentication

TLS client authentication may be required if your WebADM server has the manager_auth setting configured to PKI in /opt/webadm/conf/webadm.conf file.

In this case, you can set the p12_file and p12_password options when instantiating the WebADM object:

from pyrcdevs import WebADMManager

webadm_manager_api = WebADMManager(
    "my_webadm_host_or_ip", 
    "443", 
    "UserDomain\\api_username", 
    "api_password", 
    "/path/to/ca_file.crt",
    p12_file_path="/path/to/p12_file.p12",
    p12_password="p12_PasSW0rd"
)
server_status_response = webadm_manager_api.server_status()

SOAP API

Example (requesting openotpNormalLogin method)

from pyrcdevs import OpenOTPSoap

openotp_soap_api = OpenOTPSoap(
    "my_webadm_host_or_ip", "8443", "/path/to/ca_file.crt"
)
response = openotp_soap_api.normal_login("testuser1", ldap_password="password", otp_password="123456")

Output is:

{'code': '1', 'error': None, 'message': 'Authentication success', 'data': None, 'concat': '0'}

Authentication

Authentication may be required if your SOAP endpoint has the Require Certificate / API Key setting configured to Yes in its settings. This setting is located in WebADM under Applications->Configure page of corresponding web service.

Client certificate

For client certiticate authentication, you can set the p12_file and p12_password options when instantiating the OpenOTPSoap object:

from pyrcdevs import OpenOTPSoap

openotp_soap_api = OpenOTPSoap(
    "my_webadm_host_or_ip", 
    "443", 
    "/path/to/ca_file.crt",
    p12_file_path="/path/to/p12_file.p12",
    p12_password="p12_PasSW0rd"
)
response = openotp_soap_api.normal_login("testuser1", ldap_password="password", otp_password="123456")

API key

For API key authentication, you can set the api_key parameter when instantiating the OpenOTPSoap object:

from pyrcdevs import OpenOTPSoap

openotp_soap_api = OpenOTPSoap(
    "my_webadm_host_or_ip", 
    "443", 
    "/path/to/ca_file.crt",
    api_key="5860687476061196336_d788fd99ea4868f35c3b5e21ada3920b9501bb2c",
)
response = openotp_soap_api.normal_login("testuser1", ldap_password="password", otp_password="123456")

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

pyrcdevs-1.0.0.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

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

pyrcdevs-1.0.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file pyrcdevs-1.0.0.tar.gz.

File metadata

  • Download URL: pyrcdevs-1.0.0.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.1 Linux/6.11.0-13-generic

File hashes

Hashes for pyrcdevs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 dc7b18dcde315227c240cf67100b1a1b436a2ed72eac578930487b43cc169e94
MD5 5afe62ca06f3cf824a17b08d4dbc7bc0
BLAKE2b-256 ccd82a26ad926743660e277e589da371ac10dd97359bb2e1bd550b220f0c206b

See more details on using hashes here.

File details

Details for the file pyrcdevs-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyrcdevs-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.1 Linux/6.11.0-13-generic

File hashes

Hashes for pyrcdevs-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 241f0cad8f0f5aa74e68b6a5e834902749c7c55d8fa091735d38c36f53fb871c
MD5 0b49a528295e267545ce8f9994e2fe34
BLAKE2b-256 78558991b007867c9b055780ed6a70b017fa937af865786f326ad1669637e9b0

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