ScaleIO API client
Project description
Python library that provides convenient way to interact with ScaleIO REST API.
Supported ScaleIO versions: 2.0
Supported Python versions: 2.6, 2.7, 3.4
Library is under development!
Features
Currently supported:
Simple API client with base methods according to ScaleIO documentation
ORM-like models (StoragePool, Volume, etc.)
Scheme validation for API responses
TODO:
HATEOAS links processing
Installation
Install via pip:
$ pip install pyscaleio
Install as RPM package using yum or dnf on Fedora/RHEL/CentOS:
$ dnf copr enable miushanov/pyscaleio
$ dnf install python-scaleio
Usage
Create and register API client:
import pyscaleio # create API client client = pyscaleio.ScaleIOClient.from_args("gateway_address", "admin", "password") # register it for using in models pyscaleio.add_client(client)
Find and modify resources:
# get all volumes in cluster volumes = pyscaleio.Volume.all() assert len(volumes) == 1 # or, get volume by specified id volume = pyscaleio.Volume.one_by_name("test_volume") # and access some volume attributes assert volume.name == "test_volume" assert volume.size == 8 * constants.GIGABYTE # or, resize it to new size volume.resize(16) volume.update() # updates model data assert volume.size == 16 * constants.GIGABYTE
Create or delete resources:
# create new volume in storage pool volume = pyscaleio.Volume.create(16, "storage_pool_id", "new_volume") assert volume.name == "new_volume" assert volume.size == 16 * constants.GIGABYTE # delete volume volume = pyscaleio.Volume.one_by_name("test_volume") volume.delete()
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
pyscaleio-0.1.2.tar.gz
(20.0 kB
view hashes)
Built Distribution
Close
Hashes for pyscaleio-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b9789a90ad244d2f62f51671124ea148a899ec6d9458e207f8908bb00dd8db7 |
|
MD5 | 1bfabc321cfb24c12ab24bdcbf4b750b |
|
BLAKE2b-256 | ebe0df357bba68237a96e0b5697a90cc0bf1324468bb9b0224cdb8c149c32aca |