Skip to main content

The Nebulon Python SDK

Project description

Python API for Nebulon ON

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.

For feedback, suggestions, create issues for this project, contact Nebulon at info@nebulon.com. To learn what other #nebNerds are doing with the Nebulon Python SDK client, to share an implementation or contribute code, or to interact with other #nebNerds, visit the Nebulon Community Slack.

Contents

Path Description
nebulonapi/ Main module
docs/ Documentation for the SDK

Installation

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

Python Package Index

pip install nebpyclient

Or

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.api 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-1.0.6.tar.gz (103.8 kB view details)

Uploaded Source

Built Distribution

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

nebpyclient-1.0.6-py3-none-any.whl (139.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nebpyclient-1.0.6.tar.gz
  • Upload date:
  • Size: 103.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6

File hashes

Hashes for nebpyclient-1.0.6.tar.gz
Algorithm Hash digest
SHA256 fa9293c48701ece96eb74ad7055fab7a2c377e4fa189a90163e8794ff1d0f2ee
MD5 229d7834c2cfa4d91f0052c33e7d2001
BLAKE2b-256 0c05c8f4e4d8c8c3c6dc4c24b0e8b031328fbdcf30248737ca8e1417040f55ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nebpyclient-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 139.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6

File hashes

Hashes for nebpyclient-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c0cf52dd38cb67ecbd0da870410c4dc7392e5012ad43b4e3fe283e367e8524a8
MD5 4c5efb285909133ba41e9ea85e4c5f74
BLAKE2b-256 acb61920aa6caf2b0e7005dae63fd3d6e6aab57a619f5bb69c729124aad47a4d

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