<?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: Zone Creation W/ Python Device Framework in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217920#M1691</link>
    <description>&lt;P&gt;I figured out my issue and figured out I'd post a update in case someone stumbles across this with the same question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of doing fw.add(VLAN_zone) my script for the Zone should have been:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;VLAN_zone = network.Zone(&lt;SPAN&gt;name &lt;/SPAN&gt;= &lt;SPAN&gt;'TEST_706'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;mode &lt;/SPAN&gt;= &lt;SPAN&gt;'layer3'&lt;/SPAN&gt;)&lt;BR /&gt;vsys1.add(VLAN_zone)&lt;BR /&gt;VLAN_zone.create()&lt;/PRE&gt;&lt;P&gt;Using the vsys1 I established earlier to add the Zone.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jun 2018 13:48:47 GMT</pubDate>
    <dc:creator>toquothty</dc:creator>
    <dc:date>2018-06-14T13:48:47Z</dc:date>
    <item>
      <title>Zone Creation W/ Python Device Framework</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217898#M1690</link>
      <description>&lt;P&gt;I am working on a script to do automation of new tenant builds. One thing I am having a tough time with is creating VLAN Zones because I need to assign them to the specifc VSYS/Location but don't seem to have a paramter to do that. I have been able to successfully add things under Objects and Policies to their specific VSYS, but this zone add is hanging me up. Here is an example of what I am trying to do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;fw = firewall.Firewall(&lt;SPAN&gt;'127.0.0.1'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'user'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'pass'&lt;/SPAN&gt;&lt;SPAN&gt;, vsys&lt;/SPAN&gt;=&lt;SPAN&gt;"shared"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE&gt;vsys1 = device.Vsys(&lt;SPAN&gt;name &lt;/SPAN&gt;= &lt;SPAN&gt;'vsys1'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;display_name &lt;/SPAN&gt;= &lt;SPAN&gt;'PRESENTATION'&lt;/SPAN&gt;)&lt;BR /&gt;fw.add(vsys1)&lt;BR /&gt;vsys1.create()&lt;/PRE&gt;&lt;PRE&gt;VLAN_zone = network.Zone(&lt;SPAN&gt;name &lt;/SPAN&gt;= &lt;SPAN&gt;'TEST_706'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;mode &lt;/SPAN&gt;= &lt;SPAN&gt;'layer3'&lt;/SPAN&gt;)&lt;BR /&gt;fw.add(VLAN_zone)&lt;BR /&gt;VLAN_zone.create()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;When I attempt to create the VLAN zone I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:/Users/ttoquothty/PycharmProjects/PaloAlto/IaaS.py", line 34, in &amp;lt;module&amp;gt;&lt;BR /&gt;VLAN_zone.create()&lt;BR /&gt;File "C:\Users\ttoquothty\PycharmProjects\PaloAlto\venv\lib\site-packages\pandevice\base.py", line 576, in create&lt;BR /&gt;device.active().xapi.set(self.xpath_short(), element, retry_on_peer=self.HA_SYNC)&lt;BR /&gt;File "C:\Users\ttoquothty\PycharmProjects\PaloAlto\venv\lib\site-packages\pandevice\base.py", line 3175, in method&lt;BR /&gt;raise the_exception&lt;BR /&gt;pandevice.errors.PanDeviceXapiError: Could not find schema node for xpath /config/shared/zone&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 13:05:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217898#M1690</guid>
      <dc:creator>toquothty</dc:creator>
      <dc:date>2018-06-14T13:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Zone Creation W/ Python Device Framework</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217920#M1691</link>
      <description>&lt;P&gt;I figured out my issue and figured out I'd post a update in case someone stumbles across this with the same question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of doing fw.add(VLAN_zone) my script for the Zone should have been:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;VLAN_zone = network.Zone(&lt;SPAN&gt;name &lt;/SPAN&gt;= &lt;SPAN&gt;'TEST_706'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;mode &lt;/SPAN&gt;= &lt;SPAN&gt;'layer3'&lt;/SPAN&gt;)&lt;BR /&gt;vsys1.add(VLAN_zone)&lt;BR /&gt;VLAN_zone.create()&lt;/PRE&gt;&lt;P&gt;Using the vsys1 I established earlier to add the Zone.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 13:48:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217920#M1691</guid>
      <dc:creator>toquothty</dc:creator>
      <dc:date>2018-06-14T13:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Zone Creation W/ Python Device Framework</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217951#M1692</link>
      <description>&lt;P&gt;I'm glad that you got it working, but that should have worked.&amp;nbsp; I just tested it and it does indeed work for me&amp;nbsp;(since there is no vsys specified in the `fw` object, it should default to `vsys1`).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect your version of `pandevice` is older, and I'd recommend making sure you're running 0.6.0, which is currently the latest.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 16:49:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217951#M1692</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2018-06-14T16:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Zone Creation W/ Python Device Framework</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217955#M1693</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/46544"&gt;@gfreeman&lt;/a&gt;&amp;nbsp;I think it is because in my 'fw' object I have the vsys set to 'shared'. Because looking more closely at the error I was getting it mentions it could not find the xpath for /config/shared/zone. I am on 0.6.3 for Pandevice so should be good there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first go at anything automation related with the Palo (and also new-ish to Python), it's been pretty cool so far!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 17:06:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217955#M1693</guid>
      <dc:creator>toquothty</dc:creator>
      <dc:date>2018-06-14T17:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Zone Creation W/ Python Device Framework</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217956#M1694</link>
      <description>&lt;P&gt;Oops, missed that.&amp;nbsp; Yep, you're right &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 17:19:46 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/zone-creation-w-python-device-framework/m-p/217956#M1694</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2018-06-14T17:19:46Z</dc:date>
    </item>
  </channel>
</rss>

