pan-os-python


Namepan-os-python JSON
Version 1.12.1 PyPI version JSON
download
home_pagehttps://github.com/PaloAltoNetworks/pan-os-python
SummaryFramework for interacting with Palo Alto Networks devices via API
upload_time2024-05-31 10:54:36
maintainerNone
docs_urlNone
authorPalo Alto Networks
requires_python!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7
licenseISC
keywords panos pan-os-python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Palo Alto Networks PAN-OS SDK for Python
========================================

The PAN-OS SDK for Python (pan-os-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.

* Documentation: http://pan-os-python.readthedocs.io

-----

[![Latest version released on PyPi](https://img.shields.io/pypi/v/pan-os-python.svg)](https://pypi.python.org/pypi/pan-os-python)
[![Python versions](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7%20%7C%203.8-blueviolet)](https://pypi.python.org/pypi/pan-os-python)
[![License](https://img.shields.io/pypi/l/pan-os-python)](https://github.com/PaloAltoNetworks/pan-os-python/blob/develop/LICENSE)
[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg)](http://pan-os-python.readthedocs.io/en/latest/?badge=latest)
[![Chat on GitHub Discussions](https://img.shields.io/badge/chat%20on-GitHub%20Discussions-brightgreen)](https://github.com/PaloAltoNetworks/pan-os-python/discussions)

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org/)
[![Powered by DepHell](https://img.shields.io/badge/Powered%20by-DepHell-red)](https://github.com/dephell/dephell)
[![GitHub contributors](https://img.shields.io/github/contributors/PaloAltoNetworks/pan-os-python)](https://github.com/PaloAltoNetworks/pan-os-python/graphs/contributors/)

-----

Features
--------

- Object model of Firewall and Panorama configuration
- Multiple connection methods including Panorama as a proxy
- All operations natively vsys-aware
- Support for high availability pairs and retry/recovery during node failure
- Batch User-ID operations
- Device API exception classification

Status
------

Palo Alto Networks PAN-OS SDK for Python is considered stable. It is fully tested
and used in many production environments. Semantic versioning is applied to indicate
bug fixes, new features, and breaking changes in each version.

Install
-------

Install using pip:

```shell
pip install pan-os-python
```

Upgrade to the latest version:

```shell
pip install --upgrade pan-os-python
```

If you have poetry installed, you can also add pan-os-python to your project:
 
```shell
poetry add pan-os-python
```

How to import
-------------

To use pan-os-python in a project:

```python
import panos
```

You can also be more specific about which modules you want to import:

```python
from panos import firewall
from panos import network
```


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](http://pan-os-python.readthedocs.io/en/latest/configtree.html).

The following examples assume the modules were imported as such:

```python
from panos import firewall
from panos import network
```

Create an interface and commit:

```python
fw = firewall.Firewall("10.0.0.1", api_username="admin", api_password="admin")
eth1 = network.EthernetInterface("ethernet1/1", mode="layer3")
fw.add(eth1)
eth1.create()
fw.commit()
```

Operational commands leverage the 'op' method of the device:

```python
fw = firewall.Firewall("10.0.0.1", api_username="admin", api_password="admin")
print fw.op("show system info")
```

Some operational commands have methods to refresh the variables in an object:

```python
# populates the version, serial, and model variables from the live device
fw.refresh_system_info()
```

See more examples in the [Usage Guide](http://pan-os-python.readthedocs.io/en/latest/usage.html).

Upgrade from pandevice
----------------------

This `pan-os-python` package is the evolution of the older `pandevice` package. To
upgrade from `pandevice` to `pan-os-python`, follow these steps.

Step 1. Ensure you are using python3

   [Python2 is end-of-life](https://www.python.org/doc/sunset-python-2/) and not
   supported by `pan-os-python`.

Step 2. Uninstall pandevice:

```shell
pip uninstall pandevice
 # or
poetry remove pandevice
```

Step 3. Install pan-os-python:

```shell
pip3 install pan-os-python
 # or
poetry add pan-os-python
```

Step 4. Change the import statements in your code from `pandevice` to `panos`. For example:

```python
import pandevice
from pandevice.firewall import Firewall

 # would change to

import panos
from panos.firewall import Firewall
```

Step 5. Test your script or application

   There are no known breaking changes
   between `pandevice v0.14.0` and `pan-os-python v1.0.0`, but it is a major
   upgrade so please verify everything works as expected.

Contributors
------------

- Brian Torres-Gil - [btorresgil](https://github.com/btorresgil)
- Garfield Freeman - [shinmog](https://github.com/shinmog)
- John Anderson - [lampwins](https://github.com/lampwins)
- Aditya Sripal - [AdityaSripal](https://github.com/AdityaSripal)

Thank you to [Kevin Steves](https://github.com/kevinsteves), creator of the [pan-python library](https://github.com/kevinsteves/pan-python)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PaloAltoNetworks/pan-os-python",
    "name": "pan-os-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
    "maintainer_email": null,
    "keywords": "panos, pan-os-python",
    "author": "Palo Alto Networks",
    "author_email": "devrel@paloaltonetworks.com",
    "download_url": "https://files.pythonhosted.org/packages/41/fe/f8255e7804f73342f3193d0712c81caffd22ee53216d6dfc27ef83a2874d/pan_os_python-1.12.1.tar.gz",
    "platform": null,
    "description": "Palo Alto Networks PAN-OS SDK for Python\n========================================\n\nThe PAN-OS SDK for Python (pan-os-python) is a package to help interact with\nPalo Alto Networks devices (including physical and virtualized Next-generation\nFirewalls and Panorama).  The pan-os-python SDK is object oriented and mimics\nthe traditional interaction with the device via the GUI or CLI/API.\n\n* Documentation: http://pan-os-python.readthedocs.io\n\n-----\n\n[![Latest version released on PyPi](https://img.shields.io/pypi/v/pan-os-python.svg)](https://pypi.python.org/pypi/pan-os-python)\n[![Python versions](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7%20%7C%203.8-blueviolet)](https://pypi.python.org/pypi/pan-os-python)\n[![License](https://img.shields.io/pypi/l/pan-os-python)](https://github.com/PaloAltoNetworks/pan-os-python/blob/develop/LICENSE)\n[![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg)](http://pan-os-python.readthedocs.io/en/latest/?badge=latest)\n[![Chat on GitHub Discussions](https://img.shields.io/badge/chat%20on-GitHub%20Discussions-brightgreen)](https://github.com/PaloAltoNetworks/pan-os-python/discussions)\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org/)\n[![Powered by DepHell](https://img.shields.io/badge/Powered%20by-DepHell-red)](https://github.com/dephell/dephell)\n[![GitHub contributors](https://img.shields.io/github/contributors/PaloAltoNetworks/pan-os-python)](https://github.com/PaloAltoNetworks/pan-os-python/graphs/contributors/)\n\n-----\n\nFeatures\n--------\n\n- Object model of Firewall and Panorama configuration\n- Multiple connection methods including Panorama as a proxy\n- All operations natively vsys-aware\n- Support for high availability pairs and retry/recovery during node failure\n- Batch User-ID operations\n- Device API exception classification\n\nStatus\n------\n\nPalo Alto Networks PAN-OS SDK for Python is considered stable. It is fully tested\nand used in many production environments. Semantic versioning is applied to indicate\nbug fixes, new features, and breaking changes in each version.\n\nInstall\n-------\n\nInstall using pip:\n\n```shell\npip install pan-os-python\n```\n\nUpgrade to the latest version:\n\n```shell\npip install --upgrade pan-os-python\n```\n\nIf you have poetry installed, you can also add pan-os-python to your project:\n \n```shell\npoetry add pan-os-python\n```\n\nHow to import\n-------------\n\nTo use pan-os-python in a project:\n\n```python\nimport panos\n```\n\nYou can also be more specific about which modules you want to import:\n\n```python\nfrom panos import firewall\nfrom panos import network\n```\n\n\nA few examples\n--------------\n\nFor configuration tasks, create a tree structure using the classes in\neach module. Nodes hierarchy must follow the model in the\n[Configuration Tree](http://pan-os-python.readthedocs.io/en/latest/configtree.html).\n\nThe following examples assume the modules were imported as such:\n\n```python\nfrom panos import firewall\nfrom panos import network\n```\n\nCreate an interface and commit:\n\n```python\nfw = firewall.Firewall(\"10.0.0.1\", api_username=\"admin\", api_password=\"admin\")\neth1 = network.EthernetInterface(\"ethernet1/1\", mode=\"layer3\")\nfw.add(eth1)\neth1.create()\nfw.commit()\n```\n\nOperational commands leverage the 'op' method of the device:\n\n```python\nfw = firewall.Firewall(\"10.0.0.1\", api_username=\"admin\", api_password=\"admin\")\nprint fw.op(\"show system info\")\n```\n\nSome operational commands have methods to refresh the variables in an object:\n\n```python\n# populates the version, serial, and model variables from the live device\nfw.refresh_system_info()\n```\n\nSee more examples in the [Usage Guide](http://pan-os-python.readthedocs.io/en/latest/usage.html).\n\nUpgrade from pandevice\n----------------------\n\nThis `pan-os-python` package is the evolution of the older `pandevice` package. To\nupgrade from `pandevice` to `pan-os-python`, follow these steps.\n\nStep 1. Ensure you are using python3\n\n   [Python2 is end-of-life](https://www.python.org/doc/sunset-python-2/) and not\n   supported by `pan-os-python`.\n\nStep 2. Uninstall pandevice:\n\n```shell\npip uninstall pandevice\n # or\npoetry remove pandevice\n```\n\nStep 3. Install pan-os-python:\n\n```shell\npip3 install pan-os-python\n # or\npoetry add pan-os-python\n```\n\nStep 4. Change the import statements in your code from `pandevice` to `panos`. For example:\n\n```python\nimport pandevice\nfrom pandevice.firewall import Firewall\n\n # would change to\n\nimport panos\nfrom panos.firewall import Firewall\n```\n\nStep 5. Test your script or application\n\n   There are no known breaking changes\n   between `pandevice v0.14.0` and `pan-os-python v1.0.0`, but it is a major\n   upgrade so please verify everything works as expected.\n\nContributors\n------------\n\n- Brian Torres-Gil - [btorresgil](https://github.com/btorresgil)\n- Garfield Freeman - [shinmog](https://github.com/shinmog)\n- John Anderson - [lampwins](https://github.com/lampwins)\n- Aditya Sripal - [AdityaSripal](https://github.com/AdityaSripal)\n\nThank you to [Kevin Steves](https://github.com/kevinsteves), creator of the [pan-python library](https://github.com/kevinsteves/pan-python)\n",
    "bugtrack_url": null,
    "license": "ISC",
    "summary": "Framework for interacting with Palo Alto Networks devices via API",
    "version": "1.12.1",
    "project_urls": {
        "Documentation": "https://pan-os-python.readthedocs.io",
        "Homepage": "https://github.com/PaloAltoNetworks/pan-os-python",
        "Repository": "https://github.com/PaloAltoNetworks/pan-os-python"
    },
    "split_keywords": [
        "panos",
        " pan-os-python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f20720398b633c623a39054a1c5f64cedecf2cdd60dd2d90bbaf68d4db671965",
                "md5": "df8ecd6889d4e5f7a17036e4821cc4cc",
                "sha256": "71d149e259c2077f83beebe29b25a8b4e53adbd28c12cb167065a010d2e92368"
            },
            "downloads": -1,
            "filename": "pan_os_python-1.12.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "df8ecd6889d4e5f7a17036e4821cc4cc",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
            "size": 160710,
            "upload_time": "2024-05-31T10:54:34",
            "upload_time_iso_8601": "2024-05-31T10:54:34.738707Z",
            "url": "https://files.pythonhosted.org/packages/f2/07/20398b633c623a39054a1c5f64cedecf2cdd60dd2d90bbaf68d4db671965/pan_os_python-1.12.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "41fef8255e7804f73342f3193d0712c81caffd22ee53216d6dfc27ef83a2874d",
                "md5": "e4a1b0453f781076eaf0cd71ee36d8cf",
                "sha256": "41d7871547919cb5c3b7d3ebe8c9d1797b8a938c8366b53307e64375d65e69dc"
            },
            "downloads": -1,
            "filename": "pan_os_python-1.12.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e4a1b0453f781076eaf0cd71ee36d8cf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
            "size": 152385,
            "upload_time": "2024-05-31T10:54:36",
            "upload_time_iso_8601": "2024-05-31T10:54:36.515304Z",
            "url": "https://files.pythonhosted.org/packages/41/fe/f8255e7804f73342f3193d0712c81caffd22ee53216d6dfc27ef83a2874d/pan_os_python-1.12.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-31 10:54:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PaloAltoNetworks",
    "github_project": "pan-os-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "pan-os-python"
}
        
Elapsed time: 5.34342s