Skip to main content

Prisma Cloud API SDK for Python

Project description

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

Install the SDK via pip3:

pip3 install prismacloud-api

Please refer to PyPI for details.

Example Scripts

Please refer to this 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.

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

prismacloud_api-5.3.0.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prismacloud_api-5.3.0-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file prismacloud_api-5.3.0.tar.gz.

File metadata

  • Download URL: prismacloud_api-5.3.0.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for prismacloud_api-5.3.0.tar.gz
Algorithm Hash digest
SHA256 68b765d9891759a0c64919a39b0c2aa0600bcc1284f1fed90290fe955aa26988
MD5 6557786cd4b00d289c8bd743916d8b87
BLAKE2b-256 8e23895fed175bdbed13b90c3ee527cb68a8440efa81a50b2fa3f5bfa4a4e9ad

See more details on using hashes here.

File details

Details for the file prismacloud_api-5.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for prismacloud_api-5.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24ea1166fa5b703d2f447841a9443856c5840d197dd48afe629b2a8dc86719bc
MD5 6368453b99ff0f941e38b55b10dc7d08
BLAKE2b-256 d70553ebcc39f924f644456e2cffb80e2fe23971a7373ff38c1d5886bb8c544a

See more details on using hashes here.

Supported by

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