PaloAltoNetworks / pan-os-python

The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
https://pan-os-python.readthedocs.io
ISC License
339 stars 166 forks source link

debug not available to xmlapi client #509

Open kirillmuravyev opened 1 year ago

kirillmuravyev commented 1 year ago

Describe the bug

I am doing a simple operational state command query from the documentation:

from panos import firewall

fw = firewall.Firewall('', '', '')
response = fw.op('debug log-receiver statistics')

Expected behavior

Should receive the result of the command

Current behavior

Traceback (most recent call last):
  File "C:\Users\muravkir\Git projects\PANPython\venv\lib\site-packages\panos\base.py", line 3878, in method
    super_method(self, *args, **kwargs)
  File "C:\Users\muravkir\Git projects\PANPython\venv\lib\site-packages\pan\xapi.py", line 951, in op
    self.__type_op(cmd, vsys, extra_qs)
  File "C:\Users\muravkir\Git projects\PANPython\venv\lib\site-packages\pan\xapi.py", line 974, in __type_op
    raise PanXapiError(self.status_detail)
pan.xapi.PanXapiError:  debug not available to xmlapi client

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\muravkir\Git projects\PANPython\operational_commands.py", line 4, in <module>
    response = fw.op('debug log-receiver statistics', xml=False)
  File "C:\Users\muravkir\Git projects\PANPython\venv\lib\site-packages\panos\firewall.py", line 242, in op
    return super(Firewall, self).op(
  File "C:\Users\muravkir\Git projects\PANPython\venv\lib\site-packages\panos\base.py", line 4047, in op
    element = self.xapi.op(cmd, vsys, False, extra_qs, retry_on_peer=retry_on_peer)
  File "C:\Users\muravkir\Git projects\PANPython\venv\lib\site-packages\panos\base.py", line 3899, in method
    raise the_exception

Possible solution

Steps to reproduce

  1. firewall 9 or 10 version
  2. perform "debug log-receiver statistics" op command from script

Screenshots

Context

Your Environment

welcome-to-palo-alto-networks[bot] commented 1 year ago

:tada: Thanks for opening your first issue here! Welcome to the community!