pan-scm-sdk


Namepan-scm-sdk JSON
Version 0.3.7 PyPI version JSON
download
home_pagehttps://github.com/cdot65/pan-scm-sdk
SummaryPython SDK for Palo Alto Networks Strata Cloud Manager.
upload_time2024-12-18 14:14:15
maintainerNone
docs_urlNone
authorCalvin Remsburg
requires_python<4.0,>=3.10
licenseApache 2.0
keywords paloaltonetworks stratacloudmanager scm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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": "Texas",
}

# 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/1e/04/c4c7972ac602ff303bfde970d7073499ef5ef47de65f200c43d91c5afd05/pan_scm_sdk-0.3.7.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\": \"Texas\",\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.3.7",
    "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": "dfeb4e7b50131daeecf519fee5189e7c0b35493e9969e5c1a4374da94e24b34b",
                "md5": "59d7308ced31a2987f1679d2b4551d07",
                "sha256": "3b2d0a758d724ba062af522bb0c9a127acfbb773cd92ee543aea06893b2916e1"
            },
            "downloads": -1,
            "filename": "pan_scm_sdk-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "59d7308ced31a2987f1679d2b4551d07",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 120082,
            "upload_time": "2024-12-18T14:14:12",
            "upload_time_iso_8601": "2024-12-18T14:14:12.988603Z",
            "url": "https://files.pythonhosted.org/packages/df/eb/4e7b50131daeecf519fee5189e7c0b35493e9969e5c1a4374da94e24b34b/pan_scm_sdk-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e04c4c7972ac602ff303bfde970d7073499ef5ef47de65f200c43d91c5afd05",
                "md5": "bba57bc01b88452e5751c6c0294175c8",
                "sha256": "953c347a4d4f66130934f97f0b3b7de0461f1726086d82a75f011e32a1a6ab0d"
            },
            "downloads": -1,
            "filename": "pan_scm_sdk-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "bba57bc01b88452e5751c6c0294175c8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 53445,
            "upload_time": "2024-12-18T14:14:15",
            "upload_time_iso_8601": "2024-12-18T14:14:15.349628Z",
            "url": "https://files.pythonhosted.org/packages/1e/04/c4c7972ac602ff303bfde970d7073499ef5ef47de65f200c43d91c5afd05/pan_scm_sdk-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-18 14:14:15",
    "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"
}
        
Elapsed time: 0.45446s