Skip to content

Commit

Permalink
Fix version and class imports
Browse files Browse the repository at this point in the history
Change setup.py to point towards v0.4

Fix import of statistics class
  • Loading branch information
swevm committed Sep 27, 2015
1 parent 552678a commit 1ec4b99
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/connect-cluster.py
Expand Up @@ -17,3 +17,5 @@
pprint(sio.protection_domains)
print "--- ScaleIO Fault Sets ---"
pprint(sio.fault_sets)
print "--- ScaleIO Statistics ---"
pprint(sio.statistics)
16 changes: 16 additions & 0 deletions scaleiopy/scaleio.py
Expand Up @@ -25,6 +25,7 @@
from scaleiopy.api.scaleio.mapping.link import Link
from scaleiopy.api.scaleio.mapping.snapshotspecification import SnapshotSpecification
from scaleiopy.api.scaleio.mapping.vtree import Vtree
from scaleiopy.api.scaleio.mapping.statistics import Statistics


# How to remove this one. Let Requests inherit from this class???
Expand Down Expand Up @@ -327,6 +328,21 @@ def vtrees(self):
)
return all_vtrees

@property
def statistics(self):
"""
Returns a `list` of all the `System` Statistics. Updates every time - no caching.
:return: a `list` of all the `System` Statistics known to the cluster.
:rtype: list
"""
self._check_login()
response = self._do_get("{}/{}{}/{}".format(self._api_url, "instances/System::", str(self.get_system_id()), "relationships/Statistics")).json()
return response
#all_stats = []
#for statistic in response:
# all_stats.append(ScaleIO_Statistics.from_dict(statistic))
#return all_stats

def get_system_objects(self):
return self.system

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -15,7 +15,7 @@
author_email='magnus@karabas.nu',
name='ScaleIO-py',
description='Python interface to ScaleIO 1.31+ REST API',
version="0.3.3-3",
version="0.4.0-0",
url='https://github.com/swevm/scaleio-py/',
license='Apache License',
packages=find_packages(),
Expand Down

0 comments on commit 1ec4b99

Please sign in to comment.