<?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: Creating a Vsys/VR via CLI in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218636#M1710</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes still looking, just dropped down in priorty on my list. But that would be fantastic if you could share what you have.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 20:47:08 GMT</pubDate>
    <dc:creator>dwmaas</dc:creator>
    <dc:date>2018-06-20T20:47:08Z</dc:date>
    <item>
      <title>Creating a Vsys/VR via CLI</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/207520#M1634</link>
      <description>&lt;P&gt;Does anyone have a script or a way to implement a new virtural firewall and virtual router via the cli? Does not have to be automatic but would like to get to that point? I have a couple dozen to implement and looking for a quicker way vs via gui.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 21:03:05 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/207520#M1634</guid>
      <dc:creator>dwmaas</dc:creator>
      <dc:date>2018-03-26T21:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Vsys/VR via CLI</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218621#M1709</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/34190"&gt;@dwmaas&lt;/a&gt;&amp;nbsp;are you still looking for this? I have been working on a script to create full tenants via vsys creation and could share that portion of the script if you're still looking&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 19:49:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218621#M1709</guid>
      <dc:creator>toquothty</dc:creator>
      <dc:date>2018-06-20T19:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Vsys/VR via CLI</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218636#M1710</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes still looking, just dropped down in priorty on my list. But that would be fantastic if you could share what you have.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 20:47:08 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218636#M1710</guid>
      <dc:creator>dwmaas</dc:creator>
      <dc:date>2018-06-20T20:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Vsys/VR via CLI</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218734#M1712</link>
      <description>&lt;P&gt;Why use CLI?&amp;nbsp; If you're going for automation, API is usually a much better option.&amp;nbsp; You could use any of our API libraries to do this quickly.&amp;nbsp; Here's an example using the &lt;A title="Palo Alto Networks Device Framework" href="https://live.paloaltonetworks.com/deviceframework" target="_self"&gt;Palo Alto Networks Device Framework&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;from pandevice import firewall, device

fw = firewall.Firewall('10.0.1.1', 'admin', 'password', vsys=None)

fw.add(device.Vsys('vsys2', 'My New Vsys1')).create()
fw.add(device.Vsys('vsys3', 'My New Vsys2')).create()
fw.add(device.Vsys('vsys4', 'My New Vsys3')).create()
fw.add(device.Vsys('vsys5', 'My New Vsys4')).create()

fw.commit()&lt;/PRE&gt;
&lt;P&gt;That creates 4 vsys on the firewall.&amp;nbsp; If you need vsys each with their own virtual router you'd do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;from pandevice import firewall, network, device

fw = firewall.Firewall('10.0.1.1', 'admin', 'password', vsys=None)

vr2 = fw.add(network.VirtualRouter('vsys2-vr')
vsys2 = fw.add(device.Vsys('vsys2', 'My New Vsys2'), virtual_routers=[vr2])

vr2.create()
vsys2.create()

fw.commit()
&lt;/PRE&gt;
&lt;P&gt;That would give you a new virtual router in a new vsys.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More information:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://live.paloaltonetworks.com/deviceframework" target="_blank"&gt;https://live.paloaltonetworks.com/deviceframework&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://pandevice.readthedocs.io/en/latest/usage.html#working-with-virtual-system" target="_blank"&gt;http://pandevice.readthedocs.io/en/latest/usage.html#working-with-virtual-system&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://pandevice.readthedocs.io/en/latest/module-device.html#pandevice.device.Vsys" target="_blank"&gt;http://pandevice.readthedocs.io/en/latest/module-device.html#pandevice.device.Vsys&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 15:27:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218734#M1712</guid>
      <dc:creator>btorresgil</dc:creator>
      <dc:date>2018-06-21T15:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Vsys/VR via CLI</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218767#M1713</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/15566"&gt;@btorresgil&lt;/a&gt;&amp;nbsp;This is why it's nice to see others work sometimes. I had a very similar thing to part two I was going to share, but I was defining my variable, then adding it in another line and then creating it in another line. I hadn't even thought about that I could be slimming it down to one line for the add and create!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 20:38:03 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218767#M1713</guid>
      <dc:creator>toquothty</dc:creator>
      <dc:date>2018-06-21T20:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Vsys/VR via CLI</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218769#M1714</link>
      <description>&lt;P&gt;Thank you very much, this would work out super, we do what to automate the entire vsys/vr and bgp router configs. So it is not done manually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 20:45:20 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/creating-a-vsys-vr-via-cli/m-p/218769#M1714</guid>
      <dc:creator>dwmaas</dc:creator>
      <dc:date>2018-06-21T20:45:20Z</dc:date>
    </item>
  </channel>
</rss>

