Is there a way to add firewall rules with API?

Solved
oshin101013
Conversationalist

Is there a way to add firewall rules with API?

Hello guys,

 

url = 'https://api.meraki.com/api/v1/networks/{0}/appliance/firewall/l3FirewallRules'

 

I tried to use this url to add some rules but it overwrites the currently existing rules.

 

Let's say there are 4 rules on a network and I want to add 2 new rules.

And I send a request with PUT. Then there are only 2 new rules on the network.

 

Is there a way to just add the rules with API?

 

Thank you,

1 Accepted Solution
AutomationDude
Building a reputation

Hello,

 

I assume you just want to add the rules on top of what you already have. If that is the case, you could try within your script to read the current rules via API, add your rules on top, and then putt the joint the data back via the API call you're using. Not ideal but seems to be the way to do what you want

View solution in original post

6 Replies 6
ww
Kind of a big deal
Kind of a big deal

No.

You have to fix that in your script

oshin101013
Conversationalist

Thanks. It seems the rules are working as ruleset.

Have a good day!

alemabrahao
Kind of a big deal
Kind of a big deal

It's an old post, but can help you:

 

https://community.meraki.com/t5/Developers-APIs/Put-API-L3-firewall-rules/m-p/85541

I am not a Cisco Meraki 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.

Thanks for the link but the link is talking about no update with 200 OK.

I have no problem with update rule but the rule is working as Set, not individuals.

AutomationDude
Building a reputation

Hello,

 

I assume you just want to add the rules on top of what you already have. If that is the case, you could try within your script to read the current rules via API, add your rules on top, and then putt the joint the data back via the API call you're using. Not ideal but seems to be the way to do what you want

Hi,

Yes, thank you for the reply. I did this way last week and confirmed it worked.

I Hope Meraki changes the way of dealing with the fw rules of API.

Have a nice day!

 

Get notified when there are additional replies to this discussion.