Rebooting a Meraki device
So far, in our requests, we have only retrieved information by using GET
requests. But what about changing something? Creating or changing a resource in a REST API is usually done by sending POST
or PATCH
/PUT
requests. POST
requests are typically used when creating a resource or kicking off an action, while PATCH
/PUT
are used when updating a resource. In this recipe, we are going to reboot a Meraki device, based on its serial number, using a POST
request.
Getting ready
Open your code editor and start by creating a file called reboot.py
. Next, navigate your terminal to the same directory that you just created the reboot.py
file in.
In your terminal, you'll also have to set an environment variable called MERAKI_DASHBOARD_API_KEY
, whose value is the API key for your Meraki organization. Please refer to the Authenticating web requests recipe, for an introduction on how to set environment variables on different operating systems.