Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

CA Spectrum Web Services API wrapper.

Project description


image image image

CA Spectrum Web Services API wrapper


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


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)

# Create an event of type 0x10f06 (generates a High Memory Utilization alarm) on a device with IP Address.
event = '0x10f06'
device_ip = ''
var_binds = {0: 75, 1: 99, 3: 'mem_instance', 5: 'name'}

oc.generate_event_by_ip(event, device_ip, var_binds)

If not provided, server and credentials will be read from the environment variables SPECTRUM_URL, SPECTRUM_USERNAME, SPECTRUM_PASSWORD.

Project details

Download files

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

Files for spectrum-client, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size spectrum_client-0.3.0-py2-none-any.whl (6.8 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size spectrum_client-0.3.0-py3-none-any.whl (6.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size spectrum-client-0.3.0.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page