# Python SDK for the Prisma Cloud APIs
This project includes a Python SDK for the Prisma Cloud APIs (CSPM, CWPP, and CCS) in the form of a Python package.
It also includes reference scripts that utilize this SDK.
Major changes with Version 5.0:
* Command-line argument and configuration file changes.
## Table of Contents
* [Setup](#Setup)
* [Support](#Support)
## Setup
Install the SDK via `pip3`:
```
pip3 install prismacloud-api
```
Please refer to [PyPI](https://pypi.org/project/prismacloud-api) for details.
### Example Scripts
Please refer to this [scripts](https://github.com/PaloAltoNetworks/prismacloud-api-python/tree/main/scripts) directory for configuration, documentation, and usage.
If you prefer to use this SDK without using command-line options, consider these minimal examples:
#### Prisma Cloud Enterprise Edition
```
import os
from prismacloud.api import pc_api
# Settings for Prisma Cloud Enterprise Edition
settings = {
"url": "https://api.prismacloud.io/",
"identity": "access_key",
"secret": "secret_key"
}
pc_api.configure(settings)
print('Prisma Cloud API Current User:')
print()
print(pc_api.current_user())
print()
print('Prisma Cloud Compute API Intelligence:')
print()
print(pc_api.statuses_intelligence())
print()
print('Prisma Cloud API Object:')
print()
print(pc_api)
print()
```
#### Prisma Cloud Compute Edition
```
import os
from prismacloud.api import pc_api
# Settings for Prisma Cloud Compute Edition
settings = {
"url": "https://console.example.com/",
"identity": "username",
"secret": "password"
}
pc_api.configure(settings)
print('Prisma Cloud Compute API Intelligence:')
print()
print(pc_api.statuses_intelligence())
print()
print('Prisma Cloud API Object:')
print()
print(pc_api)
print()
```
Settings can also be defined as environment variables:
#### Environment Variables
```
settings = {
"url": os.environ.get('PC_URL'),
"identity": os.environ.get('PC_IDENTITY'),
"secret": os.environ.get('PC_SECRET')
}
```
## Support
This project has been developed by members of the Prisma Cloud CS and SE teams, it is not Supported by Palo Alto Networks.
Nevertheless, the maintainers will make a best-effort to address issues, and (of course) contributors are encouraged to submit issues and pull requests.
Raw data
{
"_id": null,
"home_page": "https://github.com/PaloAltoNetworks/prismacloud-api-python",
"name": "prismacloud-api",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "prisma cloud api",
"author": "Tom Kishel",
"author_email": "tkishel@paloaltonetworks.com",
"download_url": "https://files.pythonhosted.org/packages/d8/f4/8b796f76f820bd165fd946754874a533dd7e7fcaaf9d4cf42a159b5b18d3/prismacloud_api-5.2.24.tar.gz",
"platform": null,
"description": "# Python SDK for the Prisma Cloud APIs\n\nThis project includes a Python SDK for the Prisma Cloud APIs (CSPM, CWPP, and CCS) in the form of a Python package.\nIt also includes reference scripts that utilize this SDK.\n\nMajor changes with Version 5.0:\n\n* Command-line argument and configuration file changes.\n\n## Table of Contents\n\n* [Setup](#Setup)\n* [Support](#Support)\n\n\n## Setup\n\nInstall the SDK via `pip3`:\n\n```\npip3 install prismacloud-api\n```\n\nPlease refer to [PyPI](https://pypi.org/project/prismacloud-api) for details.\n\n### Example Scripts\n\nPlease refer to this [scripts](https://github.com/PaloAltoNetworks/prismacloud-api-python/tree/main/scripts) directory for configuration, documentation, and usage.\n\nIf you prefer to use this SDK without using command-line options, consider these minimal examples:\n\n#### Prisma Cloud Enterprise Edition\n\n```\nimport os\nfrom prismacloud.api import pc_api\n\n# Settings for Prisma Cloud Enterprise Edition\n\nsettings = {\n \"url\": \"https://api.prismacloud.io/\",\n \"identity\": \"access_key\",\n \"secret\": \"secret_key\"\n}\n\npc_api.configure(settings)\n\nprint('Prisma Cloud API Current User:')\nprint()\nprint(pc_api.current_user())\nprint()\nprint('Prisma Cloud Compute API Intelligence:')\nprint()\nprint(pc_api.statuses_intelligence())\nprint()\n\nprint('Prisma Cloud API Object:')\nprint()\nprint(pc_api)\nprint()\n```\n\n#### Prisma Cloud Compute Edition\n\n```\nimport os\nfrom prismacloud.api import pc_api\n\n# Settings for Prisma Cloud Compute Edition\n\nsettings = {\n \"url\": \"https://console.example.com/\",\n \"identity\": \"username\",\n \"secret\": \"password\"\n}\n\npc_api.configure(settings)\n\nprint('Prisma Cloud Compute API Intelligence:')\nprint()\nprint(pc_api.statuses_intelligence())\nprint()\n\nprint('Prisma Cloud API Object:')\nprint()\nprint(pc_api)\nprint()\n```\n\nSettings can also be defined as environment variables:\n\n#### Environment Variables\n\n```\nsettings = {\n \"url\": os.environ.get('PC_URL'),\n \"identity\": os.environ.get('PC_IDENTITY'),\n \"secret\": os.environ.get('PC_SECRET')\n}\n```\n\n## Support\n\nThis project has been developed by members of the Prisma Cloud CS and SE teams, it is not Supported by Palo Alto Networks.\nNevertheless, the maintainers will make a best-effort to address issues, and (of course) contributors are encouraged to submit issues and pull requests.\n",
"bugtrack_url": null,
"license": null,
"summary": "Prisma Cloud API SDK for Python",
"version": "5.2.24",
"project_urls": {
"Homepage": "https://github.com/PaloAltoNetworks/prismacloud-api-python"
},
"split_keywords": [
"prisma",
"cloud",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "605f54b78c971940abf1c794d6599289b98b6d12ce0eef5c22036b3cff9b2363",
"md5": "47aa420aa7491a1cb8aed983da636078",
"sha256": "d8d370f41eed2070b73e223be8d58c6ff57fb35e725f7c0a392a71c6dc2042af"
},
"downloads": -1,
"filename": "prismacloud_api-5.2.24-py3-none-any.whl",
"has_sig": false,
"md5_digest": "47aa420aa7491a1cb8aed983da636078",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 36718,
"upload_time": "2024-07-03T13:52:37",
"upload_time_iso_8601": "2024-07-03T13:52:37.183973Z",
"url": "https://files.pythonhosted.org/packages/60/5f/54b78c971940abf1c794d6599289b98b6d12ce0eef5c22036b3cff9b2363/prismacloud_api-5.2.24-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d8f48b796f76f820bd165fd946754874a533dd7e7fcaaf9d4cf42a159b5b18d3",
"md5": "13868e959a4380d5317023769ec4b01a",
"sha256": "08d1c4b8189f203d5cd99f01c1539d36462f8adbacf9ed0078a8809f77e80dc5"
},
"downloads": -1,
"filename": "prismacloud_api-5.2.24.tar.gz",
"has_sig": false,
"md5_digest": "13868e959a4380d5317023769ec4b01a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 25693,
"upload_time": "2024-07-03T13:52:38",
"upload_time_iso_8601": "2024-07-03T13:52:38.504309Z",
"url": "https://files.pythonhosted.org/packages/d8/f4/8b796f76f820bd165fd946754874a533dd7e7fcaaf9d4cf42a159b5b18d3/prismacloud_api-5.2.24.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-03 13:52:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PaloAltoNetworks",
"github_project": "prismacloud-api-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "prismacloud-api"
}