Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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'])
Ejemplo n.º 4
0
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'])
Ejemplo n.º 5
0
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'])
Ejemplo n.º 6
0
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'
    ])
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
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)
Ejemplo n.º 9
0
def _print_type_and_extra_specs_list(vtypes):
    formatters = {'extra_specs': _print_type_extra_specs}
    utils.print_list(vtypes, ['ID', 'Name', 'extra_specs'], formatters)
Ejemplo n.º 10
0
def _print_monitor_type_list(vtypes):
    utils.print_list(vtypes, ['ID', 'Name'])
Ejemplo n.º 11
0
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)
Ejemplo n.º 12
0
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)
Ejemplo n.º 13
0
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)
Ejemplo n.º 14
0
def _print_type_and_extra_specs_list(vtypes):
    formatters = {'extra_specs': _print_type_extra_specs}
    utils.print_list(vtypes, ['ID', 'Name', 'extra_specs'], formatters)
Ejemplo n.º 15
0
def _print_monitor_type_list(vtypes):
    utils.print_list(vtypes, ['ID', 'Name'])