No project description provided
Project description
README
This repository contains a wrapper around Panorama/PaloAlto API.
Documentation
Documentation can be found here It is automatically generated using pdoc
Why the need for this library ?
For simple resource retrieval, the existing API is enough, but the libraries available are not practical for it. Especially, we don't have much information on the data' schema.
The official python SDK of PaloAltoNetworks itself relies on a third party wrapper for their API.
This library provides clients (JSON/XML APIs) with a more popular approach when wrapping the API, making it easier to use for developers. It also provides types' wrappers using pydantic library to simplify their usage or utility functions to re-structure the data we receive. This provides the usual benefits of types like:
- IDE completion: IDE will be able to provide you with completion as you type your code
- Consistancy: a value that might be missing will always be defined either as
None
or as an empty list - Correctness: using
mypy
, you will be able to catch errors before they go to production.
NOTE: The json API is very limited and is, in fact, a mere translation of the xml using the same process as xmltodict
library.
Also, it is quite slow. For big read operations, it is better to retrieve big portions of the configuration at once and work completely locally.
Current State of the library
This library was developed over months by adding features when they were needed. It was tested against 9.x to 11.x paloalto and panorama devices.
There are a few caveats though:
- Not everything is done now
- The main focus is put on the XML API (there is no real reason to use the json API with this library)
- The distinction between paloalto and panorama is not clearly defined everywhere. NOTE: we are trying to make the distinction transparent.
- It currently focus on data retrieval more than insertion/update/deletion.
- Methods should be re-arranged and re-grouped to simplify the usage of the library.
- This does not support async/await currently.
Contributions are welcome:
- Completing / Correcting types is more than welcome
- Bug fixes are also very welcome
- We would also like people opinions on how we can improve the library:
- How should we organize the client classes and methods
- How the creation/update/deletion should be taken care Don't hesitate to open an issue/discussion on this topic.
TODO
-
Improve the documentation
- Re-organize the methods
-
Mix Rest API and XML API ? (at least for create/update/delete ?) https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/create-security-policy-rule-rest-api
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pa_api_sdk-0.1.8.tar.gz
.
File metadata
- Download URL: pa_api_sdk-0.1.8.tar.gz
- Upload date:
- Size: 35.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e820634179dc5baf782a429fa78d414dbda3e7ad1f57e0962d62ef352c04750 |
|
MD5 | ff762b98d064eeb096b4596ba0d0f99b |
|
BLAKE2b-256 | a9d8438d9231e9b198ede86001d85cd728069de3ce3f81f894b61c853360147e |
File details
Details for the file pa_api_sdk-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: pa_api_sdk-0.1.8-py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57f14c0bc19c2e46c335d684676600e0870248548b10b9cafa421d78bcba9031 |
|
MD5 | 3fe7ed22fd662300d892f796a85ad278 |
|
BLAKE2b-256 | 00e82aa6840109e22f2ababdebd1038e0b4c1819acda6878777af784d60ac8a0 |