API query from panorama to get IPsec tunnel data

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API query from panorama to get IPsec tunnel data

L1 Bithead

API query from panorama to get IPsec tunnel data

tried the following queries:
http(s)://hostname/api/?type=op&cmd=<show><running><tunnel><flow><all></all></flow></tunnel></running></show>&key=<generated-key>
https://IP//restapi/v10.0/Network/IPSecTunnels
https://IP/api/?type=op&cmd=<show><vpn><flow></flow></vpn></show>

 

but not getting proper response:

<response status="error" code="17">
<msg>
<line>
<![CDATA[ show -> running is unexpected ]]>
</line>
</msg>
</response>

3 REPLIES 3

Cyber Elite
Cyber Elite

@ieng_netops,

While I'm not around a Panorama instance at the moment to verify, have you used the XML-API browser to verify that you actually have the format setup properly? I don't believe that what you are trying to do falls under show running at all. The reason your first command is failing is because the command isn't available. 

If you're just looking for flow information the following is the only thing you need, toss your &key=<key> on the end to authenticate and you should get what you're looking for do you not? That would work on a firewall, but I'm not 100% positive without verifying on a Panorama instance. 

/api/?type=op&cmd=<show><vpn><flow></flow></vpn></show>

 

Hi @ieng_netops ,

 

I would agree with @BPry - VPN tunnel status is not available on the Panorama, you need to get this information from the firewall.

API : https://10.40.18.60/api/?type=op&cmd=%3Cshow%3E%3Cvpn%3E%3Cflow%3E%3C/flow%3E%3C/vpn%3E%3C/show%3E&k...
not getting response for above api
Output:
<response status="error" code="17">
<msg>
<line>
<![CDATA[ show -> vpn not available to xmlapi client ]]>
</line>
</msg>
</response>
  • 2578 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!