# Strata Cloud Manager SDK
![Banner Image](https://raw.githubusercontent.com/cdot65/pan-scm-sdk/main/docs/images/logo.svg)
[![codecov](https://codecov.io/github/cdot65/pan-scm-sdk/graph/badge.svg?token=BB39SMLYFP)](https://codecov.io/github/cdot65/pan-scm-sdk)
[![Build Status](https://github.com/cdot65/pan-scm-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/cdot65/pan-scm-sdk/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/pan-scm-sdk.svg)](https://badge.fury.io/py/pan-scm-sdk)
[![Python versions](https://img.shields.io/pypi/pyversions/pan-scm-sdk.svg)](https://pypi.org/project/pan-scm-sdk/)
[![License](https://img.shields.io/github/license/cdot65/pan-scm-sdk.svg)](https://github.com/cdot65/pan-scm-sdk/blob/main/LICENSE)
Python SDK for Palo Alto Networks Strata Cloud Manager.
> **NOTE**: Please refer to the [GitHub Pages documentation site](https://cdot65.github.io/pan-scm-sdk/) for all
> examples
## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Authentication](#authentication)
- [Managing Address Objects](#managing-address-objects)
- [Listing Addresses](#listing-addresses)
- [Creating an Address](#creating-an-address)
- [Contributing](#contributing)
- [License](#license)
- [Support](#support)
## 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:
```bash
pip install pan-scm-sdk
```
## Usage
### Authentication
Before interacting with the SDK, you need to authenticate using your Strata Cloud Manager credentials.
```python
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](https://cdot65.github.io/pan-scm-sdk/) for all
> examples
#### Listing Addresses
```python
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
```python
# 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](./LICENSE) file for details.
## Support
For support and questions, please refer to the [SUPPORT.md](./SUPPORT.md) file in this repository.
---
*Detailed documentation is available on our [GitHub Pages documentation site](https://cdot65.github.io/pan-scm-sdk/).*
Raw data
{
"_id": null,
"home_page": "https://github.com/cdot65/pan-scm-sdk",
"name": "pan-scm-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "paloaltonetworks, stratacloudmanager, scm",
"author": "Calvin Remsburg",
"author_email": "calvin@cdot.io",
"download_url": "https://files.pythonhosted.org/packages/63/0a/7bf1bda85fbbe35585d46e494f650f7407ab6224c9b671890caee1624412/pan_scm_sdk-0.2.2.tar.gz",
"platform": null,
"description": "# Strata Cloud Manager SDK\n\n![Banner Image](https://raw.githubusercontent.com/cdot65/pan-scm-sdk/main/docs/images/logo.svg)\n[![codecov](https://codecov.io/github/cdot65/pan-scm-sdk/graph/badge.svg?token=BB39SMLYFP)](https://codecov.io/github/cdot65/pan-scm-sdk)\n[![Build Status](https://github.com/cdot65/pan-scm-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/cdot65/pan-scm-sdk/actions/workflows/ci.yml)\n[![PyPI version](https://badge.fury.io/py/pan-scm-sdk.svg)](https://badge.fury.io/py/pan-scm-sdk)\n[![Python versions](https://img.shields.io/pypi/pyversions/pan-scm-sdk.svg)](https://pypi.org/project/pan-scm-sdk/)\n[![License](https://img.shields.io/github/license/cdot65/pan-scm-sdk.svg)](https://github.com/cdot65/pan-scm-sdk/blob/main/LICENSE)\n\nPython SDK for Palo Alto Networks Strata Cloud Manager.\n\n> **NOTE**: Please refer to the [GitHub Pages documentation site](https://cdot65.github.io/pan-scm-sdk/) for all\n> examples\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n - [Authentication](#authentication)\n - [Managing Address Objects](#managing-address-objects)\n - [Listing Addresses](#listing-addresses)\n - [Creating an Address](#creating-an-address)\n- [Contributing](#contributing)\n- [License](#license)\n- [Support](#support)\n\n## Features\n\n- **OAuth2 Authentication**: Securely authenticate with the Strata Cloud Manager API using OAuth2 client credentials\n flow.\n- **Resource Management**: Create, read, update, and delete configuration objects such as addresses, address groups, and\n applications.\n- **Data Validation**: Utilize Pydantic models for data validation and serialization.\n- **Exception Handling**: Comprehensive error handling with custom exceptions for API errors.\n- **Extensibility**: Designed for easy extension to support additional resources and endpoints.\n\n## Installation\n\n**Requirements**:\n\n- Python 3.10 or higher\n\nInstall the package via pip:\n\n```bash\npip install pan-scm-sdk\n```\n\n## Usage\n\n### Authentication\n\nBefore interacting with the SDK, you need to authenticate using your Strata Cloud Manager credentials.\n\n```python\nfrom scm.client import Scm\n\n# Initialize the API client with your credentials\napi_client = Scm(\n client_id=\"your_client_id\",\n client_secret=\"your_client_secret\",\n tsg_id=\"your_tsg_id\",\n)\n\n# The SCM client is now ready to use\n```\n\n### Managing Address Objects\n\n> **NOTE**: Please refer to the [GitHub Pages documentation site](https://cdot65.github.io/pan-scm-sdk/) for all\n> examples\n\n#### Listing Addresses\n\n```python\nfrom scm.client import Scm\nfrom scm.config.objects import Address\n\n# Create an authenticated session with SCM\napi_client = Scm(\n client_id=\"this is an example\",\n client_secret=\"this is an example\",\n tsg_id=\"this is an example\"\n)\n\n# Create an Address instance by passing the SCM instance into it\naddress = Address(api_client)\n\n# List addresses in a specific folder\naddresses = address.list(folder='Prisma Access')\n\n# Iterate through the addresses\nfor addr in addresses:\n print(f\"Address Name: {addr.name}, IP: {addr.ip_netmask or addr.fqdn}\")\n```\n\n#### Creating an Address\n\n```python\n# Define a new address object\naddress_data = {\n \"name\": \"test123\",\n \"fqdn\": \"test123.example.com\",\n \"description\": \"Created via pan-scm-sdk\",\n \"folder\": \"Prisma Access\",\n}\n\n# Create the address in Strata Cloud Manager\nnew_address = address.create(address_data)\nprint(f\"Created address with ID: {new_address.id}\")\n```\n\n---\n\n## Contributing\n\nWe welcome contributions! To contribute:\n\n1. Fork the repository.\n2. Create a new feature branch (`git checkout -b feature/your-feature`).\n3. Commit your changes (`git commit -m 'Add new feature'`).\n4. Push to your branch (`git push origin feature/your-feature`).\n5. Open a Pull Request.\n\nEnsure your code adheres to the project's coding standards and includes tests where appropriate.\n\n## License\n\nThis project is licensed under the Apache 2.0 License. See the [LICENSE](./LICENSE) file for details.\n\n## Support\n\nFor support and questions, please refer to the [SUPPORT.md](./SUPPORT.md) file in this repository.\n\n---\n\n*Detailed documentation is available on our [GitHub Pages documentation site](https://cdot65.github.io/pan-scm-sdk/).*",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Python SDK for Palo Alto Networks Strata Cloud Manager.",
"version": "0.2.2",
"project_urls": {
"Documentation": "https://cdot65.github.io/pan-scm-sdk/",
"Homepage": "https://github.com/cdot65/pan-scm-sdk",
"Repository": "https://github.com/cdot65/pan-scm-sdk"
},
"split_keywords": [
"paloaltonetworks",
" stratacloudmanager",
" scm"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "519daef2afba91d7692c0d470604833bf5522195d07cda1232318dec934dff87",
"md5": "78bdefe19100235043c75442984aabc0",
"sha256": "757e1a79b953318e923b58d5e09495fd477b7b989f4995fa75efce8d123de416"
},
"downloads": -1,
"filename": "pan_scm_sdk-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "78bdefe19100235043c75442984aabc0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 71002,
"upload_time": "2024-11-21T19:31:47",
"upload_time_iso_8601": "2024-11-21T19:31:47.343255Z",
"url": "https://files.pythonhosted.org/packages/51/9d/aef2afba91d7692c0d470604833bf5522195d07cda1232318dec934dff87/pan_scm_sdk-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "630a7bf1bda85fbbe35585d46e494f650f7407ab6224c9b671890caee1624412",
"md5": "8501a33f43df37fb5547c34f2f250d49",
"sha256": "bc0cb352e5fc07eeffded5348048690babeb4fc7ad570c20c9c6cbfff300ab9e"
},
"downloads": -1,
"filename": "pan_scm_sdk-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "8501a33f43df37fb5547c34f2f250d49",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 34849,
"upload_time": "2024-11-21T19:31:48",
"upload_time_iso_8601": "2024-11-21T19:31:48.369331Z",
"url": "https://files.pythonhosted.org/packages/63/0a/7bf1bda85fbbe35585d46e494f650f7407ab6224c9b671890caee1624412/pan_scm_sdk-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-21 19:31:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cdot65",
"github_project": "pan-scm-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pan-scm-sdk"
}