orgito / spectrum-client Goto Github PK
View Code? Open in Web Editor NEWBroadcom CA Spectrum Web Services API wrapper
License: MIT License
Broadcom CA Spectrum Web Services API wrapper
License: MIT License
I have the following python script and getting no output when I know there is a model with that IP and Name, the maintenance mode function works.
from spectrum_client import Spectrum
oc = Spectrum('http://x.x.x.x', 'userid', 'password')
oc.set_maintenance(0x220e2e, True)
notes = 'in maintenance mode'
updates = [(0x11564, notes)]
oc.update_attributes(0x220e2e, updates)
oc.models_by_name('.MRKINW.', 0x200000)
oc.devices_by_attr(0x12d7f, '10.1.1.32')
Documentation and query examples need an update
Why do we need to put devices on maintance mode on the example script is this mandatory ?
how do we use the SPECTRUM URL and other variables with the script any examples ?
Does the script work with selfsigned cert or URL with https ?
why we getting certificate verfiication errors
from spectrum_client import Spectrum
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import os
import requests
verify = False
if not verify:
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
oc = Spectrum('https://spectrumserver.example.com:9443', 'user', 'password')
oc.devices_by_name('.example.', 0x100000)
ERRORS when using HTTPS
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 360, in connect
ssl_context=context,
File "/usr/local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib64/python3.6/ssl.py", line 365, in wrap_socket
_context=self, _session=session)
File "/usr/lib64/python3.6/ssl.py", line 773, in __init__
self.do_handshake()
File "/usr/lib64/python3.6/ssl.py", line 1033, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib64/python3.6/ssl.py", line 645, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)
During handling of the above exception, another exception occurred:
The script requires a verification to handle ssl communication
How can you return different attributes, such as the serial # and mac address, by searching by device name?
test = oc.devices_by_name('DEVICE_NAME')
print(test)
But, I want to return the below attributes by using the above search
0x10030
0x23000e
0x82002b
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.