Git Product home page Git Product logo

spectrum-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spectrum-client's Issues

How to get output for devices_by_attr, models_by_name, etc

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')

Put a model in maintenance mode

oc.set_maintenance(0x220e2e, True)

Update notes attribute

notes = 'in maintenance mode'
updates = [(0x11564, notes)]
oc.update_attributes(0x220e2e, updates)

Get list of devices by name

oc.models_by_name('.MRKINW.', 0x200000)

Get devices by specific attribute

oc.devices_by_attr(0x12d7f, '10.1.1.32')

Documentation and Query examples

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:


SSL verification

The script requires a verification to handle ssl communication

How can you return different attributes

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.