<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Delete Specific Zone in Security Policy via XML API in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/delete-specific-zone-in-security-policy-via-xml-api/m-p/351919#M2458</link>
    <description>&lt;P&gt;So i am trying to delete a specific zone in a policy via XML API.&amp;nbsp; However, it deletes all of the zones within the policy. Is there a better way to accomplish this?&amp;nbsp; Or is it even possible to remove a specific zone without removing all of them?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2020 18:58:23 GMT</pubDate>
    <dc:creator>dhebal</dc:creator>
    <dc:date>2020-09-24T18:58:23Z</dc:date>
    <item>
      <title>Delete Specific Zone in Security Policy via XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/delete-specific-zone-in-security-policy-via-xml-api/m-p/351919#M2458</link>
      <description>&lt;P&gt;So i am trying to delete a specific zone in a policy via XML API.&amp;nbsp; However, it deletes all of the zones within the policy. Is there a better way to accomplish this?&amp;nbsp; Or is it even possible to remove a specific zone without removing all of them?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 18:58:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/delete-specific-zone-in-security-policy-via-xml-api/m-p/351919#M2458</guid>
      <dc:creator>dhebal</dc:creator>
      <dc:date>2020-09-24T18:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Specific Zone in Security Policy via XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/delete-specific-zone-in-security-policy-via-xml-api/m-p/381969#M2540</link>
      <description>&lt;P&gt;I struggled with this as well and came up with this as my solution for running on Panorama.&lt;BR /&gt;&lt;BR /&gt;I'm using Postman for my API calls in this case&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;update &lt;U&gt;all&lt;/U&gt; zones in either the Source Zone OR the Destination Zone - &lt;/STRONG&gt;not both at the same time&amp;nbsp; (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).&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I have a CSV file with variables for device group/policy name {{$policy}}, rule name {{$ruleName}} and FROM zone {{$FROM_Zone}}.&lt;BR /&gt;&lt;STRONG&gt;CSV:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;$policy,$ruleName,$FROM_Zone&lt;BR /&gt;pan-policy-1,testrule1,&amp;lt;member&amp;gt;trust&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;untrust&amp;lt;/member&amp;gt;&lt;/P&gt;&lt;P&gt;pan-policy-1,testrule2,&amp;lt;member&amp;gt;trust&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;untrust&amp;lt;/member&amp;gt;&lt;/P&gt;&lt;P&gt;pan-policy-1,testrule3,&amp;lt;member&amp;gt;trust&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;untrust&amp;lt;/member&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;then the API Call:&lt;/STRONG&gt;&lt;BR /&gt;https://&amp;lt;panorama-IP&amp;gt;/api/?Key=&amp;lt;API-KEY&amp;gt;&amp;amp;type=config&amp;amp;action=edit&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='{{$policy}}']/pre-rulebase/security/rules/entry[@name='{{$ruleName}}']/from&amp;amp;element=&amp;lt;from&amp;gt;{{$FROM_Zone}}&amp;lt;/from&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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).&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:20:04 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/delete-specific-zone-in-security-policy-via-xml-api/m-p/381969#M2540</guid>
      <dc:creator>jfandel</dc:creator>
      <dc:date>2021-01-25T16:20:04Z</dc:date>
    </item>
  </channel>
</rss>

