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.
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
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
File details
Details for the file nebpyclient-1.0.13.tar.gz
.
File metadata
- Download URL: nebpyclient-1.0.13.tar.gz
- Upload date:
- Size: 103.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc2ae63c1627e08710337d42679bd2c8d300fc2a1320f4da888299230febabc8 |
|
MD5 | 689d824711742dadce5ea5e040388b34 |
|
BLAKE2b-256 | 819607b289e927f596db639ea3f51f241f6180254be914a212eb3f5235cef9cc |
Provenance
File details
Details for the file nebpyclient-1.0.13-py3-none-any.whl
.
File metadata
- Download URL: nebpyclient-1.0.13-py3-none-any.whl
- Upload date:
- Size: 140.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b407140fd7be1c6dc4ecae0011a76424f577312f0eeac9f08f9450bd56b3b672 |
|
MD5 | 429145e917e303caa3bf64094c4d439e |
|
BLAKE2b-256 | c08c1df8a9ef85ca95bd9307df5f7e961a23ede9890c4b30393917c1deef75bb |