Getting all Network Objects & Addresses via API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

Getting all Network Objects & Addresses via API

L2 Linker

Hi all,

 

In working with the PAN-OS API on v7, I have been trying to figure out the appropriate way to get all of the network objects and their associated addressesF15 recognized by my firewall.

 

Tried the following query but only seems to return an error code of 7, so I'm not sure if that means my query is malformed or if what I'm asking it for is the wrong request type:

 

Tried via Windows PowerShell:

 

Invoke-RestMethod -Method GET -Uri

"https://MYFIREWALL/api/?type=config&action=get&key=MYAPIKEY&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address-group"

 

If anyone could point me in the right direction, I would be greatly appreciative.

3 REPLIES 3

Community Team Member

Hi @f1r3withf1r3,

 

This might be of help to you :

 

How to Export Address and Address-group Objects Using PAN-OS API:

https://live.paloaltonetworks.com/t5/Tutorials/How-to-Export-Address-and-Address-group-Objects-Using...

 

Cheers !

-Kiwi

LIVEcommunity team member, CISSP
Cheers,
Kiwi
Please help out other users and “Accept as Solution” if a post helps solve your problem !

Read more about how and why to accept solutions.

Thanks @kiwi

 

Based on the documentation for that perl package, looks like its instructions are for linux admins.

 

While this is possible in my particular case, for the sake of future Googlers, is there any guide on making that work in Windows via CygWin/PAN-Perl/Excel?

 

Gluing that together is not readily understandable from the page initially provided. Any pointers would be helpful.

 

 

@f1r3withf1r3,

To the best of my knowledge PAN-perl is depreciated and really isn't recommended anymore, pan-python would be more of the direction most are taking, or Device Framework. 

That being said if you are in a Windows envrioment I would really recommend simply learning the API before you start incorporating any of the other tools that Palo Alto and users have published for use in other languages. Knowing what the command you are issueing is actually doing on your system is something that I deam pretty essential. 

 

 

  • 2162 Views
  • 3 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!