Skip to main content

The Nebulon Python SDK

Project description

Python API for Nebulon

This is an API client for Nebulon ON for Python 3 and allows working with Nebulon nPods just like with the Nebulon ON web user interface but in a scriptable form.

Installation

The Nebulon Python SDK client is available through the Python Package Index with the name nebpyclient, but can also be installed from source.

IMPORTANT: Please review the changelog to transition from version 1.x of the nebpyclient to version 2.x.

Python Package Index

pip install nebpyclient

Or

python3 -m pip install nebpyclient

Installation from Source Code

mkdir nebulon
cd nebulon
git clone https://github.com/nebulon/nebpyclient.git
cd nebpyclient
python3 setup.py install

To build the HTML documentation from source:

cd docs/
make html

Using the API

To use this API, instantiate a NebPyClient object with username and password. You can then use its methods to query state, and if a nPod is reachable from where the script is being run modify the system. A simple script to display the names of all of the pods in your organization along with a count of the volumes in them would be:

from nebpyclient import NebPyClient

client = NebPyClient("username", "password")

npod_list = client.get_npods()
for npod in npod_list.items:
    print(f"nPod {npod.name} has {npod.volume_count} volumes")

An example to create a 2 TiB volume called volume name on an existing nPod with the name NPod Name would be:

from nebpyclient import NebPyClient
from nebpyclient import NPodFilter, StringFilter

client = NebPyClient("username", "password")

# find the nPod by name
npod_list = client.get_npods(
    npod_filter=NPodFilter(
        name=StringFilter(
            equals="NPod Name"       
        )   
    )
)

if npod_list.filtered_count == 0:
    # nPod with the name "NPod Name" not found
    exit(-1)

npod_uuid = npod_list.items[0].uuid
volume_name="volume name"
volume_size_bytes = 2 * 1024 * 1024 * 1024 * 1024 # 2 TiB

# create the volume
client.create_volume(
    name=volume_name,
    size_bytes=volume_size_bytes,
    npod_uuid=npod_uuid
)

Full documentation on the API is available in the docs directory. Some functions have comments that describe functions and methods and are visible in modern Python IDEs.

Please review the current version of the documentation for more details.

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

nebpyclient-2.0.5.tar.gz (109.3 kB view details)

Uploaded Source

Built Distribution

nebpyclient-2.0.5-py3-none-any.whl (147.7 kB view details)

Uploaded Python 3

File details

Details for the file nebpyclient-2.0.5.tar.gz.

File metadata

  • Download URL: nebpyclient-2.0.5.tar.gz
  • Upload date:
  • Size: 109.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for nebpyclient-2.0.5.tar.gz
Algorithm Hash digest
SHA256 40bfb82d3ec99f5678eb62635cc31914929499f5fcf0c23826a58ccba5451beb
MD5 dc2e926bb576722a61593a2ea8bb3ccb
BLAKE2b-256 46f0145bcb143c1d6bf1b2f9b3beb209e88ce72e1404d44fa83a41e2ddfa5155

See more details on using hashes here.

Provenance

File details

Details for the file nebpyclient-2.0.5-py3-none-any.whl.

File metadata

  • Download URL: nebpyclient-2.0.5-py3-none-any.whl
  • Upload date:
  • Size: 147.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for nebpyclient-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9987f71193bb106baa99249b4a6768485f20d30c6319b6de92c91d90c25a7f4b
MD5 db5ab133c426de4b38d95b4e353b4dfa
BLAKE2b-256 de23fcdd3c94e1b6f7c880252e4132959e28507d4178964620453844eb12b03b

See more details on using hashes here.

Provenance

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