Python SDK for Palo Alto Networks Strata Cloud Manager.
Project description
Strata Cloud Manager SDK
Python SDK for Palo Alto Networks Strata Cloud Manager.
NOTE: Please refer to the GitHub Pages documentation site for all examples
Table of Contents
Features
- OAuth2 Authentication: Securely authenticate with the Strata Cloud Manager API using OAuth2 client credentials flow.
- Resource Management: Create, read, update, and delete configuration objects such as addresses, address groups, and applications.
- Data Validation: Utilize Pydantic models for data validation and serialization.
- Exception Handling: Comprehensive error handling with custom exceptions for API errors.
- Extensibility: Designed for easy extension to support additional resources and endpoints.
Installation
Requirements:
- Python 3.10 or higher
Install the package via pip:
pip install pan-scm-sdk
Usage
Authentication
Before interacting with the SDK, you need to authenticate using your Strata Cloud Manager credentials.
from scm.client import Scm
# Initialize the API client with your credentials
scm = Scm(
client_id="your_client_id",
client_secret="your_client_secret",
tsg_id="your_tsg_id",
)
# The SCM client is now ready to use
Managing Address Objects
NOTE: Please refer to the GitHub Pages documentation site for all examples
Listing Addresses
from scm.client import Scm
from scm.config.objects import Address
# Create an authenticated session with SCM
scm = Scm(
client_id="this is an example",
client_secret="this is an example",
tsg_id="this is an example"
)
# Create an Address instance by passing the SCM instance into it
address = Address(scm)
# List addresses in a specific folder
addresses = address.list(folder='Prisma Access')
# Iterate through the addresses
for addr in addresses:
print(f"Address Name: {addr.name}, IP: {addr.ip_netmask or addr.fqdn}")
Creating an Address
# Define a new address object
address_data = {
"name": "test123",
"fqdn": "test123.example.com",
"description": "Created via pan-scm-sdk",
"folder": "Prisma Access",
}
# Create the address in Strata Cloud Manager
new_address = address.create(address_data)
print(f"Created address with ID: {new_address.id}")
Contributing
We welcome contributions! To contribute:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add new feature'
). - Push to your branch (
git push origin feature/your-feature
). - Open a Pull Request.
Ensure your code adheres to the project's coding standards and includes tests where appropriate.
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Support
For support and questions, please refer to the SUPPORT.md file in this repository.
Detailed documentation is available on our GitHub Pages documentation site.
Project details
Release history Release notifications | RSS feed
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 pan_scm_sdk-0.1.5.tar.gz
.
File metadata
- Download URL: pan_scm_sdk-0.1.5.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ff1be4f85568a80d9b298f79c8765f4a77deb69745aa5e0cb2bcc24a2795975 |
|
MD5 | 0ed4bf084c3e770729f32529bfcefd1c |
|
BLAKE2b-256 | 291e23927dd0eed84b3f171f880ae4cb443734e5bc76d22c8710178418d62eb8 |
File details
Details for the file pan_scm_sdk-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: pan_scm_sdk-0.1.5-py3-none-any.whl
- Upload date:
- Size: 28.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7abdddedb77e98f28ff5c35dbdf0527bfa7813a82fa3495854cbb11ed141c909 |
|
MD5 | 81ef0e984072bad95f4e10817de7cd77 |
|
BLAKE2b-256 | 7b5837dadb3eede98a5127ce4d0ef762362d6b56920a0fe3569724b75a42191f |