<?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 IpsecTunnel  api refresh in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/280771#M1986</link>
    <description>&lt;P&gt;im trying to get a list of ipsec tunnels from each template stack i have. but anytime i attempt to use the class pandevice.network.IpsecTunnel i receive an error that pandevice doesnt have an attribute network....&amp;nbsp; according to the documentation here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pandevice.readthedocs.io/en/latest/module-network.html" target="_blank" rel="noopener"&gt;https://pandevice.readthedocs.io/en/latest/module-network.html &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it does have a class pandevice.network.IpsecTunnel&amp;nbsp; &amp;nbsp;do i need to define something before i can reference this class ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Aug 2019 15:33:33 GMT</pubDate>
    <dc:creator>JohnCrubaugh</dc:creator>
    <dc:date>2019-08-02T15:33:33Z</dc:date>
    <item>
      <title>IpsecTunnel  api refresh</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/280771#M1986</link>
      <description>&lt;P&gt;im trying to get a list of ipsec tunnels from each template stack i have. but anytime i attempt to use the class pandevice.network.IpsecTunnel i receive an error that pandevice doesnt have an attribute network....&amp;nbsp; according to the documentation here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pandevice.readthedocs.io/en/latest/module-network.html" target="_blank" rel="noopener"&gt;https://pandevice.readthedocs.io/en/latest/module-network.html &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it does have a class pandevice.network.IpsecTunnel&amp;nbsp; &amp;nbsp;do i need to define something before i can reference this class ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 15:33:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/280771#M1986</guid>
      <dc:creator>JohnCrubaugh</dc:creator>
      <dc:date>2019-08-02T15:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: IpsecTunnel  api refresh</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/280821#M1987</link>
      <description>&lt;P&gt;import sys&lt;BR /&gt;import io&lt;BR /&gt;import json&lt;BR /&gt;import pandevice&lt;BR /&gt;from pandevice import base&lt;BR /&gt;from pandevice import firewall&lt;BR /&gt;from pandevice import panorama&lt;BR /&gt;from pandevice import objects&lt;BR /&gt;from pandevice import policies&lt;BR /&gt;from pandevice.panorama import Panorama&lt;/P&gt;&lt;P&gt;devices = [ device1, device2, device3 ]&lt;BR /&gt;templates = [Temp1, Temp2, Temp3, Temp4]&lt;BR /&gt;auth_key = "mykey"&lt;BR /&gt;fw = firewall.Firewall()&lt;/P&gt;&lt;P&gt;#to define which panorama you will connect to&lt;BR /&gt;for device in devices:&lt;BR /&gt;pano = panorama.Panorama(device, api_key=auth_key)&lt;/P&gt;&lt;P&gt;# when you need to fetch objects in the Device Group&lt;BR /&gt;for temp in templates:&lt;BR /&gt;tempgrp = pandevice.panorama.Template(temp)&lt;BR /&gt;pano.add(tempgrp)&lt;BR /&gt;ipsecgrp = pandevice.network.IpsecTunnel.refreshall(panogrp)&lt;BR /&gt;pano.add(ipsecgrp)&lt;BR /&gt;objects_list = []&lt;BR /&gt;for object_element in ipsec_object_list:&lt;BR /&gt;obj = {&lt;BR /&gt;'name': object_element.name,&lt;BR /&gt;'tunnel_interface': object_element.tunnel_interface,&lt;BR /&gt;'type': object_element.type,&lt;BR /&gt;}&lt;BR /&gt;objects_list.append(obj)&lt;BR /&gt;for object in objects_list:&lt;BR /&gt;print (object)&lt;BR /&gt;print()&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 15:36:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/280821#M1987</guid>
      <dc:creator>JohnCrubaugh</dc:creator>
      <dc:date>2019-08-02T15:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: IpsecTunnel  api refresh</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/281176#M1990</link>
      <description>&lt;P&gt;Looks like the problem is that you haven't imported &lt;CODE&gt;pandevice.network&lt;/CODE&gt; at all.&amp;nbsp; Once you do that, you should be ok.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 16:07:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/281176#M1990</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-08-05T16:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: IpsecTunnel  api refresh</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/281177#M1991</link>
      <description>&lt;P&gt;Two other comments:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First is that you shouldn't do &lt;CODE&gt;pano.add(ipsecgrp)&lt;/CODE&gt; after the refresh.&amp;nbsp; The objects are already in the pandevice object tree (as children of the template), so you don't need to add them in again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to print out details of an object, you can use the &lt;CODE&gt;.about()&lt;/CODE&gt; function that all pandevice objects have.&amp;nbsp; If you just want to see a few params and not everything, then making a separate dict and printing that is fine.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 16:13:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/281177#M1991</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-08-05T16:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: IpsecTunnel  api refresh</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/281178#M1992</link>
      <description>&lt;P&gt;thank you for the additional guidance.. ill work on this more today and let you know my outcome.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 16:22:12 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ipsectunnel-api-refresh/m-p/281178#M1992</guid>
      <dc:creator>JohnCrubaugh</dc:creator>
      <dc:date>2019-08-05T16:22:12Z</dc:date>
    </item>
  </channel>
</rss>

