- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Enhanced Security Measures in Place: To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.
11-12-2012 10:49 AM
So I'm wanting to get the XML out of the firewall for specific DMZ's so that I can assemble IPAM updates from the XML.
Right now, if I ssh into Panorama, go into config mode, and issue this command:
show device-group DMZ pre-rulebase nat rules
Then I get the output I want, however, doing it interactively isn't what I want - what I'd like to do is convert this into an API call, so I can fetch this with a URL...
Using the API browser however, I cannot seem to duplicate this..export
11-13-2012 08:17 AM
Hi,
You can use that url :
/api/?type=op&cmd=<show><config><running><xpath>devices/entry[@name='localhost.localdomain']/device-group/entry[@name='DMZ']/pre-rulebase/nat</xpath></running></config></show>
go on http://YOUR.PANORAMA.IP/php/rest/browse.php/op::show::config::running::xpath
change the xml content with:
<show><config><running><xpath>devices/entry[@name='localhost.localdomain']/device-group/entry[@name='DMZ']/pre-rulebase/nat</xpath></running></config></show>
click submit
regards
11-13-2012 08:17 AM
Hi,
You can use that url :
/api/?type=op&cmd=<show><config><running><xpath>devices/entry[@name='localhost.localdomain']/device-group/entry[@name='DMZ']/pre-rulebase/nat</xpath></running></config></show>
go on http://YOUR.PANORAMA.IP/php/rest/browse.php/op::show::config::running::xpath
change the xml content with:
<show><config><running><xpath>devices/entry[@name='localhost.localdomain']/device-group/entry[@name='DMZ']/pre-rulebase/nat</xpath></running></config></show>
click submit
regards
11-13-2012 09:06 AM
Yeah, took me another hour of digging, but I eventually found it.
The trick was to get a full copy of the config downloaded locally and view it in Notepad++ in XML mode, then I started collapsing the config elements so that I was only viewing from levels 1 through 5 - and thats when I could see the path....
<devices>
<entry name="localhost.localdomain">
<device-group>
<entry name="DMZ">
<pre-rulebase>
<nat>
XML and I definitely have a love/hate relationship.
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!