<?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: Starting point for objects.AddressObject searches - pandevice in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/467628#M2937</link>
    <description>&lt;P&gt;The value(address) is None. It looks like the object is not found. I also have the same problem. I don't think it is searching "Shared" address object.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2022 22:08:49 GMT</pubDate>
    <dc:creator>Ching</dc:creator>
    <dc:date>2022-02-22T22:08:49Z</dc:date>
    <item>
      <title>Starting point for objects.AddressObject searches - pandevice</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/328999#M2348</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to take it slow in regard to automation with the initial task being the identification of address objects that need to removed when a server or workstation is decommissioned. Would like to leverage python and&lt;/P&gt;&lt;P&gt;the pandevice module. As a start, I am trying to connect to our panorama appliance as this is where 100% of this sort of configuration held. My initial instinct is to try and find a single address object but the error&lt;/P&gt;&lt;P&gt;message I receive leads me to believe that the script as written is searching in the wrong location. See the "/config/shared" location. No address objects should be located there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&amp;nbsp; pandevice.errors.PanObjectMissing: Object doesn't exist: /config/shared/address/entry[@name='$interestingobject$']&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Device group hierarchy&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;?shared? -- I am assuming this where the searching is happening&lt;/P&gt;&lt;P&gt;|&lt;/P&gt;&lt;P&gt;|__&amp;gt;on-pano&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|___&amp;gt; fw1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|___&amp;gt; fw2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not been able to find a means to point the correct device-group yet and most of the documentation involves creation. Any input would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Import supporting stuff#&lt;/P&gt;&lt;P&gt;import pandevice&lt;/P&gt;&lt;P&gt;from pandevice import panorama&lt;/P&gt;&lt;P&gt;from pandevice import objects&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Declares some stuff#&lt;/P&gt;&lt;P&gt;pan = '1.2.3.4'&lt;/P&gt;&lt;P&gt;devicegroup = 'on-pano'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Connect to panorama appliance#&lt;/P&gt;&lt;P&gt;pano = panorama.Panorama(device, "qadmin", "qadmin")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Attempt to set the device group to use with the panorama connection#&lt;/P&gt;&lt;P&gt;panogrp = panorama.DeviceGroup(devicegroup)&lt;/P&gt;&lt;P&gt;pano.add(panogrp)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Define what I want to look for, in this case an host object named interestingobject"#&lt;/P&gt;&lt;P&gt;look4 = pandevice.objects.AddressObject(name="interestingobject")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Find it#&lt;/P&gt;&lt;P&gt;panogrp.find(look4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks all!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 14:40:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/328999#M2348</guid>
      <dc:creator>JeremyClark</dc:creator>
      <dc:date>2020-05-20T14:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Starting point for objects.AddressObject searches - pandevice</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/329018#M2349</link>
      <description>&lt;P&gt;I think I have the location search issue resolved. The basic script works but the returned data needs some work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;------------------------------------&lt;/P&gt;&lt;P&gt;print(look4.about())&lt;BR /&gt;{'value': None, 'type': 'ip-netmask', 'description': None, 'tag': None, 'name': 'interestingobject'}&lt;/P&gt;&lt;P&gt;------------------------------------&lt;/P&gt;&lt;P&gt;Just need to figure out why the 'address' field is not included. If anyone has any input, please reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everyone.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 16:09:18 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/329018#M2349</guid>
      <dc:creator>JeremyClark</dc:creator>
      <dc:date>2020-05-20T16:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Starting point for objects.AddressObject searches - pandevice</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/329041#M2350</link>
      <description>&lt;P&gt;Well,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe I got ahead of myself.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No matter what object I search for; no errors are presented but the object has no value (or appears to have none) or blanks values. The name is know but that does not seem to matter much. Any input into what might be happening? Is the search bad or am I just looking at the returned info in the wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;print(look4._about_object())&lt;BR /&gt;{'value': None, 'type': 'ip-netmask', 'description': None, 'tag': None, 'name': 'interestingobject'}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 17:33:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/329041#M2350</guid>
      <dc:creator>JeremyClark</dc:creator>
      <dc:date>2020-05-20T17:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Starting point for objects.AddressObject searches - pandevice</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/329536#M2357</link>
      <description>&lt;P&gt;You're close.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you create the panorama object and add the device group to the panorama, you want to do refreshall(), giving the device group as the base.&amp;nbsp; So like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from pandevice.panorama import Panorama, DeviceGroup
from pandevice.objects import AddressObject

pano = Panorama(....)
dg = DeviceGroup(devicegroup)

pano.add(dg)

# Now get all the address objects present.
listing = AddressObject.refreshall(dg)
for obj in listing:
    print("* {0}".format(obj.about()))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 May 2020 04:45:04 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/329536#M2357</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2020-05-23T04:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Starting point for objects.AddressObject searches - pandevice</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/467627#M2936</link>
      <description>&lt;P&gt;The value(address) is None. It looks like the object is not found. I also have the same problem. I don't think it is searching "Shared" address object.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 22:06:16 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/467627#M2936</guid>
      <dc:creator>Ching</dc:creator>
      <dc:date>2022-02-22T22:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Starting point for objects.AddressObject searches - pandevice</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/467628#M2937</link>
      <description>&lt;P&gt;The value(address) is None. It looks like the object is not found. I also have the same problem. I don't think it is searching "Shared" address object.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 22:08:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/starting-point-for-objects-addressobject-searches-pandevice/m-p/467628#M2937</guid>
      <dc:creator>Ching</dc:creator>
      <dc:date>2022-02-22T22:08:49Z</dc:date>
    </item>
  </channel>
</rss>

