cancel
Showing results for 
Search instead for 
Did you mean: 

Create multiple static routes with a single API call - is it possible with an input file?

Highlighted
Here to help

Create multiple static routes with a single API call - is it possible with an input file?

I tried creating a file like so: [ {static1...}, {static2...}, {staticN...} ] And then I tried using curl with the -d @filename option to add multiple statics to a network but it doesn't work. I can add a single static route using this method but I'm hoping to be able to do it with a single call if possible. I have a lot of routes I need to add.
8 REPLIES
Head in the Cloud

Re: Create multiple static routes with a single API call - is it possible with an input file?

@Steven

 

Have you considered using a list structure and iterating through it  . . . 

 

route_dest = ['static_1', 'static_2', . . . ]

for route in route_dest:

       . . . .

       . . . .

Robin St.Clair | Principal, Caithness Analytics | @uberseehandel
Meraki Employee

Re: Create multiple static routes with a single API call - is it possible with an input file?

Unfortunately no, not today, the API call passes a single data structure for a single static route, so unfortunately it will require one API call per route today.  Certainly easy enough to set up a for loop in your script, but it will be individual API calls.  Make a wish and I'll do the same, I recently had to create some networks with about 2 dozen statics, and ran into this, cannot do it from a single call, unlike L3 FW rules for example, where you could place dozens or hundreds of FW rules with a single API call.  Just not there today for statics.

Here to help

Re: Create multiple static routes with a single API call - is it possible with an input file?


@Uberseehandelwrote:

@Steven

 

Have you considered using a list structure and iterating through it  . . . 

 

route_dest = ['static_1', 'static_2', . . . ]

for route in route_dest:

       . . . .

       . . . .


For now this is what I've done (in my own backwards way) due to the limitation I seem to be running into.  It's slow but as long as it's automated it shouldn't be a problem.

Here to help

Re: Create multiple static routes with a single API call - is it possible with an input file?


@MerakiDavewrote:

Unfortunately no, not today, the API call passes a single data structure for a single static route, so unfortunately it will require one API call per route today.  Certainly easy enough to set up a for loop in your script, but it will be individual API calls.  Make a wish and I'll do the same, I recently had to create some networks with about 2 dozen statics, and ran into this, cannot do it from a single call, unlike L3 FW rules for example, where you could place dozens or hundreds of FW rules with a single API call.  Just not there today for statics.


My kingdom to only have to create a couple of dozen statics.  I'm looking at between 500 and 1000.  While we're wishing for stuff, how about policy-based routing?  It's only been a common thing for about a decade or more.  Would absolutely solve all of my problems right now.

Head in the Cloud

Re: Create multiple static routes with a single API call - is it possible with an input file?

I am using Node-Red to do an autonomous flight control project, it is asynchronous, and is used by Meraki & Cisco devs for demo purposes. You may be able to use it to run multiple threads, and not have to sweat Python. It might sound over-kill, but it is a joy and a revelation to use. You just plug stuff in, it is built on node.js

Robin St.Clair | Principal, Caithness Analytics | @uberseehandel
Meraki Employee

Re: Create multiple static routes with a single API call - is it possible with an input file?

Not to oversimplify, but if I had 1,000 static routes, I would redesign and consider running an appropriate routing protocol.  MX can do both policy based routing and performance based routing as part of the standard SDWAN offering.  I'm guessing it's not fitting your use case for some reason, please discuss with your Meraki or Meraki Partner SE and they will attach notes to the appropriate feature request.  Agree on the API calls for statics that for now it won't be a problem, but will just take longer, might take a couple minutes to place that many statics via API.

Meraki Employee

Re: Create multiple static routes with a single API call - is it possible with an input file?

You got my attention at Node-RED Smiley Happy

 

Here is an early preview of a Demo Node-RED server I am setting up. 

 

https://merakidemo.internetoflego.com

 

It will demonstrate how to use all of the Meraki APIs in various ways.

- Meraki API proxy

- Captive Portal

- Scanning

- Spark

- Meraki API Endpoint samples

 

Working on a complete article, but interested in feedback.

(and sorry for hijacking the thread)

 

Screen Shot 2018-03-15 at 2.02.24 PM.pngAPI endpointsScreen Shot 2018-03-15 at 2.03.30 PM.pngSample frontend

Head in the Cloud

Re: Create multiple static routes with a single API call - is it possible with an input file?

@DexterLaBora

 

I think what you are doing is terrific, a big thumbs up from me.

 

 

Robin St.Clair | Principal, Caithness Analytics | @uberseehandel