Postman to remove group policy on MX's

SnowyHill
Conversationalist

Postman to remove group policy on MX's

Hi,

 

I'm relatively new to Meraki and Postman.

 

I've been playing around with Postman for a few days now and have been able to make some "Get" and "Post" requests just to get a feel as to how things work.

 

One of the things I need to do is remove a Group Policy applied to one of our VLANs.  While I could do this manually, of course, I'd rather automate it.  We are talking 200+ locations here.

 

I did speak with Meraki about doing this and while they did not have anything they could give me, they did suggest I come here and ask the community to see if anyone has done a similar thing and could provide some guidance.

 

Does anyone have any means in doing this with Postman?  I would imagine it would have to perform a "check" to see which locations have the policy, then remove if it exists.

 

This is probably way beyond my skill level so if anyone could help out with how I could do this, that would be great.

 

Thanks!

2 Replies 2
PhilipDAth
Kind of a big deal
Kind of a big deal

I can't help you with Postman, but if you are prepared to have a try with Python, you'll find examples of doing lots of things.

 

There is a getting started guide here (note, use the Python tabs):

https://developer.cisco.com/meraki/api-v1/#!getting-started 

 

developer.cisco.com has labs you can do to learn more:

https://developer.cisco.com/meraki/build/automation-with-python-api-lab/ 

 

This github code contains lots and lots of examples of code to automate things.  You might be able to do a bit of cut and paste if you get lucky.

https://github.com/meraki/automation-scripts 

RaphaelL
Kind of a big deal
Kind of a big deal

Hi ,


I would personnaly use Python to developp a small script to achieve your needs.  The Meraki Python SDK is pretty well made and easy to learn ! I usually test individual endpoints with Postman , but when doing automation I use Python. I'm not sure if you can do that in Postman. 

 

Here is some pseudo code. 

   Loop through all Networks

   Filter networks on something that you desire ( name , tag  [...] )

   Get the Vlan info ( supply the networkID and the Vlan ID )

   Update the same Vlan ID but without the groupPolicyID , remove it 

 

listOfNetworks = getOrganizationNetworks
for Network in ListOfNetworks:
    if "Criteria" == Network["name"]: ###Or Anything to match desired networks
        Vlan = getNetworkApplianceVlan(Network['id'],VlanID)#networkID from "Network" and vlanID
        if "NameOfYourVlanToEdit" == Vlan["name"]: ### Just to make sure its the good vlan
            updateNetworkApplianceVlan ###Update same Data without groupPolicyID

Obviously test it before looping throught all your networks and I'm not responsible for any mess created 🙂 

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.