<?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 command to enable/disable IPSec tunnel in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-command-to-enable-disable-ipsec-tunnel/m-p/474171#M2971</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;, you were spot on.&amp;nbsp; I had been close with a few commands I had tried throughout the day, and after this post had figured out I needed&amp;nbsp;&lt;SPAN&gt;[@name='localhost.localdomain'], but still couldn't quite get the syntax correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;On my system since I use curl running from Windows and have a WebUI certificate issued from the device itself&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I needed a few little tweaks to your command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This was the winner for me:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;curl -X GET "https://&amp;lt;firewall-fqdn&amp;gt;/api/?key=&amp;lt;key&amp;gt;&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='IPSec-Tunnel-Name']&amp;amp;element=&amp;lt;disabled&amp;gt;yes&amp;lt;/disabled&amp;gt;" --ssl-no-revoke&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1&amp;gt; I had to add the double quotes to the command to keep Windows happy.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;gt; Adding the --ssl-no-revoke element to the command to avoid to schannel revocation&amp;nbsp;error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of interest, this device is not managed by panorama so it is a bit strange that initial error I was getting, I too thought it was behaving like the config was pushed by Panorama.&amp;nbsp; However it’s not, this firewall is stand alone and not managed by any panorama instance, as such there is no override command to use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for helping, much appreciated.&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2022 22:49:48 GMT</pubDate>
    <dc:creator>crostron76</dc:creator>
    <dc:date>2022-03-17T22:49:48Z</dc:date>
    <item>
      <title>API command to enable/disable IPSec tunnel</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-command-to-enable-disable-ipsec-tunnel/m-p/473896#M2969</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to enable/disable an IPSec via the API but cannot produce a command that works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently trying this command to disable the tunnel&lt;/P&gt;&lt;P&gt;&lt;EM&gt;curl -X GET "&amp;lt;firewall-fqdn&amp;gt;//api/?&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name="&amp;lt;firewall-fqdn&amp;gt;"]/network/tunnel/ipsec/entry[@name="IPSec-Tunnel-Name"]/disabled&amp;amp;element=&amp;lt;disabled&amp;gt;yes&amp;lt;/disabled&amp;gt;&amp;amp;key=&amp;lt;key&amp;gt;" --ssl-no-revoke&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It returns the error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;response status="error" code="13"&amp;gt;&amp;lt;msg&amp;gt;&amp;lt;line&amp;gt;set failed, may need to override template object&amp;nbsp; first&amp;lt;/line&amp;gt;&amp;lt;/msg&amp;gt;&amp;lt;/response&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please let me know where I am going wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 01:34:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-command-to-enable-disable-ipsec-tunnel/m-p/473896#M2969</guid>
      <dc:creator>crostron76</dc:creator>
      <dc:date>2022-03-17T01:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: API command to enable/disable IPSec tunnel</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-command-to-enable-disable-ipsec-tunnel/m-p/474000#M2970</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/70630"&gt;@crostron76&lt;/a&gt;, here is an API call that successfully disables an IPsec VPN in configuration (needing a commit to make the change happen):&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://{{host}}/api/?key={{key}}&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='{{tunnelname}}']&amp;amp;element=&amp;lt;disabled&amp;gt;yes&amp;lt;/disabled&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I think there are a couple of things with the original command.&lt;/FONT&gt;&lt;BR /&gt;-&amp;nbsp;&lt;FONT face="courier new,courier"&gt;[@name="&amp;lt;firewall-fqdn&amp;gt;"]&lt;/FONT&gt; needs to be&amp;nbsp;&lt;FONT face="courier new,courier"&gt;[@name='localhost.localdomain']&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;- The&amp;nbsp;&lt;FONT face="courier new,courier"&gt;/disabled&lt;/FONT&gt; is not needed at the end of the xpath, as we are setting the &lt;FONT face="courier new,courier"&gt;disabled&lt;/FONT&gt; element in the &lt;FONT face="courier new,courier"&gt;element=&lt;/FONT&gt; section of the API call&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;- The error "&lt;EM&gt;may need to override template object first"&lt;/EM&gt; implies that the IPsec config was sent from Panorama via a template, not created on the NGFW locally. Ideally, you would therefore make the change to disable the IPsec VPN from Panorama, not locally on the firewall, in order to keep Panorama and NGFW in-sync. Per the &lt;A href="https://docs.paloaltonetworks.com/pan-os/10-2/pan-os-panorama-api/pan-os-xml-api-request-types/configuration-api/override-configuration.html" target="_self"&gt;documentation&lt;/A&gt;, you can change &lt;FONT face="courier new,courier"&gt;action=set&lt;/FONT&gt; in the API call to be &lt;FONT face="courier new,courier"&gt;action=override&lt;/FONT&gt; in order to locally override the template configuration, but consider if this is the solution you want to proceed with.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hope that helps!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 10:27:04 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-command-to-enable-disable-ipsec-tunnel/m-p/474000#M2970</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-03-17T10:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: API command to enable/disable IPSec tunnel</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-command-to-enable-disable-ipsec-tunnel/m-p/474171#M2971</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;, you were spot on.&amp;nbsp; I had been close with a few commands I had tried throughout the day, and after this post had figured out I needed&amp;nbsp;&lt;SPAN&gt;[@name='localhost.localdomain'], but still couldn't quite get the syntax correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;On my system since I use curl running from Windows and have a WebUI certificate issued from the device itself&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I needed a few little tweaks to your command.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This was the winner for me:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;curl -X GET "https://&amp;lt;firewall-fqdn&amp;gt;/api/?key=&amp;lt;key&amp;gt;&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='IPSec-Tunnel-Name']&amp;amp;element=&amp;lt;disabled&amp;gt;yes&amp;lt;/disabled&amp;gt;" --ssl-no-revoke&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1&amp;gt; I had to add the double quotes to the command to keep Windows happy.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;gt; Adding the --ssl-no-revoke element to the command to avoid to schannel revocation&amp;nbsp;error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of interest, this device is not managed by panorama so it is a bit strange that initial error I was getting, I too thought it was behaving like the config was pushed by Panorama.&amp;nbsp; However it’s not, this firewall is stand alone and not managed by any panorama instance, as such there is no override command to use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for helping, much appreciated.&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 22:49:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/api-command-to-enable-disable-ipsec-tunnel/m-p/474171#M2971</guid>
      <dc:creator>crostron76</dc:creator>
      <dc:date>2022-03-17T22:49:48Z</dc:date>
    </item>
  </channel>
</rss>

