MERAKI_API_KEY Environment Variable

Solved
eroche
Getting noticed

MERAKI_API_KEY Environment Variable

Good Morning!

 

Can someone tell me to proper way of setting the MERAKI_API_KEY environment variable in Linux? I get it set but everytime I reboot my system I loss it.

 

Thanks in advance!

Ed

1 Accepted Solution
sungod
Head in the Cloud

It needs to be in the environment of the user executing the scripts that need it.

 

If you want it just for yourself, you could edit your .profile to add...

 

 

MERAKI_API_KEY="whatever it is"
export MERAKI_API_KEY

 

 

If you will be running the Python scripts from inside a shell script wrapper (for instance if you were using cron to run the script periodically) you can put the same lines in the shell script.

 

At the linux shell prompt, you can type 'env' to see your environment.

 

View solution in original post

2 Replies 2
sungod
Head in the Cloud

It needs to be in the environment of the user executing the scripts that need it.

 

If you want it just for yourself, you could edit your .profile to add...

 

 

MERAKI_API_KEY="whatever it is"
export MERAKI_API_KEY

 

 

If you will be running the Python scripts from inside a shell script wrapper (for instance if you were using cron to run the script periodically) you can put the same lines in the shell script.

 

At the linux shell prompt, you can type 'env' to see your environment.

 

PhilipDAth
Kind of a big deal
Kind of a big deal

I personally prefer the ".env" method, which stores it in an environment file in your home directory.  This is also portable across lots of different environments.

 

https://community.meraki.com/t5/Developers-APIs/A-newer-safer-way-to-access-the-dashboard-API/m-p/69...

 

 

Crap.  That article uses referenes to the old Meraki SDK - but the concept is still legit.

Get notified when there are additional replies to this discussion.