Skip to main content

Python SDK for Palo Alto Networks Strata Cloud Manager.

Project description

Strata Cloud Manager SDK

Banner Image codecov Build Status PyPI version Python versions License

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
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

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
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}")

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:

  1. Fork the repository.
  2. Create a new feature branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to your branch (git push origin feature/your-feature).
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pan_scm_sdk-0.2.2.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

pan_scm_sdk-0.2.2-py3-none-any.whl (71.0 kB view details)

Uploaded Python 3

File details

Details for the file pan_scm_sdk-0.2.2.tar.gz.

File metadata

  • Download URL: pan_scm_sdk-0.2.2.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Darwin/24.1.0

File hashes

Hashes for pan_scm_sdk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 bc0cb352e5fc07eeffded5348048690babeb4fc7ad570c20c9c6cbfff300ab9e
MD5 8501a33f43df37fb5547c34f2f250d49
BLAKE2b-256 630a7bf1bda85fbbe35585d46e494f650f7407ab6224c9b671890caee1624412

See more details on using hashes here.

File details

Details for the file pan_scm_sdk-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pan_scm_sdk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 71.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Darwin/24.1.0

File hashes

Hashes for pan_scm_sdk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 757e1a79b953318e923b58d5e09495fd477b7b989f4995fa75efce8d123de416
MD5 78bdefe19100235043c75442984aabc0
BLAKE2b-256 519daef2afba91d7692c0d470604833bf5522195d07cda1232318dec934dff87

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page