def create(ctx, size, account_id, name, enable512e=True, attributes=None, qos=None, count=1): """Creates <count> volumes of <size> on the SolidFire Cluster. Where size can be specified in bytes GibiBytes or GigaBytes (1073741824 | 1Gi | 1G). """ vol_ids = [] size = utils.string_to_bytes(size) if qos: qos = utils.kv_string_to_dict(qos) for k, v in qos.iteritems(): qos[k] = int(v) if attributes: import pdb;pdb.set_trace() attributes = utils.kv_string_to_dict(attributes) vname = name for i in xrange(0, int(count)): if i > 0: vname = name + ('-%s' % i) vol_ids.append(ctx.sfapi.create_volume(vname, account_id, size, enable512e, qos, attributes)) for vid in vol_ids: vol = _get_volume(ctx, vid) qos = vol['qos'] qos.pop('curve', None) cli_utils.print_dict(vol)
def add(ctx, user_name, initiator_secret=None, target_secret=None, attributes=None): """Creates <count> clones of volume specified by volume-id.""" if attributes: attributes = utils.kv_string_to_dict(attributes) new_account_id = ctx.sfapi.add_account(user_name, initiator_secret, target_secret, attributes) account = ctx.sfapi.get_account_by_id(new_account_id)["account"] cli_utils.print_dict(account)
def show(ctx, volume_id): vol = _get_volume(ctx, volume_id) qos = vol['qos'] # TODO(jdg): Add an option for curve, and figure # out a way to display it. For now just remove it qos.pop('curve', None) cli_utils.print_dict(vol)
def clone(ctx, volume_id, name, from_snapshot, new_account_id=None, new_size=None, attributes=None, access='rw', count=1): """Creates <count> clones of volume specified by volume-id.""" vol_ids = [] if attributes: attributes = utils.kv_string_to_dict(attributes) clone_name = name for i in xrange(0, int(count)): if i > 0: clone_name = name + ('-%s' % i) vol_ids.append( ctx.sfapi.clone_volume(volume_id, clone_name, new_account_id=new_account_id, new_size=new_size, access=access, snapshot_id=from_snapshot, attributes=attributes)) for vid in vol_ids: vol = _get_volume(ctx, vid) qos = vol['qos'] qos.pop('curve', None) cli_utils.print_dict(vol)
def add(ctx, user_name, initiator_secret=None, target_secret=None, attributes=None): """Creates <count> clones of volume specified by volume-id.""" if attributes: attributes = utils.kv_string_to_dict(attributes) new_account_id = ctx.sfapi.add_account(user_name, initiator_secret, target_secret, attributes) account = ctx.sfapi.get_account_by_id(new_account_id)['account'] cli_utils.print_dict(account)
def clone(ctx, volume_id, name, from_snapshot, new_account_id=None, new_size=None, attributes=None, access='rw', count=1): """Creates <count> clones of volume specified by volume-id.""" vol_ids = [] if attributes: attributes = utils.kv_string_to_dict(attributes) clone_name = name for i in xrange(0, int(count)): if i > 0: clone_name = name + ('-%s' % i) vol_ids.append(ctx.sfapi.clone_volume(volume_id, clone_name, new_account_id=new_account_id, new_size=new_size, access=access, snapshot_id=from_snapshot, attributes=attributes)) for vid in vol_ids: vol = _get_volume(ctx, vid) qos = vol['qos'] qos.pop('curve', None) cli_utils.print_dict(vol)
def create(ctx, size, account_id, name, enable512e=True, attributes=None, qos=None, count=1): """Creates <count> volumes of <size> on the SolidFire Cluster. Where size can be specified in bytes GibiBytes or GigaBytes (1073741824 | 1Gi | 1G). """ vol_ids = [] size = utils.string_to_bytes(size) if qos: qos = utils.kv_string_to_dict(qos) for k, v in qos.iteritems(): qos[k] = int(v) if attributes: import pdb pdb.set_trace() attributes = utils.kv_string_to_dict(attributes) vname = name for i in xrange(0, int(count)): if i > 0: vname = name + ('-%s' % i) vol_ids.append( ctx.sfapi.create_volume(vname, account_id, size, enable512e, qos, attributes)) for vid in vol_ids: vol = _get_volume(ctx, vid) qos = vol['qos'] qos.pop('curve', None) cli_utils.print_dict(vol)
def show(ctx, account_id): account = ctx.sfapi.get_account_by_id(account_id)['account'] cli_utils.print_dict(account)
def stats(ctx, volume_id): stats_info = ctx.sfapi.get_volume_stats(volume_id)['volumeStats'] cli_utils.print_dict(stats_info)
def show(ctx, account_id): account = ctx.sfapi.get_account_by_id(account_id)["account"] cli_utils.print_dict(account)