The Meraki Community
Register or Sign in
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • About FabrizioRollo
FabrizioRollo

FabrizioRollo

Here to help

Member since Apr 24, 2018

‎05-27-2022
Kudos from
User Count
PhilipDAth
Kind of a big deal PhilipDAth
2
MyHomeNWLab
MyHomeNWLab
1
Greenberet
Greenberet
1
View All
Kudos given to
User Count
Greenberet
Greenberet
1
View All

Community Record

10
Posts
4
Kudos
0
Solutions

Badges

CMNA
1st Birthday
First 5 Posts
Lift-Off View All
Latest Contributions by FabrizioRollo
  • Topics FabrizioRollo has Participated In
  • Latest Contributions by FabrizioRollo

Re: Meraki Explorer - OpenAPI Swagger

by FabrizioRollo in Developers & APIs
‎05-27-2022 03:45 AM
‎05-27-2022 03:45 AM
Since there was quite a big interesting on it, I further developed the Meraki-explorer adding some features and fixing some small bugs. Now is possible to configure most important settings of the Meraki Dashboard API Python Library like retry time, maximum_retries and so on:   The script execution will now retry on error (if configured) and continue to the next device/network in the loop without stopping. A detailled error logs ill be shown at the end. ... View more

Re: Redirect stdout, stderr to websocket

by FabrizioRollo in Developers & APIs
‎05-17-2022 10:28 PM
‎05-17-2022 10:28 PM
@PhilipDAthpython has a logging handler for socket SocketHandler but this is TCP socket handler, not a websocket one, adapting this handler to my needs was not the best option for me. ... View more

Re: Redirect stdout, stderr to websocket

by FabrizioRollo in Developers & APIs
‎05-17-2022 10:23 PM
‎05-17-2022 10:23 PM
@Greenberetthis could have been a solution if I had a couple of dashboard instances, since my script has several dashboard instances i preferred to a "global" solution as explained below. Anyway THX ... View more

Re: Redirect stdout, stderr to websocket

by FabrizioRollo in Developers & APIs
‎05-17-2022 10:12 PM
2 Kudos
‎05-17-2022 10:12 PM
2 Kudos
I was finally able to address the issue, the problem was how io.String() handles the buffer...but I ended up with a complete other solution. I was looking to catch the API execution logs and display it in the web Application console, the best solution is to redirect the stdout/stderr to a redis pub/sub server like this: from rlog import RedisHandler logging.basicConfig( level=logging.DEBUG, format='%(asctime)s %(name)12s: %(levelname)8s > %(message)s', datefmt='%Y-%m-%d %H:%M:%S', ) logger = logging.getLogger() logger.addHandler(RedisHandler(channel='live_log',host=redis_hostname, port=6379)) The RedisHandler forwards the stdout/stderr to redis, a websocket server then send all the output to its connected clients (the webapplication console). The result is a "live log" console that lets you follow the script execution without waiting for the API response. Final result can be seen here If you have already installed  the meraki-explorer don't forget to pull the new changes. ... View more

Re: How to push security policies to the multiple networks in an organizati...

by FabrizioRollo in Developers & APIs
‎05-09-2022 04:45 PM
‎05-09-2022 04:45 PM
Have a look at https://github.com/cyberdevnet/meraki-explorer, should be perfect for your task ... View more

Re: Redirect stdout, stderr to websocket

by FabrizioRollo in Developers & APIs
‎05-05-2022 11:26 AM
‎05-05-2022 11:26 AM
@RaphaelLI'm calling the endpoint via GUI with a button, subsequent calls to the same endpoints just return nothing. here's the GUI meraki-explorer  ... View more

Redirect stdout, stderr to websocket

by FabrizioRollo in Developers & APIs
‎05-05-2022 08:20 AM
‎05-05-2022 08:20 AM
Hi,   I'm trying to redirect the stdout and stderr of each API call to a websocket or eventually a log file, here the code I'm using: import meraki from contextlib import redirect_stdout, redirect_stderr import io from flask import Flask from flask_socketio import SocketIO, emit async_mode = None app = Flask(__name__) app.config['SECRET_KEY'] = 'secret!' socketio = SocketIO(app, async_mode=async_mode) @app.route('/getOrganizations') def getOrganizations(): captured_output = io.StringIO() with redirect_stdout(captured_output), redirect_stderr(captured_output): try: API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" dashboard = meraki.DashboardAPI(API_KEY, output_log=False) organizations = dashboard.organizations.getOrganizations() socketio.emit('my_test', {'data': captured_output.getvalue()}) return {'organizations': organizations} except meraki.APIError as err: print('Error: ', err) return {'error': err} If I restart the Flask server everything works fine the FIRST call and I get the desired output: 2022-05-05 17:02:32 meraki: INFO > Meraki dashboard API session initialized with these parameters: {'version': '1.15.0', 'api_key': '************************************9ea0', 'base_url': 'https://api.meraki.com/api/v1', 'single_request_timeout': 60, 'certificate_path': '', 'requests_proxy': '', 'wait_on_rate_limit': True, 'nginx_429_retry_wait_time': 60, 'action_batch_retry_wait_time': 60, 'retry_4xx_error': False, 'retry_4xx_error_wait_time': 60, 'maximum_retries': 2, 'simulate': False, 'be_geo_id': None, 'caller': None, 'use_iterator_for_get_pages': False} 2022-05-05 17:02:32 meraki: DEBUG > {'tags': ['organizations', 'configure'], 'operation': 'getOrganizations', 'method': 'GET', 'url': '/organizations', 'params': None} 2022-05-05 17:02:32 meraki: INFO > GET https://api.meraki.com/api/v1/organizations 2022-05-05 17:02:33 meraki: INFO > GET https://n392.meraki.com/api/v1/organizations 2022-05-05 17:02:34 meraki: INFO > organizations, getOrganizations - 200 OK BUT in the subsequent calls nothing will be redirect to captured_output, it returns just nothing! I've tried with different methods eg. sys.stdout, sys.stderr, with websocket or redirect to file, Flask, FastAPI...you name it! I was able to get the stdout/stderr only the first time after a server restart. Has someone an idea? Regards Fabrizio   ... View more

Re: Retrieve API data with requests

by FabrizioRollo in Developers & APIs
‎05-02-2022 06:26 AM
‎05-02-2022 06:26 AM
You could also try to get the responde as JSON # print json content print(response.json())     Look at the Response section of the guide: https://docs.python-requests.org/en/latest/user/quickstart/ ... View more

Re: Meraki Explorer - OpenAPI Swagger

by FabrizioRollo in Developers & APIs
‎04-29-2022 10:33 AM
‎04-29-2022 10:33 AM
THX @daniel_abbatt ,the way it works is similar, this is just dedicated to Meraki API with some useful feature and I tink easier to use. If you have any question do not hesitate to contact me. ... View more

Meraki Explorer - OpenAPI Swagger

by FabrizioRollo in Developers & APIs
‎04-29-2022 04:30 AM
2 Kudos
‎04-29-2022 04:30 AM
2 Kudos
Hi Everyone,   I've just published a Beta version of an OpenAPI Swagger called Meraki Explorer  Meraki Explorer is a Web-application built on top of the OpenAPI specification that let you consume all available meraki API Endpointswith with some very useful features like the "Rollback". Here just a preview of how the UI looks like, detailled info can be found here Meraki Explorer  This is an Opensource project created by me and has been successfully but partially tested (I didn't run all the endpoints), I hope this tool can help the community as it helps me in my everyday job. Every suggestion/further development is very appreciated! Regards. ... View more
Kudos from
User Count
PhilipDAth
Kind of a big deal PhilipDAth
2
MyHomeNWLab
MyHomeNWLab
1
Greenberet
Greenberet
1
View All
Kudos given to
User Count
Greenberet
Greenberet
1
View All
My Top Kudoed Posts
Subject Kudos Views

Re: Redirect stdout, stderr to websocket

Developers & APIs
2 228

Meraki Explorer - OpenAPI Swagger

Developers & APIs
2 359
View All
custom.footer.
  • Community Guidelines
  • Cisco Privacy
  • Khoros Privacy
  • Privacy Settings
  • Terms of Use
© 2022 Meraki