<?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 Pull address object using XML API in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1239559#M125290</link>
    <description>&lt;P&gt;Hi All&amp;nbsp;&lt;BR /&gt;I am trying to get details of particular address object( not all address present in shared location) .&lt;BR /&gt;Any pointer for XML API or any suggestion to used panos python SDK&lt;/P&gt;</description>
    <pubDate>Tue, 07 Oct 2025 14:53:45 GMT</pubDate>
    <dc:creator>D.Verma502651</dc:creator>
    <dc:date>2025-10-07T14:53:45Z</dc:date>
    <item>
      <title>Pull address object using XML API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1239559#M125290</link>
      <description>&lt;P&gt;Hi All&amp;nbsp;&lt;BR /&gt;I am trying to get details of particular address object( not all address present in shared location) .&lt;BR /&gt;Any pointer for XML API or any suggestion to used panos python SDK&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 14:53:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1239559#M125290</guid>
      <dc:creator>D.Verma502651</dc:creator>
      <dc:date>2025-10-07T14:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Pull address object using XML API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1239656#M125294</link>
      <description>&lt;P&gt;HI&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/43480"&gt;@BPry&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Any feedback/suggestion here. Trying to pull directly specific address object instead of first pull all address object and then pull specific one.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 09:10:43 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1239656#M125294</guid>
      <dc:creator>D.Verma502651</dc:creator>
      <dc:date>2025-10-08T09:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Pull address object using XML API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1239715#M125300</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/1466448807"&gt;@D.Verma502651&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I can't provide any specifics for the panos Python SDK, I personally hate using abstracted libraries to interact with a devices API since you'll eventually run into a situation where you have to do things natively anyways.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reminder that you can use the API browser to get help with the XML API by just going to &lt;A href="https://&amp;lt;myfirewallip&amp;gt;/api" target="_blank"&gt;https://&amp;lt;myfirewallip&amp;gt;/api&lt;/A&gt;&amp;nbsp;once you have an authenticated session. Getting the details of a single address object is straightfoward, instead of targeting&amp;nbsp;/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address you would just target the actual entry with&amp;nbsp;/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address/entry[@name='files.pythonhosted.org'].&lt;BR /&gt;&lt;BR /&gt;So via Python and using that files.pythonhosted.org FQDN address object as an example, you could do something like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import requests
palo_api_key = "MYKEY" #This can come from a secrets engine or just be set 
firewallFQDN = "myfirewall.lab.local"
headers = {'X-PAN-KEY': str(palo_api_key)} #Use the X-PAN-KEY header for authentication
test = requests.get("https://" + str(firewallFQDN) + "/api/?type=config&amp;amp;action=get&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address/entry[@name='files.pythonhosted.org']",headers=headers, verify=False) #Assuming you dont trust the management cert
&lt;/LI-CODE&gt;
&lt;P&gt;You can then use that collection however you wish. I would personally use something like xmltodict to interact with the return easier, but I'm not sure what you're really trying to do with just collecting the object. You could do something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import xmltodict
validate_dict = xmltodict.parse(test.content)
objectConfiguration = validate_dict['response']['result']['entry']
print(objectConfiguration)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That should give you the building blocks to put something together not knowing what you're actually doing. You could use that as a way to validate that objectConfiguration matches what you're expecting and then alerting if it doesn't as an example.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 00:45:28 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1239715#M125300</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2025-10-09T00:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Pull address object using XML API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1240907#M125432</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/43480"&gt;@BPry&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Have one more query , lets say if we don't know the address object name , then assuming we need to first pull all address object and then filter it ?&lt;BR /&gt;In my case we have around 50 k address object.. so trying to check what is efficient way to do .&lt;BR /&gt;Thanks ,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Deepak&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 14:39:06 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1240907#M125432</guid>
      <dc:creator>D.Verma502651</dc:creator>
      <dc:date>2025-10-29T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pull address object using XML API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1241084#M125454</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/1466448807"&gt;@D.Verma502651&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can return the addresses through the following, just adjust the xpath to account for where you're actually looking for the objects (IE: shared versus vsys1):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;gather_addresses = requests.get(myFirewallFQDN + "/api/?type=config&amp;amp;action=get&amp;amp;xpath=/config/shared/address']/vsys/entry[@name='vsys1']/address",headers=headers, verify=False)

result_dict = xmltodict.parse(gather_addresses.content)

addresses = result_dict['response']['result']['address']['entry']
for address in addresses:
	if '172.16.' in str(address):
		print(address)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will return every address object that you will then need to parse down to find the value that matches what you are looking for. The reason where doing a substring match in the entire address object is because it's easier than getting the actual address object value due to the way that the different object types are structured. You could do a direct value match if you wanted, you would just need to parse every object type properly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2025 20:21:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/pull-address-object-using-xml-api/m-p/1241084#M125454</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2025-10-31T20:21:39Z</dc:date>
    </item>
  </channel>
</rss>

