<?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: Problem with XML in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/problem-with-xml/m-p/1253#M25</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the other stuff with cryptos and gateways I did work out easily!&lt;/P&gt;&lt;P&gt;But just the small change from edit to set, did the last thing I was not able to do... &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://live.paloaltonetworks.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it is time to create hundreds of tunnels....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Staffan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jan 2013 12:57:18 GMT</pubDate>
    <dc:creator>stafols</dc:creator>
    <dc:date>2013-01-24T12:57:18Z</dc:date>
    <item>
      <title>Problem with XML</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/problem-with-xml/m-p/1251#M23</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to create and VPN tunnel with the XML-api , but I am not clever enough &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://live.paloaltonetworks.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is working fine, I can create the Tunnel and do almost all settings....&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;wget -O dum1.txt --no-check-certificate "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://live.paloaltonetworks.com/"&gt;https://192.168.3.114/api/?type=config&amp;amp;key=%palokey%&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='StaffanTunnel']&amp;amp;element=&lt;/A&gt;&lt;SPAN&gt;&amp;lt;auto-key&amp;gt;&amp;lt;ipsec-crypto-profile&amp;gt;Staffan&amp;lt;/ipsec-crypto-profile&amp;gt;&amp;lt;/auto-key&amp;gt;&amp;lt;tunnel-monitor&amp;gt;&amp;lt;enable&amp;gt;no&amp;lt;/enable&amp;gt;&amp;lt;/tunnel-monitor&amp;gt;&amp;lt;anti-replay&amp;gt;yes&amp;lt;/anti-replay&amp;gt;&amp;lt;copy-tos&amp;gt;no&amp;lt;/copy-tos&amp;gt;&amp;lt;tunnel-interface&amp;gt;tunnel&amp;lt;/tunnel-interface&amp;gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I am failing, when trying to set the IKE gw for the tunnel, what is wrong with the syntax?? (tried a lot of different things, this is just one example)&lt;/P&gt;&lt;P&gt;Want in the end to do everything in one request if possible, but have split the XML:s now to easier do troubleshooting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;wget -O dum1.txt --no-check-certificate "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://live.paloaltonetworks.com/"&gt;https://192.168.3.114/api/?type=config&amp;amp;key=%palokey%&amp;amp;action=edit&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='StaffanTunnel']/auto-key/ike-gateway/entry[@name='StaffanGW']/&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output error is in this example: &amp;lt;response status="error" code="12"&amp;gt;&amp;lt;msg&amp;gt;&amp;lt;line&amp;gt;Invalid target object in edit handler&amp;lt;/line&amp;gt;&amp;lt;/msg&amp;gt;&amp;lt;/response&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running version 5.0.2 on VMware, production later on will be PA-5050s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Staffan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2013 12:33:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/problem-with-xml/m-p/1251#M23</guid>
      <dc:creator>stafols</dc:creator>
      <dc:date>2013-01-18T12:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with XML</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/problem-with-xml/m-p/1252#M24</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If think your error is due to the use of the edit action in your second example, you didn't set the element that changed ( in &lt;A href="https://live.paloaltonetworks.com/docs/DOC-4126"&gt;XML API ref doc&lt;/A&gt; you will see&lt;/P&gt;&lt;P class="p1"&gt;http(s)://hostname/api/?type=config&amp;amp;action=edit&amp;amp;key=keyvalue&amp;amp;xpath=&lt;EM&gt;xpath-value&lt;/EM&gt;&amp;amp;element=&lt;EM&gt;element-value )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #000000; background-color: #ffffff;"&gt;wget -O dum1.txt --no-check-certificate "&lt;/SPAN&gt;&lt;SPAN style="color: #316989; font-size: 12px; background-color: #ffffff; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;A class="jive-link-external-small"&gt;https://192.168.3.114/api/?type=config&amp;amp;key=%palokey%&amp;amp;action=edit&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='StaffanTunnel']/auto-key/ike-gateway/entry[@name='StaffanGW']/&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #000000; background-color: #ffffff;"&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #000000; background-color: #ffffff;"&gt;try that (check the end of the url)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;action=edit&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='StaffanTunnel']/auto-key/ike-gateway&lt;STRONG&gt;&amp;amp;element=&lt;SPAN style="line-height: 1.5em; color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"&gt;&amp;lt;entry name='&lt;/SPAN&gt;StaffanGW&lt;SPAN style="line-height: 1.5em; color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"&gt;'/&amp;gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;or try to use the set action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW you have to define first the IKE GW before attaching it to an ipsec-tunnel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below an example with an IKE GW named titi, psk test attached to interface with ip 192.168.100.254/24 and a peer-ip 1.1.1.1 and profile myprofile&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;note:&lt;/SPAN&gt; I configured some parameters as example, if some parameters are missing just add them to your config.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;note 2:&lt;/SPAN&gt; the last command is the same than your last command and I got a : &amp;lt;response status="success" code="20"&amp;gt;&amp;lt;msg&amp;gt;command succeeded&amp;lt;/msg&amp;gt;&amp;lt;/response&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Define GATEWAY with PSK (name titi - PSK : test)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;action=set&lt;/P&gt;&lt;P&gt;xpath=/config/devices/entry[@name='localhost.localdomain']/network/ike/gateway/entry[@name='titi']/authentication/pre-shared-key&lt;/P&gt;&lt;P&gt;element=&amp;lt;key&amp;gt;test&amp;lt;/key&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Define GATEWAY local IP (use this Ip: 192.168.100.254/24)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;action=set&lt;/P&gt;&lt;P&gt;xpath=/config/devices/entry[@name='localhost.localdomain']/network/ike/gateway/entry[@name='titi']/local-address&lt;/P&gt;&lt;P&gt;element=&amp;lt;ip&amp;gt;192.168.100.254/24&amp;lt;/ip&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Define GATEWAY peer IP (in this case the peer GW is 1.1.1.1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;action=set&lt;/P&gt;&lt;P&gt;xpath=obj="/config/devices/entry[@name='localhost.localdomain']/network/ike/gateway/entry[@name='titi']/peer-address&lt;/P&gt;&lt;P&gt;element=&amp;lt;ip&amp;gt;1.1.1.1&amp;lt;/ip&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Define IKEv1 crypto ( profile myprofile )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;action=set&lt;/P&gt;&lt;P&gt;xpath=/config/devices/entry[@name='localhost.localdomain']/network/ike/gateway/entry[@name='titi']/protocol/ikev1&lt;/P&gt;&lt;P&gt;element=&amp;lt;ike-crypto-profile&amp;gt;myprofile&amp;lt;/ike-crypto-profile&amp;gt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Attach the ipsec-tunnel to IKE GATEWAY&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;action=set&lt;/P&gt;&lt;P&gt;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='toto']/auto-key/ike-gateway&lt;/P&gt;&lt;P&gt;element=&amp;lt;entry name='titi'/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 06:49:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/problem-with-xml/m-p/1252#M24</guid>
      <dc:creator>cviaud</dc:creator>
      <dc:date>2013-01-24T06:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with XML</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/problem-with-xml/m-p/1253#M25</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the other stuff with cryptos and gateways I did work out easily!&lt;/P&gt;&lt;P&gt;But just the small change from edit to set, did the last thing I was not able to do... &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://live.paloaltonetworks.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it is time to create hundreds of tunnels....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Staffan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 12:57:18 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/problem-with-xml/m-p/1253#M25</guid>
      <dc:creator>stafols</dc:creator>
      <dc:date>2013-01-24T12:57:18Z</dc:date>
    </item>
  </channel>
</rss>

