CA Spectrum Web Services API wrapper.
Project description
spectrum-client
CA Spectrum Web Services API wrapper
Instalation
spectrum-client is distributed on PyPI and is available on Linux/macOS and Windows and supports Python 2.7, 3.4+.
pip install -U spectrum-client
Usage
from spectrum_client import Spectrum
oc = Spectrum('http://oneclick.mydomain:8080', 'myuser', 'secret')
# Update a model attribute
oc.update_attribute(0x210afa, 0x10024, 'MySNMPSecret')
# Update multiple attributes
notes = 'Some notes'
updates = [(0x11564, notes), (0x12db9, 'JKL002'), (0x1295d, False)]
oc.update_attributes(mh, updates)
# Get a list of devices by name, using regex, restricting the search to landscape 0x200000
oc.devices_by_name('^SW00', 0x200000)
# Get a lis tof devices by specific attribute from all landscapes
oc.devices_by_attr(0x12db9, 'XYZ001')
# Get a list of devices by multipe matching filters
oc.devices_by_filters([(attr1, 'equals', value1), (attr2, 'has-pcre', '^foo.*bar')], landscape)
# Put a model in maintenance mode
oc.set_maintenance(model_handle, True)
# Remove a model from maintenance mode
oc.set_maintenance(model_handle, False)
If not provided, server and credentials will be read from the environment variables SPECTRUM_URL
, SPECTRUM_USERNAME
, SPECTRUM_PASSWORD
.
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
spectrum-client-0.2.4.tar.gz
(4.9 kB
view hashes)
Built Distributions
Close
Hashes for spectrum_client-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abf941a60b305ce6d9f9fee7ec07f2637c649b309b72d4a650879e104c13938c |
|
MD5 | 16e50f19e724c53f2f392ab4a1c2a2df |
|
BLAKE2b-256 | 1baa94f8cfb1fc74cdd7aa55edb26d323d1da55f44daed8e67791a9755e954f7 |
Close
Hashes for spectrum_client-0.2.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d20e0f2f6190d62597292163e26afdcee1df22950f77fc77cd18857a9bea9f51 |
|
MD5 | cd5b45b59dc109630cef820667c36a2b |
|
BLAKE2b-256 | 27c2e806eea7d2ff27f7ea3118e1123dfcfeabaaf37e1d969b40a1ccf067b36a |