Sunday, April 26, 2026
HomeCloud ComputingGet Palms-on with the Meraki API within the DevNet Sandbox

Get Palms-on with the Meraki API within the DevNet Sandbox

[ad_1]

One of many strongest elements of the Meraki platform is the constant and simplified operational administration of the community. The trendy API, as an extension to the cloud managed service, makes it amazingly easy to programmatically management and handle all features of your community. There are clients that absolutely automate the onboarding of units through the Meraki portal utilizing routine automation scripts. Or, front-end programs or operational groups with lookup instruments that pull analytics or knowledge from the API. Thus, vastly streamlining operational processes required to help a company.

This weblog will showcase a number of the methods that can be utilized and constructed upon to combine the Meraki API programmatically. To do that we are going to use the DevNet always-on sandbox lab. With this we are going to solely be making learn (get) requests into the always-on sandbox. And to make this simple to make use of, we’re going to use the Google Collaboratory surroundings, which lets you use Google cloud to run these examples.

Discover the Meraki API utilizing the DevNet Sandbox

To start exploring the Meraki API utilizing the DevNet Sandbox, I’ve created a Collaboratory on Google on the beneath hyperlink. To make use of this, you will have a couple of issues,

  1. A private Gmail account. This can share a duplicate of the instance you can modify in drive. If you happen to use your company account, it should solely enable this in case your company has drive entry.
  2. You’ll then entry the hyperlink beneath and file/save a duplicate into drive, from which level a learn solely copy will develop into writable, and modifiable to you.

Right here is the hyperlink:

https://colab.analysis.google.com/drive/15qs6TFn8gtsTM0PTUUbuubGLYwHJw8hV

The very first thing we are going to do is save a duplicate of this learn solely sheet into your drive, which is able to make it learn/write. From the file menu you may click on “save a duplicate to drive”

As soon as that is carried out you may consider the sheet. Inside this sheet there are textual content blocks, code blocks, and outcomes blocks. The code blocks are absolutely modifiable, and symbolize code operating in an actual python surroundings positioned within the Google cloud. To execute the code inside a block, you may click on the play button to the left of the block. If you do that, any outcomes will present up.

The place this turns into notably attention-grabbing is once we pair this cloud based mostly improvement surroundings with the DevNet always-on Meraki Sandbox. It is a useful Meraki occasion sponsored and managed by the DevNet group. For an inventory of all Sandboxes, you may consider devnetsandbox.cisco.com.

For our explicit sandbox, we will likely be utilizing the always-on sandbox. That is accessible on the beneath hyperlink, however ought to this hyperlink change, you could find it by choosing networking sandboxes from devnetsandbox.cisco.com. (or looking Meraki, or many different methods :)).

https://devnetsandbox.cisco.com/RM/Diagram/Index/a9487767-deef-4855-b3e3-880e7f39eadc?diagramType=Topology

Setting Variables

What we are going to do within the beneath code segments, is we set a couple of variables we will use additional on within the code. This makes it so to take your actual Meraki surroundings, and alter a couple of URLS, and seek for significant data in these variables (resembling YOUR system, or YOUR community), and use the code to create tables and graphs you can modify as you see match.

After setting the variables, we do a quite simple get request from Meraki, that we are going to do many occasions for various data all through the pattern on Colab.

We then print the outcomes, which is able to present up in a textual content string of JSON knowledge.

To translate this into actual JSON we will use, we use the beneath command after which print it so we will see.

 

That is exceptionally helpful as now we have helpful knowledge formatted as JSON. Constructing upon this, we will use a library known as Pandas which is well-known within the knowledge science and ML communities, and is basically “Excel on Steroids for Python.” What turns into attention-grabbing is its native help for studying in our JSON, right into a desk.

Utilizing the Pandas module

Under we load the Pandas module because the title pd, which we will reference. We then import the JSON, and print out a desk with the columns we’re involved in. What’s elegant about that is the simplicity, we import the module, learn within the JSON in a single intuitive command, and create a desk with the headings we’re involved in.

After doing a couple of extra operations within the code, following by the colab sheet, we make a couple of extra get requests, retailer as a couple of completely different tables, and do various things. (You possibly can discover the sheet.) We get your hands on the community within the group that we referenced on the outset of this sheet, and we get the highest talkers for this through doing a get on the URI and storing it as JSON. Then importing into Pandas (like beneath), and spitting out the desk.

We now have an inventory of purchasers and their bandwidth utilization. We will then very simply create graphs for utilization. This may additionally all be carried out simply through a webapp on your community groups. We do that utilizing the Pandas built-in graph functionality, in addition to an instance of utilizing Seaborn, which is used for knowledge visualization.

 

 

That is only a excessive stage of a number of the capabilities that may be uncovered simply through the Meraki API. The aim of the colab sheet that was created, in addition to the DevNet sandbox, is to allow you to have the ability to play with and consider the API. The examples within the colab sheet are supposed to be useful code, and stepping stones that cut back the barrier to leveraging programmability to create significant outcomes.

I hope this weblog was useful. It explored utilizing the Meraki API through utilizing the always-on DevNet Sandbox. When you’ve got an always-on sandbox, creating, sharing, and reusing examples in Google Colaboratory is a pure match.

Associated assets

 


We’d love to listen to what you assume. Ask a query or depart a remark beneath.
And keep linked with Cisco DevNet on social!

LinkedIn | Twitter @CiscoDevNet | Fb | YouTube Channel

Share:



[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments