<?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: API to create Address Group in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/294561#M2062</link>
    <description>&lt;P&gt;&lt;SPAN&gt;There are two types of address groups in the Palo Alto Networks firewalls; dynamic and static. By default, the firewall creates a static address group if you do not explicitly select dynamic. Therefore, you need to add the static element at the time of address group creation. The example below shows an example of creating an address-group named "test-address-group"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[https://&amp;lt;firewall-ip&amp;gt;/api/?type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address-group/entry[@name='test-address-group']&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;amp;element=&amp;lt;static /&amp;gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;amp;key=&amp;lt;yourfirewall-ip-key&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this explains the mystery.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Oct 2019 20:34:19 GMT</pubDate>
    <dc:creator>Retired Member</dc:creator>
    <dc:date>2019-10-26T20:34:19Z</dc:date>
    <item>
      <title>API to create Address Group</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/258828#M1907</link>
      <description>&lt;P&gt;I am trying to create a new address group using API but I always end up getting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope tagname"&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope attname"&gt;status&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;=&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope attribute"&gt;"error"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope attname"&gt;code&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;=&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope attribute"&gt;"12"&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="xml-viewer style-scope nodeMargin"&gt;&lt;DIV class="xml-viewer style-scope node"&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope tagname"&gt;msg&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;gt;&lt;/SPAN&gt;&lt;DIV class="xml-viewer style-scope nodeMargin"&gt;&lt;DIV class="xml-viewer style-scope node"&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope tagname"&gt;line&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;gt;&lt;/SPAN&gt;&lt;DIV class="xml-viewer style-scope inline"&gt;&lt;DIV class="xml-viewer style-scope node"&gt;&lt;SPAN class="xml-viewer style-scope value"&gt;Invalid target object in set handler&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="xml-viewer style-scope punctuation end"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope tagname end"&gt;line&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="xml-viewer style-scope punctuation end"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope tagname end"&gt;msg&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN class="xml-viewer style-scope punctuation end"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope tagname end"&gt;response&lt;/SPAN&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="xml-viewer style-scope punctuation"&gt;Can someone help me with the correct xpath to create a new shared address group empty or with a list of address objects.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 21:08:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/258828#M1907</guid>
      <dc:creator>pamalhotra</dc:creator>
      <dc:date>2019-04-25T21:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: API to create Address Group</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/258830#M1908</link>
      <description>&lt;P&gt;If you're using PAN-OS 9.0, I recommend the new REST API. You don't need XPaths to create Address Groups with the new REST API:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;A href="https://docs.paloaltonetworks.com/pan-os/9-0/pan-os-panorama-api.html#" target="_blank"&gt;https://docs.paloaltonetworks.com/pan-os/9-0/pan-os-panorama-api.html#&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using python, you might consider leveraging the Device Framework library. Here's an example of how to create an Address Object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;A href="https://pandevice.readthedocs.io/en/latest/usage.html#configuration" target="_blank" rel="noopener"&gt;https://pandevice.readthedocs.io/en/latest/usage.html#configuration&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Address Groups are very similar:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;A href="https://pandevice.readthedocs.io/en/latest/module-objects.html#pandevice.objects.AddressGroup" target="_blank" rel="noopener"&gt;https://pandevice.readthedocs.io/en/latest/module-objects.html#pandevice.objects.AddressGroup&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using GoLang, we also have the PanGo library:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;A href="https://github.com/PaloAltoNetworks/pango" target="_blank"&gt;https://github.com/PaloAltoNetworks/pango&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're not using Python or Go, you can check out this XML API tutorial lab:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;A href="http://api-lab.paloaltonetworks.com/set-edit-object.html" target="_blank" rel="noopener"&gt;http://api-lab.paloaltonetworks.com/set-edit-object.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It uses pan-python library, but you don't need python code to use it.&amp;nbsp; There are several examples of creating Address Objects and Address Groups with XPaths and XML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-Brian&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 21:24:17 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/258830#M1908</guid>
      <dc:creator>btorresgil</dc:creator>
      <dc:date>2019-04-25T21:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: API to create Address Group</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/258832#M1909</link>
      <description>&lt;P&gt;Hey Brian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I have been trying to use &lt;A href="https://docs.paloaltonetworks.com/pan-os/9-0/pan-os-panorama-api.html#" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.paloaltonetworks.com/pan-os/9-0/pan-os-panorama-api.html#&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using JAVA to create address Groups and rules. And this doesnt work -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="code-wrap"&gt;&lt;PRE&gt;&lt;SPAN class="ph userinput hljs bash"&gt;https://&amp;lt;firewall&amp;gt;/api/?key=apikey&amp;amp;&lt;SPAN class="hljs-built_in"&gt;type&lt;/SPAN&gt;=config&amp;amp;action=&lt;SPAN class="hljs-built_in"&gt;set&lt;/SPAN&gt;&amp;amp;key=keyvalue&amp;amp;xpath=xpath-value&amp;amp;element=element-value &lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;where the xpath-value is:&lt;/P&gt;&lt;DIV class="code-wrap"&gt;&lt;PRE&gt;&lt;SPAN class="ph userinput hljs coffeescript"&gt;/config/devices/entry/vsys/entry/rulebase/security/rules/entry[@name=&lt;SPAN class="hljs-string"&gt;'rule1'&lt;/SPAN&gt;]&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;I am able create address objects using xpath = /config/shared/address/entry[@name='hostname'] and body/ element as element=&amp;lt;ip-netmask&amp;gt;"+ip+"&amp;lt;/ip-netmask&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But a similar one above doesnt work for address groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also in&lt;/P&gt;&lt;PRE&gt;/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address-group&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is supposed to be the devices entry name and vsys entry name?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 21:38:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/258832#M1909</guid>
      <dc:creator>pamalhotra</dc:creator>
      <dc:date>2019-04-25T21:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: API to create Address Group</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/258833#M1910</link>
      <description>&lt;P&gt;I keep getting&lt;/P&gt;&lt;P&gt;&amp;lt;response status="error" code="13"&amp;gt;&lt;BR /&gt;&amp;lt;msg&amp;gt;&lt;BR /&gt;&amp;lt;line&amp;gt;Could not find schema node for xpath /config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='device-group-name']/address-group&amp;lt;/line&amp;gt;&lt;BR /&gt;&amp;lt;/msg&amp;gt;&lt;BR /&gt;&amp;lt;/response&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 21:40:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/258833#M1910</guid>
      <dc:creator>pamalhotra</dc:creator>
      <dc:date>2019-04-25T21:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: API to create Address Group</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/259565#M1913</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see tool I've shared which can do this for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 03:02:59 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/259565#M1913</guid>
      <dc:creator>simon_taylor</dc:creator>
      <dc:date>2019-05-02T03:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: API to create Address Group</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/260082#M1919</link>
      <description>&lt;P&gt;Do the operation in CLI first with the "debug cli on" command activated. This will give you the precise path you need for the API call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See&amp;nbsp;&lt;A href="https://docs.paloaltonetworks.com/pan-os/8-0/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-cli-to-find-xml-api-syntax" target="_blank"&gt;https://docs.paloaltonetworks.com/pan-os/8-0/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-cli-to-find-xml-api-syntax&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 07:44:54 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/260082#M1919</guid>
      <dc:creator>rodvand_de</dc:creator>
      <dc:date>2019-05-07T07:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: API to create Address Group</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/294561#M2062</link>
      <description>&lt;P&gt;&lt;SPAN&gt;There are two types of address groups in the Palo Alto Networks firewalls; dynamic and static. By default, the firewall creates a static address group if you do not explicitly select dynamic. Therefore, you need to add the static element at the time of address group creation. The example below shows an example of creating an address-group named "test-address-group"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[https://&amp;lt;firewall-ip&amp;gt;/api/?type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address-group/entry[@name='test-address-group']&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;amp;element=&amp;lt;static /&amp;gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;amp;key=&amp;lt;yourfirewall-ip-key&amp;gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this explains the mystery.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2019 20:34:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-to-create-address-group/m-p/294561#M2062</guid>
      <dc:creator>Retired Member</dc:creator>
      <dc:date>2019-10-26T20:34:19Z</dc:date>
    </item>
  </channel>
</rss>

