<?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: Disable tunnel ipsec via api in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246259#M1840</link>
    <description>&lt;P&gt;Thanks, I'll open an issue at Git.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in general, is there&amp;nbsp;a&amp;nbsp; way to disable tunnel via API? If there is, I'd like to test that, since couldn't find anything yet browsing palo api.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jan 2019 12:56:05 GMT</pubDate>
    <dc:creator>mike_yand</dc:creator>
    <dc:date>2019-01-16T12:56:05Z</dc:date>
    <item>
      <title>Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/245786#M1834</link>
      <description>&lt;P&gt;Is there a way to disable ipsec tunnel via api?&lt;/P&gt;&lt;P&gt;From what I reah ansible-pan, there is only state present / absent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 10:03:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/245786#M1834</guid>
      <dc:creator>mike_yand</dc:creator>
      <dc:date>2019-01-13T10:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246134#M1836</link>
      <description>&lt;P&gt;Looking at the module code, it looks like the &lt;CODE&gt;disabled&lt;/CODE&gt; flag is not currently exposed as a param for playbooks.&amp;nbsp; Adding it shouldn't be that big a deal tho.&amp;nbsp; If you are so inclined yourself, you could open a PR against the Ansible libraries yourself, otherwise just open a GitHub issue so we know we need to add this in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/PaloAltoNetworks/ansible-pan" target="_blank"&gt;https://github.com/PaloAltoNetworks/ansible-pan&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 18:09:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246134#M1836</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-01-15T18:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246259#M1840</link>
      <description>&lt;P&gt;Thanks, I'll open an issue at Git.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in general, is there&amp;nbsp;a&amp;nbsp; way to disable tunnel via API? If there is, I'd like to test that, since couldn't find anything yet browsing palo api.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 12:56:05 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246259#M1840</guid>
      <dc:creator>mike_yand</dc:creator>
      <dc:date>2019-01-16T12:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246310#M1842</link>
      <description>&lt;P&gt;There is (replace &lt;CODE&gt;foobar&lt;/CODE&gt;&amp;nbsp;below with the real name of your IPSec tunnel):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; /config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='foobar']/disabled&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look at the code of the Ansible playbook, it's actually statically setting this param to &lt;CODE&gt;False&lt;/CODE&gt; when it performs the configuration.&amp;nbsp; This is why I said that making this addition shouldn't be&amp;nbsp;too hard.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 16:48:21 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246310#M1842</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-01-16T16:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246439#M1844</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason I started this thread is that this one didn't work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tried from /api of the FW:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='xxx']/member[@name='disabled'&lt;/P&gt;&lt;P&gt;didn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='&lt;/SPAN&gt;&lt;SPAN&gt;xxx&lt;/SPAN&gt;&lt;SPAN&gt;']/disabled&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Didn't work either&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;With all those I get&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;response&lt;SPAN class="html-attribute"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="html-attribute-name"&gt;status&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;success&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="html-attribute"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="html-attribute-name"&gt;code&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;7&lt;/SPAN&gt;"&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="collapsible-content"&gt;&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;result/&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/response&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="line"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;But the code isn't changing, no commit pending, nothing.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="line"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;I assume that is because Operational Commands are show commands.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="line"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;From CLI debub request looks like that when disabling tunnel&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="line"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="line"&gt;&amp;lt;request cmd="set" obj="/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='xxx']" cookie="6784285203591846"&amp;gt;&amp;lt;disabled&amp;gt;yes&amp;lt;/disabled&amp;gt;&amp;lt;/request&amp;gt;&lt;/DIV&gt;&lt;DIV class="line"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="line"&gt;&lt;SPAN class="html-tag"&gt;And is done from config / set&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Jan 2019 09:57:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246439#M1844</guid>
      <dc:creator>mike_yand</dc:creator>
      <dc:date>2019-01-17T09:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246475#M1845</link>
      <description>&lt;P&gt;The xpath that I gave (and that the CLI is reporting) is the correct one.&amp;nbsp; You just need to give all the rest of the usual PAN-OS XML API params and it will work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;type: config&lt;/P&gt;
&lt;P&gt;action: set&lt;/P&gt;
&lt;P&gt;xpath:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='&lt;/SPAN&gt;&lt;SPAN&gt;xxx&lt;/SPAN&gt;&lt;SPAN&gt;']/disabled&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;element: &amp;lt;disabled&amp;gt;yes&amp;lt;/disabled&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;key: &amp;lt;your api key here&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:28:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246475#M1845</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-01-17T12:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246476#M1846</link>
      <description>&lt;P&gt;Ok, sorry, looking at what I said, I said setting it to False, which in the PAN-OS XML schema world means the word "yes" or "no", I should have been more clear about that.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:32:22 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246476#M1846</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-01-17T12:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246477#M1847</link>
      <description>&lt;P&gt;Thanks, will give it a try and update!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:34:12 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246477#M1847</guid>
      <dc:creator>mike_yand</dc:creator>
      <dc:date>2019-01-17T12:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Disable tunnel ipsec via api</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246526#M1849</link>
      <description>&lt;P&gt;One other thing I'll mention:&amp;nbsp; I don't know how you're doing these API calls, but I think it's time to plug pandevice at this point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doing this with &lt;A title="pandevice" href="https://github.com/PaloAltoNetworks/pandevice" target="_self"&gt;pandevice&lt;/A&gt; is pretty straight forward:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt; from pandevice.firewall import Firewall&lt;BR /&gt; from pandevice.network import IpsecTunnel&lt;BR /&gt; &lt;BR /&gt; fw = Firewall('192.168.1.1', 'admin', 'admin')&lt;BR /&gt; tun = IpsecTunnel('foobar')&lt;BR /&gt; fw.add(tun)&lt;BR /&gt; tun.refresh()&lt;BR /&gt; tun.disabled = True&lt;BR /&gt; tun.apply()&lt;BR /&gt; fw.commit(sync=True)&lt;BR /&gt; &lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 18:39:34 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/disable-tunnel-ipsec-via-api/m-p/246526#M1849</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-01-17T18:39:34Z</dc:date>
    </item>
  </channel>
</rss>

