Panorama XML API

Reply
Not applicable

Panorama XML API

Is the XML API on Panorama limited to the same API as the devices?  I discovered if I switch the  context in the Panorama web console using the "Context" dropdown and then issue an XML API call like:

   https://PANORAMA/esp/restapi.esp?type=config&key=KEYVALUE&action=show 

OR

   https://PANORAMA/esp/restapi.esp?type=config&key=KEYVALUE&action=get

it acts  exactly as if I had issued it to a device, returning that device's  running or candidate configuration.  Is there an XML API parameter in Panorama to switch the device context or query for multiple devices' configurations at once?

Also, is there any way to retrieve such items as the user ID agent user/group cache or the current routing table via any of the XML API calls?  We would like to be able to gather this type of information from Panorama or the individual devices but preferably centralized and without logging into the CLI for each device.

Tags (3)
L1 Bithead

Panorama XML Edit API

Hi,

 I am trying to edit multiple objects within a single rule using the Panorama XML API. I am able to edit (update) one object at a time. Is it possible to edit multiple objects using a single API call?

 

Thanks  

Highlighted
L4 Transporter

Re: Panorama XML Edit API

You can, you'd just have to modify your xpath and element accordingly to match the whole configuration you're passing in. Can you provide more detail on what exactly you're trying to change?

L1 Bithead

Re: Panorama XML Edit API

For example if I want to change the destination zone and the action at the same time using a single api call. Is it possible?

Tags (4)
L1 Bithead

Re: Panorama XML Edit API

 

According to the documentation if I want to change a single object( eg. application) the xpath will be

xpath=/config/devices/entry/vsys/entry/rulebase/security/rules/entry[@name='rule1']/appl

ication

and element will be

element=<application><member>app-name</member></application>

 

But my requirement is to change multiple objects ( eg. application and action) using a single api call. Is it possible
? If yes, what will be the xpath?

 

 

Tags (4)
L4 Transporter

Re: Panorama XML Edit API

Your xpath would look something like:

xpath=/config/devices/entry/vsys/entry/rulebase/security/rules/entry[@name='rule1']

 

And your element would include both configuration for application and destination, something like:

<application><member>app-name</member></application><destination><member>any</member></destination>

 

L1 Bithead

Re: Panorama XML Edit API

I tried that but I am getting error 12

Edit breaks config validity

Tags (3)
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 Live Community as a whole!

The Live Community thanks you for your participation!