Skip to main content

ScaleIO API client

Project description

https://travis-ci.org/gmmephisto/pyscaleio.svg?branch=master https://coveralls.io/repos/github/gmmephisto/pyscaleio/badge.svg?branch=master

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

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.GIGABYTES
    
    # or, resize it to new size
    volume.resize(16)
    
    volume.update()  # updates model data
    assert volume.size == 16 * constants.GIGABYTES
  • 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.GIGABYTES
    
    # 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.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

pyscaleio-0.1.0-py2.py3-none-any.whl (10.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyscaleio-0.1.0.tar.gz.

File metadata

  • Download URL: pyscaleio-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyscaleio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83256dc1cd24998e1571b4a1dd830056a2722c9c2f2ab820fa9ee0b9d3f9168c
MD5 dcf1ac74280356849f2728f0bb468a44
BLAKE2b-256 1e2b48b00d00167747e17a487be8aef33858279d16d219982bdd18ef89cafd08

See more details on using hashes here.

File details

Details for the file pyscaleio-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyscaleio-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cb47ea9ad2e7b37ac34d663d03202a03559d10c98dd7757706d40d8b53caeb2d
MD5 1d648c249605be35b08c73db4019a5f3
BLAKE2b-256 b0214078fe00f6303f047a3d33afbb59422fb1f175e074d3898d9acfeba86838

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