def take_action(self, parsed_args): client = _get_client(self, parsed_args) opts = {} opts['all_projects'] = parsed_args.all_projects opts['marker'] = parsed_args.marker opts['limit'] = parsed_args.limit opts['sort_key'] = parsed_args.sort_key opts['sort_dir'] = parsed_args.sort_dir opts['image'] = parsed_args.image opts['name'] = parsed_args.name opts['project_id'] = parsed_args.project_id opts['user_id'] = parsed_args.user_id opts['host'] = parsed_args.host opts['task_state'] = parsed_args.task_state opts['memory'] = parsed_args.memory opts['auto_remove'] = parsed_args.auto_remove opts['status'] = parsed_args.status opts = zun_utils.remove_null_parms(**opts) containers = client.containers.list(**opts) for c in containers: zun_utils.format_container_addresses(c) columns = ('uuid', 'name', 'image', 'status', 'task_state', 'addresses', 'ports') return (columns, (utils.get_item_properties(container, columns) for container in containers))
def take_action(self, parsed_args): client = _get_client(self, parsed_args) opts = {} opts['id'] = parsed_args.capsule opts = zun_utils.remove_null_parms(**opts) capsule = client.capsules.get(**opts) zun_utils.format_container_addresses(capsule) columns = _capsule_columns(capsule) return columns, utils.get_item_properties(capsule, columns)
def take_action(self, parsed_args): client = _get_client(self, parsed_args) opts = {} opts['id'] = parsed_args.container opts['all_projects'] = parsed_args.all_projects opts = zun_utils.remove_null_parms(**opts) container = client.containers.get(**opts) zun_utils.format_container_addresses(container) columns = _container_columns(container) return columns, utils.get_item_properties(container, columns)
def take_action(self, parsed_args): client = _get_client(self, parsed_args) opts = {} opts['all_projects'] = parsed_args.all_projects opts['marker'] = parsed_args.marker opts['limit'] = parsed_args.limit opts['sort_key'] = parsed_args.sort_key opts['sort_dir'] = parsed_args.sort_dir opts = zun_utils.remove_null_parms(**opts) capsules = client.capsules.list(**opts) for capsule in capsules: zun_utils.format_container_addresses(capsule) columns = ('uuid', 'name', 'status', 'addresses') return (columns, (utils.get_item_properties(capsule, columns) for capsule in capsules))
def _show_container(container): zun_utils.format_container_addresses(container) utils.print_dict(container._info)
def _show_capsule(capsule): zun_utils.format_container_addresses(capsule) utils.print_dict(capsule._info)