The easiest method to install pandevice is using pip:
Or, if you have virtualenvwrapper installed:
Pip will install the pan-python library as a dependency.
Upgrade to the latest version:
How to import
To use Palo Alto Networks Device Framework in a project:
You can also be more specific about which modules you want to import:
A few examples
For configuration tasks, create a tree structure using the classes in each module. Nodes hierarchy must follow the model in the Configuration Tree.
The following examples assume the modules were imported as such:
Create a subinterface and commit:
show system info
Some operational commands have methods to refresh the variables in an object:
See more examples in the Usage Guide.
Connecting to PAN-OS 8.0 and higher
PAN-OS 8.0 by default does not allow connections to the API with TLS 1.0. Unfortunately, the latest OSX and many linux distros come with OpenSSL versions that don't support TLS 1.1 or 1.2. OpenSSL 1.0.1 or higher is needed to connect to PAN-OS 8.0. If you try to connect with a lower version of OpenSSL, you'll get a connection error. There are two solutions:
Option 1: Upgrade OpenSSL (more secure)
Linux: Use the instructions for your distribution's package manager to upgrade OpenSSL to 1.0.1 or higher.
Option 2: Enable TLS 1.0 on PAN-OS (less secure)
Follow the direction in the PAN-OS Administrator Guide: Replace the Certificate for Inbound Management Traffic