def do_list_extensions(client, _args): """ List all the os-api extensions that are available. """ extensions = client.list_extensions.show_all() fields = ["Name", "Summary", "Alias", "Updated"] utils.print_list(extensions, fields)
def do_backup_list(cs, args): """List all the backups.""" backups = cs.backups.list() columns = [ 'ID', 'ServiceManage ID', 'Status', 'Name', 'Size', 'Object Count', 'Container' ] utils.print_list(backups, columns)
def do_snapshot_list(cs, args): """List all the snapshots.""" all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants)) search_opts = { 'all_tenants': all_tenants, 'display_name': args.display_name, 'status': args.status, 'monitor_id': args.monitor_id, } snapshots = cs.monitor_snapshots.list(search_opts=search_opts) _translate_monitor_snapshot_keys(snapshots) utils.print_list(snapshots, ['ID', 'ServiceManage ID', 'Status', 'Display Name', 'Size'])
def do_snapshot_list(cs, args): """List all the snapshots.""" all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants)) search_opts = { 'all_tenants': all_tenants, 'display_name': args.display_name, 'status': args.status, 'monitor_id': args.monitor_id, } snapshots = cs.monitor_snapshots.list(search_opts=search_opts) _translate_monitor_snapshot_keys(snapshots) utils.print_list( snapshots, ['ID', 'ServiceManage ID', 'Status', 'Display Name', 'Size'])
def do_list(cs, args): """List all the monitors.""" all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants)) search_opts = { 'all_tenants': all_tenants, 'display_name': args.display_name, 'status': args.status, } monitors = cs.monitors.list(search_opts=search_opts) _translate_monitor_keys(monitors) # Create a list of servers to which the monitor is attached for vol in monitors: servers = [s.get('server_id') for s in vol.attachments] setattr(vol, 'attached_to', ','.join(map(str, servers))) utils.print_list(monitors, ['ID', 'Status', 'Display Name', 'Size', 'ServiceManage Type', 'Bootable', 'Attached to'])
def do_list(cs, args): """List all the monitors.""" all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants)) search_opts = { 'all_tenants': all_tenants, 'display_name': args.display_name, 'status': args.status, } monitors = cs.monitors.list(search_opts=search_opts) _translate_monitor_keys(monitors) # Create a list of servers to which the monitor is attached for vol in monitors: servers = [s.get('server_id') for s in vol.attachments] setattr(vol, 'attached_to', ','.join(map(str, servers))) utils.print_list(monitors, [ 'ID', 'Status', 'Display Name', 'Size', 'ServiceManage Type', 'Bootable', 'Attached to' ])
def do_rate_limits(cs, args): """Print a list of rate limits for a user""" limits = cs.limits.get().rate columns = ['Verb', 'URI', 'Value', 'Remain', 'Unit', 'Next_Available'] utils.print_list(limits, columns)
def do_absolute_limits(cs, args): """Print a list of absolute limits for a user""" limits = cs.limits.get().absolute columns = ['Name', 'Value'] utils.print_list(limits, columns)
def _print_type_and_extra_specs_list(vtypes): formatters = {'extra_specs': _print_type_extra_specs} utils.print_list(vtypes, ['ID', 'Name', 'extra_specs'], formatters)
def _print_monitor_type_list(vtypes): utils.print_list(vtypes, ['ID', 'Name'])
def do_backup_list(cs, args): """List all the backups.""" backups = cs.backups.list() columns = ['ID', 'ServiceManage ID', 'Status', 'Name', 'Size', 'Object Count', 'Container'] utils.print_list(backups, columns)
def do_rate_limits(cs, args): """Print a list of rate limits for a user""" limits = cs.limits.get().rate columns = ['Verb', 'URI', 'Value', 'Remain', 'Unit', 'Next_Available'] utils.print_list(limits, columns)
def do_absolute_limits(cs, args): """Print a list of absolute limits for a user""" limits = cs.limits.get().absolute columns = ['Name', 'Value'] utils.print_list(limits, columns)
def _print_type_and_extra_specs_list(vtypes): formatters = {'extra_specs': _print_type_extra_specs} utils.print_list(vtypes, ['ID', 'Name', 'extra_specs'], formatters)
def _print_monitor_type_list(vtypes): utils.print_list(vtypes, ['ID', 'Name'])