.. _examples:

Examples
========

Set up your python environment
------------------------------

1. Install pan-python
2. Clone or install pandevice
3. Run a script

For example::

    pip install pan-python
    git clone https://github.com/PaloAltoNetworks/pandevice
    cd pandevice/examples
    python example.py -h

Replace ``example.py`` with the name of the script to run.

Example scripts
---------------

.. automodule:: examples.upgrade

`View the code in upgrade.py <https://github.com/PaloAltoNetworks/pandevice/blob/master/examples/upgrade.py>`_

.. automodule:: examples.userid

`View the code in userid.py <https://github.com/PaloAltoNetworks/pandevice/blob/master/examples/userid.py>`_

.. automodule:: examples.dyn_address_group

`View the code in dyn_address_group.py <https://github.com/PaloAltoNetworks/pandevice/blob/master/examples/dyn_address_group.py>`_

.. automodule:: examples.ensure_security_rule

`View the code in ensure_security_rule.py <https://github.com/PaloAltoNetworks/pandevice/blob/master/examples/ensure_security_rule.py>`_
