Skip to main content

pyscaleio

https://travis-ci.org/gmmephisto/pyscaleio.svg?branch=master https://coveralls.io/repos/github/gmmephisto/pyscaleio/badge.svg?branch=master https://copr.fedorainfracloud.org/coprs/miushanov/pyscaleio/package/python-scaleio/status_image/last_build.png

Python library that provides convenient way to interact with ScaleIO/VxFlex REST API.

  • Supported ScaleIO/VxFlex versions: 2.0

  • Supported Python versions: 2.6, 2.7, 3.4, 3.5, 3.6

Library is under development!

Features

Currently supported:

  • Simple API client with base methods according to ScaleIO/VxFlex 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/pyaddons
$ 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()
  • Tune client and models options:

pyscaleio.configure(
   # retries count for each request
   request_retries=0,
   # network timeout for requests
   network_timeout=30,
   # name of exported volume (according to udev/rules.d)
   volume_name="emc-2{system_id}{volume_id}",
   # prefix of exported volume
   volume_prefix="/dev/disk/by-id")

volume = pyscaleio.Volume.one_by_name("test_volume")
assert volume.path == "/dev/disk/by-id/emc-27947a0127a79ce60ca29f20900000008"

Tests

Tests for this library divided to unit tests and functional tests. Functional tests requires ScaleIO installation and available REST API Gateway service. For running functional tests use tox environment with name functional with passed variables:

  • scaleio_host - IP address or hostname of ScaleIO REST API Gateway

  • scaleio_user - username

  • scaleio_passwd - password

  • scaleio_is_secure - 1 for using https scheme otherwise 0 (optional)

  • scaleio_trace - level of logging to stderr (optional)

Example:

$ scaleio_host=localhost scaleio_user=admin scaleio_passwd=passwd tox -e functional

Metadata

Release files for pyscaleio 0.1.7

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

Source distribution (sdist)

Source distribution for pyscaleio 0.1.7
File Size Uploaded
pyscaleio-0.1.7.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyscaleio 0.1.7
File Interpreter ABI Platform
pyscaleio-0.1.7-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 40.6 kB

Release files / pyscaleio-0.1.7.tar.gz

Download URL pyscaleio-0.1.7.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e169cb69ab49d0f2838403eec70702d66d2e7bea4f4414d5fa1fe991cf152a25
BLAKE2b-256 checksum
How to use checksums
ca332433c3ca16e67ce1885573021fc6592aedf6bbc79f612edb2777979fdcf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release files / pyscaleio-0.1.7-py2.py3-none-any.whl

Download URL pyscaleio-0.1.7-py2.py3-none-any.whl
Size 13.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
82f12e7d63e16397717255ce3ef59d0f8d751b8668e573cf85711fd8aca1238a
BLAKE2b-256 checksum
How to use checksums
4bfa7956371be4fb617b25342c5de2b8234d0f1bcdc9415a70e425997c5ee0b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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