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

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.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.