<?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 Re: Adding Zones/Tags with XML API in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327609#M2324</link>
    <description>&lt;P&gt;Doing a POST&lt;/P&gt;&lt;P&gt;If I run it again it replaces whatever is there one for one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THis is using the edit function. (set doesnt work because the rule already exists)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see there is a method to add multiple members to address groups via the API, and you would think it would be the same for zones...but no joy&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 19:20:50 GMT</pubDate>
    <dc:creator>ScottHammond</dc:creator>
    <dc:date>2020-05-12T19:20:50Z</dc:date>
    <item>
      <title>Adding Zones/Tags with XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327571#M2318</link>
      <description>&lt;P&gt;So I have been REPLACING tags and zones with the xml API with great success. What I have yet to do is figure out how to ADD tags or zones without disturbing the existing objects...or even replace them with multiple tags/zones&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Working replacement of a zone-&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{Location}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;']/post-rulebase/security/rules/entry[@name='&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{Name}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;']/from/member&amp;amp;element=&amp;lt;member&amp;gt;gp_vpn_general&amp;lt;/member&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This works to replace a single zone....fails if you run it against a rule with multiple zones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried putting multiple members in the element but it only sees and inserts the first one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{Location}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;']/post-rulebase/security/rules/entry[@name='&lt;/SPAN&gt;&lt;SPAN class="unresolvedVariable"&gt;&lt;SPAN&gt;{{Name}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;']/from/member&amp;amp;element=&amp;lt;member&amp;gt;gp_vpn_general&amp;lt;/member&amp;gt;&amp;lt;member&amp;gt;pci&amp;lt;/member&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That puts the vpn zone in and ignores the pci zone, if I switch them it will put the pci zone in and ignore the vpn zone.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So the function seems a 1 for 1 REPLACE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone nudge me in the direction for making additions?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 16:52:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327571#M2318</guid>
      <dc:creator>ScottHammond</dc:creator>
      <dc:date>2020-05-12T16:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Zones/Tags with XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327583#M2320</link>
      <description>&lt;P&gt;Hello &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/132297"&gt;@ScottHammond&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What happens if you add the zones one by one (instead of all at once)?&lt;/P&gt;&lt;P&gt;If I remember it right, there are several ways to call the API. Are you using a "simple" POST or are you different various http methods?&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 17:53:17 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327583#M2320</guid>
      <dc:creator>JoergSchuetter</dc:creator>
      <dc:date>2020-05-12T17:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Zones/Tags with XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327609#M2324</link>
      <description>&lt;P&gt;Doing a POST&lt;/P&gt;&lt;P&gt;If I run it again it replaces whatever is there one for one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THis is using the edit function. (set doesnt work because the rule already exists)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see there is a method to add multiple members to address groups via the API, and you would think it would be the same for zones...but no joy&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 19:20:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327609#M2324</guid>
      <dc:creator>ScottHammond</dc:creator>
      <dc:date>2020-05-12T19:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Zones/Tags with XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327649#M2325</link>
      <description>&lt;P&gt;If I add zones from the cli with a debug running (clearing running a set command) the debug says&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;request cmd="set" obj="/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='Location']/post-rulebase/security/rules/entry[@name='Name']/from" cookie="8038565277332854"&amp;gt;&amp;lt;member&amp;gt;gp_vpn_general&amp;lt;/member&amp;gt;&amp;lt;/request&amp;gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So I changed my xpath to&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='Location']/post-rulebase/security/rules/entry[@name='Name']/from/&amp;lt;member&amp;gt;gp_vpn_general&amp;lt;/member&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and Postman give me this error-&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;status&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"error"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;code&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"13"&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;msg&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;line&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;Could&amp;nbsp;not&amp;nbsp;find&amp;nbsp;schema&amp;nbsp;node&amp;nbsp;for&amp;nbsp;xpath&amp;nbsp;/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='Location']/post-rulebase/security/rules/entry[@name='Name']/from&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;member&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;gp_vpn_general&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;member&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;line&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;msg&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Could&amp;nbsp;not&amp;nbsp;find&amp;nbsp;schema&amp;nbsp;node&amp;nbsp;for&amp;nbsp;xpath&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 May 2020 20:59:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327649#M2325</guid>
      <dc:creator>ScottHammond</dc:creator>
      <dc:date>2020-05-12T20:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Zones/Tags with XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327652#M2326</link>
      <description>&lt;P&gt;Okay so that didnt look right and I changed it to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/from/member&amp;amp;element=&amp;lt;member&amp;gt;gp_vpn_general&amp;lt;/member&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;resulting in&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPA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/SPAN&gt;&lt;SPAN&gt;line&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;msg&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 May 2020 21:12:05 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/327652#M2326</guid>
      <dc:creator>ScottHammond</dc:creator>
      <dc:date>2020-05-12T21:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Zones/Tags with XML API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/329456#M2354</link>
      <description>&lt;P&gt;So the fix was that I needed to expand the element to include not only the member but the "from"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after that. Poof!&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 16:24:38 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/adding-zones-tags-with-xml-api/m-p/329456#M2354</guid>
      <dc:creator>ScottHammond</dc:creator>
      <dc:date>2020-05-22T16:24:38Z</dc:date>
    </item>
  </channel>
</rss>

