Skip to main content

Python SDK for Palo Alto Networks Strata Cloud Manager.

Project description

Strata Cloud Manager SDK

Banner Image

Build Status PyPI version Python versions License

Python SDK for Palo Alto Networks Strata Cloud Manager.

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.
  • 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 pan_scm_sdk.client import APIClient

# Initialize the API client with your credentials
api_client = APIClient(
    client_id="your_client_id",
    client_secret="your_client_secret",
    tsg_id="your_tsg_id",
)

# The api_client is now ready to use

Creating Address Objects

from pan_scm_sdk.resources.address import AddressClient
from pan_scm_sdk.models.address import Address

# Create an AddressClient instance
address_client = AddressClient(api_client)

# Define a new address object
address = Address(
    name="MyAddress",
    ip_netmask="192.168.1.1/32",
    folder="Shared",
)

# Create the address in Strata Cloud Manager
created_address = address_client.create_address(address)
print(f"Created address with ID: {created_address.id}")

Listing Addresses

# List addresses with optional filtering
addresses = address_client.list_addresses(limit=10)
for addr in addresses:
    print(f"Address ID: {addr.id}, Name: {addr.name}, IP: {addr.ip_netmask}")

Updating an Address

# Retrieve an existing address
address_id = "123e4567-e89b-12d3-a456-426655440000"
address = address_client.get_address(address_id)

# Update the address properties
address.description = "Updated description"

# Send the update to Strata Cloud Manager
updated_address = address_client.update_address(address_id, address)
print(f"Updated address with ID: {updated_address.id}")

Deleting an Address

# Delete an address by ID
address_id = "123e4567-e89b-12d3-a456-426655440000"
address_client.delete_address(address_id)
print(f"Deleted address with ID: {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 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.1.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

pan_scm_sdk-0.1.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pan_scm_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 13.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

Hashes for pan_scm_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4fcefdd2a3619c9167b4d920f07c51812f8d70c98c86d9c71cc82c3b37a389f
MD5 f3fa5776f046f8e89de39d1d0df06069
BLAKE2b-256 11072568cfb5237f639cae20933c5084ed390cbc3b99a886772d9c360d2936e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pan_scm_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.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

Hashes for pan_scm_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba45cae03f348af4b39b9cb953d519770c0cab2e9d18fc6537d740048fbac737
MD5 e006cd3d0cddc5aba797b5b3cf71bfb6
BLAKE2b-256 e472c0b35dce72c0b4f73251ca32e9410e78dbddfa482b42f0e965954fa0a16b

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