예제 #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)
예제 #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)
예제 #3
0
파일: shell.py 프로젝트: 52136/openstack
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'])
예제 #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'])
예제 #5
0
파일: shell.py 프로젝트: 52136/openstack
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'])
예제 #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'
    ])
예제 #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)
예제 #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)
예제 #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)
예제 #10
0
def _print_monitor_type_list(vtypes):
    utils.print_list(vtypes, ['ID', 'Name'])
예제 #11
0
파일: shell.py 프로젝트: 52136/openstack
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)
예제 #12
0
파일: shell.py 프로젝트: 52136/openstack
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)
예제 #13
0
파일: shell.py 프로젝트: 52136/openstack
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)
예제 #14
0
파일: shell.py 프로젝트: 52136/openstack
def _print_type_and_extra_specs_list(vtypes):
    formatters = {'extra_specs': _print_type_extra_specs}
    utils.print_list(vtypes, ['ID', 'Name', 'extra_specs'], formatters)
예제 #15
0
파일: shell.py 프로젝트: 52136/openstack
def _print_monitor_type_list(vtypes):
    utils.print_list(vtypes, ['ID', 'Name'])