datacenter / aryalogger Goto Github PK
View Code? Open in Web Editor NEWUse the SimpleAciUiLogServer and arya to directly convert UI REST API calls to ACI Python SDK code.
License: Other
Use the SimpleAciUiLogServer and arya to directly convert UI REST API calls to ACI Python SDK code.
License: Other
The following was reported by a user:
Exception happened during processing of request from ('10.1.1.1', 62084)
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Users/user/.virtualenvs/apic_cobra_1.03f/bin/SimpleAciUiLogServer.py", line 241, in init
client_address, server)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 649, in init
self.handle()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/Users/user/.virtualenvs/apic_cobra_1.03f/bin/SimpleAciUiLogServer.py", line 334, in do_POST
response = self.server.dispatch(data['data']['method'], data)
File "/Users/user/.virtualenvs/apic_cobra_1.03f/bin/SimpleAciUiLogServer.py", line 112, in dispatch
self._dispatch(method, params)
File "/Users/user/.virtualenvs/apic_cobra_1.03f/bin/SimpleAciUiLogServer.py", line 128, in _dispatch
return func(**params)
File "/Users/user/.virtualenvs/apic_cobra_1.03f/bin/AryaLogger.py", line 245, in GET
process_get(kwargs['data']['url'])
File "/Users/user/.virtualenvs/apic_cobra_1.03f/bin/AryaLogger.py", line 210, in process_get
qstring = parse_apic_options_string(purl.query)
File "/Users/user/.virtualenvs/apic_cobra_1.03f/bin/AryaLogger.py", line 186, in parse_apic_options_string
raise ValueError("Unknown REST query option: {0}: {1}".format(opt, value))
Test environment is as following
(apic_cobra_1.03f)USER-M-V0RZ:.virtualenvs user$ pip freeze
acicobra===1.0-3f
acimodel===1.0-3f
arya==1.1.2
AryaLogger==1.1.2
requests==2.5.3
SimpleAciUiLogServer==1.1.1
Looks like the default for sslport was somehow dropped in a previous commit.
$ aryalogger
+++WARNING+++ Using an embedded self-signed certificate for HTTPS, this is not secure.
Traceback (most recent call last):
File "/Users/mtimm/.virtualenvs/1.1_1j/bin/aryalogger", line 9, in <module>
load_entry_point('AryaLogger==1.1.5', 'console_scripts', 'aryalogger')()
File "/Users/mtimm/.virtualenvs/1.1_1j/lib/python2.7/site-packages/AryaLogger-1.1.5-py2.7.egg/EGG-INFO/scripts/AryaLogger.py", line 436, in main
start_server(args)
File "/Users/mtimm/.virtualenvs/1.1_1j/lib/python2.7/site-packages/AryaLogger-1.1.5-py2.7.egg/EGG-INFO/scripts/AryaLogger.py", line 347, in start_server
excludes=args.exclude)
File "/Users/mtimm/.virtualenvs/1.1_1j/lib/python2.7/site-packages/SimpleAciUiLogServer-1.1.1-py2.7.egg/EGG-INFO/scripts/SimpleAciUiLogServer.py", line 443, in __init__
bind_and_activate)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 420, in __init__
self.server_bind()
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 434, in server_bind
self.socket.bind(self.server_address)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
TypeError: an integer is required
Fix is forthcoming.
Symptoms: AryaLogger starts fine and prints out the expected text:
$ AryaLogger
+++WARNING+++ Using an embedded self-signed certificate for HTTPS, this is not secure.
serving at:
http://10.1.2.100:8987/apiinspector
https://10.1.2.100:8443/apiinspector
Make sure your APIC(s) are configured to send log messages: welcome username -> Start Remote Logging
Note: If you connect to your APIC via HTTPS, configure the remote logging to use the https server.
However, when browsing to https://10.1.2.100:8443/apiinspector or http://10.1.2.100:8987/apiinspector there is no response. It is possible to browse to https://localhost:8443/apiinspector or http://localhost:8987/apiinspector and get the proper output but that means that remote users of the AryaLogger server are not able to send log messages to it.
Need to tie in cli options for Arya or remove them completely and just generate POST code in a more consistent way.
Cobra querystrings current print the REST API string instead of the cobra string.
Example:
query.rsp-subtree-include = "health,required"
This should be:
query.subtreeInclude = "health,required"
In addition, the following REST API options need to be added as the dev branch of the github version of cobra supports them:
page
page-size
order-by
replica
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.