Hostsharing HSAdmin API
Project description
This package provides a Python implementation of the Hostsharing HSAdmin API.
Example
>>> from hs.admin.api import API >>> >>> api = API(cas=dict(uri='https://login.hostsharing.net/cas/v1/tickets', ... service='https://config.hostsharing.net:443/hsar/backend'), ... credentials=dict(username='xyz00', ... password='top-secret'), ... backends=['https://config.hostsharing.net:443/hsar/xmlrpc/hsadmin', ... 'https://config2.hostsharing.net:443/hsar/xmlrpc/hsadmin']) >>> >>> dir(api) ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'contact', 'customer', 'domain', 'emailaddress', 'emailalias', 'get_module', 'hive', 'list_modules', 'mandat', 'modules', 'mysqldb', 'mysqluser', 'pac', 'postgresqldb', 'postgresqluser', 'property', 'q', 'role', 'user'] >>> >>> dir(api.mysqluser) ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'add', 'delete', 'get_method', 'get_property', 'list_methods', 'list_properties', 'methods', 'name', 'properties', 'search', 'update'] >>> >>> print api.mysqluser.properties {'pac': {'validationRegexp': '[a-z0-9]*', 'name': 'pac', 'searchable': 'equals', 'readwriteable': 'read', 'minLength': '0', 'displaySequence': '2', 'displayVisible': 'always', 'maxLength': '999', 'type': 'string'}, 'instance': {'validationRegexp': '[a-zA-Z]*', 'name': 'instance', 'searchable': 'equals', 'readwriteable': 'read', 'minLength': '0', 'displaySequence': '2', 'displayVisible': 'always', 'maxLength': '999', 'type': 'string'}, 'password': {'validationRegexp': "[^']{6,}", 'name': 'password', 'searchable': 'equals', 'readwriteable': 'none', 'minLength': '0', 'displaySequence': '2', 'displayVisible': 'always', 'maxLength': '999', 'type': 'string'}, 'name': {'validationRegexp': '[a-z0-9]{5}_[a-z0-9_]{1,}', 'name': 'name', 'searchable': 'equals', 'readwriteable': 'writeonce', 'minLength': '0', 'displaySequence': '1', 'displayVisible': 'always', 'maxLength': '999', 'type': 'string'}} >>> >>> print api.user.search() [{'comment': 'xyz00', 'shell': '/bin/bash', 'locked': False, 'name': 'xyz00', 'quota_hardlimit': '0', 'userid': '104192', 'quota_softlimit': '0', 'pac': 'xyz00', 'id': '12110', 'homedir': '/home/pacs/xyz00'}, {'comment': 'xyz00-admin', 'shell': '/bin/bash', 'locked': False, 'name': 'xyz00-admin', 'quota_hardlimit': '0', 'userid': '104225', 'quota_softlimit': '0', 'pac': 'xyz00', 'id': '12184', 'homedir': '/home/pacs/xyz00/users/admin'}] >>> >>> print api.user.search(where={'name': 'xyz00-admin'}) [{'comment': 'xyz00-admin', 'shell': '/bin/bash', 'locked': False, 'name': 'xyz00-admin', 'quota_hardlimit': '0', 'userid': '104225', 'quota_softlimit': '0', 'pac': 'xyz00', 'id': '12184', 'homedir': '/home/pacs/xyz00/users/admin'}] >>> >>> api.user.update(where={'name': 'xyz00-admin'}, set={'password': 'less-secret'}) >>> >>> api.domain.add(set={'name': 'example.com', user: 'xyz00-admin'}) >>> >>> api.domain.delete(where={'name': 'example.com'})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hs.admin.api-0.3.tar.gz
(5.4 kB
view details)
Built Distribution
File details
Details for the file hs.admin.api-0.3.tar.gz
.
File metadata
- Download URL: hs.admin.api-0.3.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 170cb5ff0dc86e6de3607ce2985a64b7a67521e1d2ff32d407831c5b6ae78561 |
|
MD5 | ccc2fa2cd761cf79744bb652df098564 |
|
BLAKE2b-256 | 3a470ad268036b06aa847dc00451c6496cb10f9b63b368a3b2b1daacfdda7d0e |
File details
Details for the file hs.admin.api-0.3-py3-none-any.whl
.
File metadata
- Download URL: hs.admin.api-0.3-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7ceaab8a16a93cd6184da5705be8ebbfb71ffa8a038dea64497f6bbfb27f937 |
|
MD5 | e7902a2a8a49ff475ed077335b0e3df6 |
|
BLAKE2b-256 | 3a673c7a264c14939cb13e24ba9ad8717c581a80a9cddb6486bfeede16344de1 |