Python SDK for Palo Alto Networks Strata Cloud Manager.
NOTE: Please refer to the GitHub Pages documentation site for all examples
Requirements:
Install the package via pip:
pip install pan-scm-sdk
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
api_client = Scm(
client_id="your_client_id",
client_secret="your_client_secret",
tsg_id="your_tsg_id",
)
# The SCM client is now ready to use
NOTE: Please refer to the GitHub Pages documentation site for all examples
from scm.client import Scm
from scm.config.objects import Address
# Create an authenticated session with SCM
api_client = 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(api_client)
# 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}")
# 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}")
We welcome contributions! To contribute:
git checkout -b feature/your-feature
).git commit -m 'Add new feature'
).git push origin feature/your-feature
).Ensure your code adheres to the project's coding standards and includes tests where appropriate.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
For support and questions, please refer to the SUPPORT.md file in this repository.
Detailed documentation is available on our GitHub Pages documentation site.