Skip to main content

QuantaStor

OSNEXUS QuantaStor Python Client Library


The python library for QuantaStor simplifies the process of automating QuantaStor management operations via python scripts. All of the published QuantaStor REST APIs as documented on the OSNEXUS documentation wiki are callable via the python client.


System Requirements for QuantaStor

The QuantaStor Python Client Library requires a QuantaStor box to interact with. The minimum requirements for your storage system vary based on the workload. Use our Solution Design Tools to help you find the solution that best fits your use-case and budget. The minimum requirements provided in this documentation serves as the bare minimum to explore using the software and its capabilities.

  • Intel Xeon or AMD x64 bit server (or virtual server)
  • 16GB RAM
  • 2x SSDs for system/boot drives
    • Boot drives should be hardware mirrored and should be atleast 64GB in size.
  • One or more disks per system for storage pools. (SSD/NVMe/PCI SSD/SATA/SAS/FC/iSCSI/AoE)
  • Download QuantaStor USB/ISO Installation Media for installation.

Installation

Install Quantastor

To use the QuantaStor Python Client Library, you must first install QuantaStor on your server hardware or use a QuantaStor virtual system. Installation of QuantaStor will also include python3. QuantaStor ISO files are created as hybrid ISO files which can be written to DVD media with DVD writting software or directly copied to a USB flash drive using dd. Follow the installation guide on our support wiki to get started. The installation guide provides instructions for installation and configuration on both server hardware and virtual machines.

Run pip Installer

Using the PYPI pip installer run the following command to install the quantastor python client library:

On Linux/Unix

$ sudo python3 -m pip install quantastor-pkg

Testing qs_client Installation

Start the python3 interpreter:

$ python3

Import quantastor_sdk_enabled() function from the library:

>>> from quantastor.qs_client import quantastor_sdk_enabled

The following should print out 'True':

>>> print (quantastor_sdk_enabled())

Examples

See the ./examples/ directory for examples:

  1. Basic Example

The basic example for the QuantaStor Python Client Library (example.py) does one operation to get information about the storage system that is specified from the command line and dumps the response data in JSON format. You can use this Python script as a basic template to build off of for QuantaStor automation.

  1. StorageVolume

The file example_sv.sh is a bash script that utilizes two python scripts, vol_setup.py and acl_attach.py, to create an example storage volume and host. It then utilizes the qs-util QuantaStor tool-set to add a host initiator and login to an ISCSI session with the example storage volume.

  1. NetworkShare

The file example_ns.sh is a bash script that utilizes the shr_setup.py python script to create an example network share. Then using the zfs mount command, mounts the network share to the local mount directory /mnt/testMount.


Python Interpreter Usage

To quickly do operations from the commandline you can easily utilize the QuantaStor Python Client Library strait from the Python3 interpreter. Run the following commands in the python interpreter to set up a client connection to your QuantaStor server. Replace 'hostIP', 'username', and 'password' with your own credentials:

>>> from qs_client import QuantastorClient
>>> client = QuantastorClient('hostIP', 'username', 'password')

Requests are sent using HTTPS see the 'SSL Certs' section to learn to generate your own 'qs-ca-cert' to use for host verification. If you do not provide your own ca-cert, your client will warn you that 'requests cannot be verified'.

Once you have generated an instance of the 'QuantastorClient' class you can start making REST service calls to your QuantaStor server. The following is a simple example usage similar to the 'example.py' script:

>>> system = client.storage_system_get()

This command will return your QuantaStor storage system as a 'StorageSystem' object. You can view the meta of any object class in JSON format (pretty print) by using the StorageSystem.exportJson() function and the dumps() function from the python json module.

>>> import json
>>> print (json.dumps(system.exportJson(), sort_keys=True,  indent=4, separators=(',', ': ')))

For more information about our REST API methods and objects see our Reference Guide.


SSL Certs

The 'QuantastorClient' class supports HTTPS ca-cert verification. You can provide the full path to your certification file as the fourth argument when creating an instance of the 'QuantastorClient' class:

client = QuantastorClient('hostIP', 'username', 'password','/full/path/to/cert')

The certification path is an optional argument, but you will be warned that your requests cannot be verified if you do not provide one or if your certification path does not exist. If you do provide a valid ca-cert file, REST service calls will only succeed if your SSL verification succeeds.

Metadata

Release files for quantastor-pyclient 0.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quantastor-pyclient 0.0.0
File Size Uploaded Provenance Actions
quantastor-pyclient-0.0.0.tar.gz 91.6 kB Without provenance Details for quantastor-pyclient-0.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for quantastor-pyclient 0.0.0
File Interpreter ABI Platform Actions
quantastor_pyclient-0.0.0-py3-none-any.whl Python 3 none any Details for quantastor_pyclient-0.0.0-py3-none-any.whl
quantastor_pyclient-0.0.0-py2-none-any.whl Python 2 none any Details for quantastor_pyclient-0.0.0-py2-none-any.whl

Total release size: 445.9 kB

Release files / quantastor-pyclient-0.0.0.tar.gz

Download URL quantastor-pyclient-0.0.0.tar.gz
Size 91.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d23f3782311e3318863eb5c2bd30123822564b97a4d0f2bb9b1abf03b9507d8e
BLAKE2b-256 checksum
How to use checksums
b8e9ef5bb6e21dd7df5807e8383d56972acb81f3b74894c3aa280d09ea3f9173
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release files / quantastor_pyclient-0.0.0-py3-none-any.whl

Download URL quantastor_pyclient-0.0.0-py3-none-any.whl
Size 177.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae67c43f397d10cc193f94c075006c761d0e34d2fd370c3e65bc5048d8852589
BLAKE2b-256 checksum
How to use checksums
91e4a5c0ddea1f30e6378d46d06e1b8393fbd1ea8254c13b30572e8f344cd6e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release files / quantastor_pyclient-0.0.0-py2-none-any.whl

Download URL quantastor_pyclient-0.0.0-py2-none-any.whl
Size 177.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
883eef0204d25193b85666206fd114a166c6bcba7cfb7c615a9e7d7a9a1ad6b6
BLAKE2b-256 checksum
How to use checksums
034b935a65ee38868e35c47627492f9610a58f2eae5ca5d584ecedadd388fdc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Security for quantastor-pyclient 0.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.0 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page