REST API to update Panorama Servers in Firewall

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.

REST API to update Panorama Servers in Firewall

L0 Member

Hi all

 

I wonder can anyone offer some insight, I am trying to write a script to update all of the panorama server settings on a given list of firewalls. That's all fine but I am having an issue with the actual rest api -

 

I used debug CLI output to determine the syntax in order to build the command and it looks right according to the guides I've read, however it doesnt' work. I am testing against a local VM running 7.1.

 

To test I am trying - (I've replaced my key below with key_removed and the IP addresses with x.x.x.x)

  

https://x.x.x.x/api/type=config&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system<panorama-server>x.x.x.x</panorama-server><panorama-server-2>x.x.x.x</panorama-server-2>&key=key_removed

 

It fails with the following -

 

<response status="error" code="13">
<msg>
<line>
Could not find schema node for xpath /config/devices/entry[@name='localhost.localdomain']/deviceconfig/system
<panorama-server>x.x.x.x</panorama-server>
<panorama-server-2>x.x.x.x</panorama-server-2>
</line>
</msg>
</response>
 
So I know something is wrong with the xpath, but I can't seem to figure out what.
 
Does anyone know what I am doing wrong ?
 
Thanks
James
 
1 accepted solution

Accepted Solutions

L0 Member

Nevermind I found the issue, I needed to add &element= as per below - 

 

 

https://x.x.x.x/api/type=config&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system&element=<panorama-server>x.x.x.x</panorama-server><panorama-server-2>x.x.x.x</panorama-server-2>&key=key_removed

  

Hope this helps somebody else.

 

Regards
James

View solution in original post

1 REPLY 1

L0 Member

Nevermind I found the issue, I needed to add &element= as per below - 

 

 

https://x.x.x.x/api/type=config&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system&element=<panorama-server>x.x.x.x</panorama-server><panorama-server-2>x.x.x.x</panorama-server-2>&key=key_removed

  

Hope this helps somebody else.

 

Regards
James

  • 1 accepted solution
  • 2593 Views
  • 1 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!