Python library is an interface to the Xpanse Expander API.
Project description
Overview
This library is intended to be an interface to the Xpanse Expander API.
Install
pip install xpanse
Requirements
Python 3.6+
Usage
# 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 Bearer token or JWT is required for use. Bearer tokens are suggested as JWTs have a limited lifespan.
RECOMMENDED
You can supply them as environment variables using the variable names XPANSE_BEARER_TOKEN and/or XPANSE_JWT_TOKEN.
export XPANSE_BEARER_TOKEN=<Bearer Token>
# or
export XPANSE_JWT_TOKEN=<JWT>
NOT RECOMMENDED
You can also provided these keys directly at client initialization by doing
client = ExClient(jwt=<JWT>)
# or
client = ExClient(bearer=<Bearer>)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xpanse-1.0.9.post12.tar.gz.
File metadata
- Download URL: xpanse-1.0.9.post12.tar.gz
- Upload date:
- Size: 87.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
517471ab7cb94f67fc641038155ec2a2f18b6e000364f04d16172f2c716b82ee
|
|
| MD5 |
8e337ff494651a5ba512734c51968378
|
|
| BLAKE2b-256 |
0e97879b429899b1d7e0ae1a8b815beb956e6d927ab2bf668c164e9c539eb8f3
|
File details
Details for the file xpanse-1.0.9.post12-py3-none-any.whl.
File metadata
- Download URL: xpanse-1.0.9.post12-py3-none-any.whl
- Upload date:
- Size: 120.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48052a8ee00d1e020f51e79b31a772e702295ccc185eb44fb18de3ad1a1a3ece
|
|
| MD5 |
d5d2ee5458faddb30092ac6ea88ec734
|
|
| BLAKE2b-256 |
7e76956e7d29adb4ee6627448d90e690c3e6ff353ec7763c347979e2f8a164b5
|