Example #1
0
#!/usr/bin/python

import scaleio
import json

volumes = []
for volume in scaleio.get_volumes():
    volumes.append(scaleio.get_volume(volume['id']))

print (json.dumps(volumes,sort_keys=True,indent=2))
Example #2
0
#!/usr/bin/python

import scaleio
from pprint import pprint

data = scaleio.get_volumes()
for volume in data:
    statistics = scaleio.get_volume_statistics(volume['id'])
    pool = scaleio.get_pool(volume['storagePoolId'])
    info = scaleio.get_volume(volume['id'])
    mapped=False
    if info['mappedSdcInfo']:
        mapped=True
    thin=False
    data = {}
    print (
        volume['id'],
        volume['name'],
        volume['sizeInKb'],
        volume['volumeType'],
        volume['useRmcache'],
        volume['ancestorVolumeId'],
        pool['name'],
        mapped,
        statistics['userDataReadBwc']['totalWeightInKb'],
        statistics['userDataReadBwc']['numOccured'],
        statistics['userDataWriteBwc']['totalWeightInKb'],
        statistics['userDataWriteBwc']['numOccured']
    )