pan.xapi no response

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

pan.xapi no response

L0 Member

Why am I not getting response when using pan.xapi vs panxapi.py?

 

from python interpretor:

 

api_sess = pan.xapi.PanXapi(hostname="10.209.32.33",api_username="myusername", api_password="mypassword",api_key='mykey')

 

api_sess..show(xpath = "/config/devices/entry/deviceconfig/system/hostname")

 

*returns no ouptput however using panxapi.py I expected results.

 

python panxapi.py -h 10.209.32.33 -l myusername -xr -s "/config/devices/entry/deviceconfig/system/hostname"
Password:
show: success
<hostname>myhostname</hostname>

2 REPLIES 2

L3 Networker

Hi,

 

1) no need to specify api_username and api_password when api_key is specified

 

2) should handle exceptions

 

3) to see request XML response use for example:

 

    https://github.com/kevinsteves/pan-python/blob/master/doc/pan.xapi.rst#xml_result

@ksteves1 Thank you. It  an old post, but I was stuck and this response helped me fix  the script I was working on. "xml_result()" was the bit I was missing.

pan.xapi is amazing and does exactly what I need. 

  • 4184 Views
  • 2 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!