Skip to main content

Python library is an interface to the Xpanse Expander API.

Project description

https://github.com/PaloAltoNetworks/cortex-xpanse-python-sdk/blob/main/docs/_source/_static/xpanse_banner.png?raw=true https://img.shields.io/badge/code%20style-black-000000.svg https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-blueviolet https://img.shields.io/badge/code%20style-black-000000.svg https://img.shields.io/pypi/l/xpanse https://img.shields.io/github/contributors/PaloAltoNetworks/cortex-xpanse-python-sdk

Overview

This library is intended to be an interface to the Xpanse Expander API.

Install

pip install xpanse

Requirements

Python 3.6+

Usage

Documentation

# Import client
from xpanse.client import ExClient

# initialize client
client = ExClient()

# get ip_range iterator object and dump to a list
ranges = client.assets.ip_range.list().dump()

You can view more example code in the examples directory.

Configuration

A valid Client ID and Secret is required for use. This is recommended over using a JWT, as they have limited lifespans. While a bearer token is supported in this version, this auth flow is being deprecated. Therefore, it is highly recommended to use Client Credentials.

Logging

Logging is handled through the python logging package. To enable different levels of verbosity in your scripts you can do the following:

import logging
logging.basicConfig(level=logging.DEBUG)

You can read more at https://docs.python.org/3/library/logging.html.

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

xpanse-1.1.1.tar.gz (88.8 kB view hashes)

Uploaded Source

Built Distribution

xpanse-1.1.1-py3-none-any.whl (121.9 kB view hashes)

Uploaded Python 3

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