Ejemplo n.º 1
0
def do_service_list(cs, args):
    """Print a list of zun services."""
    services = cs.services.list()
    columns = ('Id', 'Host', 'Binary', 'State', 'Disabled', 'Disabled Reason',
               'Created At', 'Updated At')
    utils.print_list(services, columns,
                     {'versions': zun_utils.print_list_field('versions')})
Ejemplo n.º 2
0
def do_service_list(cs, args):
    """Print a list of zun services."""
    services = cs.services.list()
    columns = ('Id', 'Host', 'Binary', 'State', 'Disabled',
               'Disabled Reason', 'Updated At',
               'Availability Zone')
    utils.print_list(services, columns,
                     {'versions': zun_utils.print_list_field('versions')})
Ejemplo n.º 3
0
def _list_containers(containers):
    for c in containers:
        _format_container_addresses(c)
    columns = ('uuid', 'name', 'image', 'status', 'task_state', 'addresses',
               'ports')
    utils.print_list(containers,
                     columns,
                     {'versions': zun_utils.print_list_field('versions')},
                     sortby_index=None)
Ejemplo n.º 4
0
def do_action_list(cs, args):
    """Print a list of actions done on a container."""
    container = args.container
    actions = cs.actions.list(container)
    columns = ('user_id', 'container_uuid', 'request_id', 'action',
               'message', 'start_time')
    utils.print_list(actions, columns,
                     {'versions': zun_utils.print_list_field('versions')},
                     sortby_index=None)
def do_network_list(cs, args):
    """List networks on a container"""
    opts = {}
    opts['container'] = args.container
    opts = zun_utils.remove_null_parms(**opts)
    networks = cs.containers.network_list(**opts)
    columns = ('net_id', 'subnet_id', 'port_id', 'version', 'ip_address')
    utils.print_list(networks, columns,
                     {'versions': zun_utils.print_list_field('versions')},
                     sortby_index=None)
def do_image_search(cs, args):
    """Print list of available images from repository based on user query."""
    opts = {}
    opts['image_driver'] = args.image_driver
    opts['exact_match'] = args.exact_match
    images = cs.images.search_image(args.image, **opts)
    columns = ('ID', 'Name', 'Tags', 'Status', 'Size', 'Metadata')
    utils.print_list(images, columns,
                     {'versions': zun_utils.print_list_field('versions')},
                     sortby_index=None)
Ejemplo n.º 7
0
def do_action_list(cs, args):
    """Print a list of actions done on a container."""
    container = args.container
    actions = cs.actions.list(container)
    columns = ('user_id', 'container_uuid', 'request_id', 'action', 'message',
               'start_time')
    utils.print_list(actions,
                     columns,
                     {'versions': zun_utils.print_list_field('versions')},
                     sortby_index=None)
Ejemplo n.º 8
0
def do_host_list(cs, args):
    """Print a list of available host."""
    opts = {}
    opts['marker'] = args.marker
    opts['limit'] = args.limit
    opts['sort_key'] = args.sort_key
    opts['sort_dir'] = args.sort_dir
    opts = zun_utils.remove_null_parms(**opts)
    hosts = cs.hosts.list(**opts)
    columns = ('uuid', 'hostname', 'mem_total', 'cpus', 'disk_total')
    utils.print_list(hosts, columns,
                     {'versions': zun_utils.print_list_field('versions')},
                     sortby_index=None)
Ejemplo n.º 9
0
def do_image_list(cs, args):
    """Print a list of available images."""
    opts = {}
    opts['marker'] = args.marker
    opts['limit'] = args.limit
    opts['sort_key'] = args.sort_key
    opts['sort_dir'] = args.sort_dir
    images = cs.images.list(**opts)
    columns = ('uuid', 'image_id', 'repo', 'tag', 'size')
    utils.print_list(images,
                     columns,
                     {'versions': zun_utils.print_list_field('versions')},
                     sortby_index=None)