def list(ctx): """List Accounts.""" accounts = ctx.sfapi.list_accounts() if ctx.verbose == 0: key_list = ['username', 'status', 'volumes', 'accountID'] else: key_list = [ 'username', 'status', 'initiatorSecret', 'targetSecret', 'volumes', 'attributes', 'accountID' ] cli_utils.print_list(accounts, key_list)
def uuids(ctx, accounts=None): """List Volumes.""" volumes = _list_volumes(ctx, accounts, False) mismatched = [] for v in volumes: if v['attributes']: meta_uuid = v['attributes'].get('uuid', {}) if meta_uuid and meta_uuid not in v['name']: mismatched.append({'ID': v['volumeID'], 'Name': v['name'], 'Attributes-UUID': meta_uuid}) key_list = ['ID', 'Name', 'Attributes-UUID'] cli_utils.print_list(mismatched, key_list)
def uuids(ctx, accounts=None): """List Volumes.""" volumes = _list_volumes(ctx, accounts, False) mismatched = [] for v in volumes: if v['attributes']: meta_uuid = v['attributes'].get('uuid', {}) if meta_uuid and meta_uuid not in v['name']: mismatched.append({ 'ID': v['volumeID'], 'Name': v['name'], 'Attributes-UUID': meta_uuid }) key_list = ['ID', 'Name', 'Attributes-UUID'] cli_utils.print_list(mismatched, key_list)
def list(ctx, accounts=None, deleted=True): """List Volumes.""" volumes = _list_volumes(ctx, accounts, deleted) key_list = ['volumeID', 'iqn', 'enable512e', 'qos', 'totalSize'] cli_utils.print_list(volumes, key_list)
def list(ctx): """List Accounts.""" accounts = ctx.sfapi.list_accounts() key_list = ["username", "status", "initiatorSecret", "targetSecret", "volumes", "attributes", "accountID"] cli_utils.print_list(accounts, key_list)