cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3144
Views
2
Helpful
4
Replies

How to close python meraki.DashboardAPI session

winadm
Community Member

I'm struggling to find a way to close meraki.DashboardAPI session in a docker container with python script inside, that calls

meraki.DashboardAPI

As a final step i want to close the session to meraki dashboard, but i can't find a way to do it. Can anyone advise on some way to achieve this?

4 Replies 4

aleabrahao
Meraki Community All-Star
Meraki Community All-Star

Here are some sample scripts, maybe they can help you.: https://github.com/meraki/automation-scripts

I am not a Cisco employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.

Please, if this post was useful, leave your kudos and mark it as solved.

Rasmus Hoffmann Birkelund
Meraki Community All-Star
Meraki Community All-Star

What you are probably looking for is the C++ equivalent to a destructor. Assuming that the meraki.DashboardAPI() object has a __del__() method, you can simply use del dashboard.

Example:

dashboardObj = meraki.DashboardAPI()

del dashboardObj
#########
LinkedIn ::: https://blog.rhbirkelund.dk/
Like what you see? - Mark as helpful ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution is solely your own.

sungod
Level 11
Level 11

AFAIK the 'session' in the Meraki Python library is just a wrapper for a set of parameters such as base URL org ID, API key, control settings etc. that are then used by each API call referencing that 'session'.

From Dashboard's end, there is no session, it sees just a series of standalone calls, each containing all required info.

If you want to clean up, it's just a local activity, there's no Dashboard session to close.

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

That answer might be a bit tricker when you consider AIO.