Delete Specific Zone in Security Policy via XML API

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Please sign in to see details of an important advisory in our Customer Advisories area.

Delete Specific Zone in Security Policy via XML API

L0 Member

So i am trying to delete a specific zone in a policy via XML API.  However, it deletes all of the zones within the policy. Is there a better way to accomplish this?  Or is it even possible to remove a specific zone without removing all of them? 


L0 Member

I struggled with this as well and came up with this as my solution for running on Panorama.

I'm using Postman for my API calls in this case

update all zones in either the Source Zone OR the Destination Zone - not both at the same time  (you are basically overwriting/replacing all of the zones in either the source or destination zone to have the zones you want instead of "deleting" only the zone you want rid of).

if you had a rule or multiple rules with multiple source (or destination) zones - i.e. trust, untrust and dmz - and you wanted to just eliminate the dmz zone - I used the below API and CSV to accomplish this.

I have a CSV file with variables for device group/policy name {{$policy}}, rule name {{$ruleName}} and FROM zone {{$FROM_Zone}}.





then the API Call:


This will replace all 3 zones (trust, untrust and dmz) in the Source ("from") Zone with only the 2 desired zones - trust and untrust - essentially eliminating the unwanted zone (dmz).

  • 1 replies
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!