def do_quota_get(cs, args): """Print a quotas for a project with usages (optional)""" if args.usages: utils.print_dict(cs.quotas.get(usages=args.usages)._info, value_fields=('limit', 'in_use')) else: utils.print_dict(cs.quotas.get(usages=args.usages)._info)
def do_quota_class_update(cs, args): """Print an updated quotas for a quota class""" utils.print_dict(cs.quota_classes.update( args.quota_class_name, containers=args.containers, memory=args.memory, cpu=args.cpu, disk=args.disk)._info)
def do_quota_update(cs, args): """Print an updated quotas for a project""" utils.print_dict( cs.quotas.update(args.project_id, containers=args.containers, memory=args.memory, cpu=args.cpu, disk=args.disk)._info)
def do_host_show(cs, args): """Show details of a host.""" host = cs.hosts.get(args.host) if args.format == 'json': print(jsonutils.dumps(host._info, indent=4, sort_keys=True)) elif args.format == 'yaml': print(yaml.safe_dump(host._info, default_flow_style=False)) elif args.format == 'table': utils.print_dict(host._info)
def do_stats(cs, args): """Display stats of the container.""" stats_info = cs.containers.stats(args.container) utils.print_dict(stats_info)
def _show_registry(registry): utils.print_dict(registry._info['registry'])
def _show_container(container): zun_utils.format_container_addresses(container) utils.print_dict(container._info)
def do_service_force_down(cs, args): """Force Zun service to down or unset the force state.""" res = cs.services.force_down(args.host, args.binary, args.force_down) utils.print_dict(res[1]['service'])
def do_quota_class_get(cs, args): """Print a quotas for a quota class""" utils.print_dict(cs.quota_classes.get(args.quota_class_name)._info)
def _show_image(image): utils.print_dict(image._info)
def _show_action(action): utils.print_dict(action._info)
def do_service_enable(cs, args): """Enable the Zun service.""" res = cs.services.enable(args.host, args.binary) utils.print_dict(res[1]['service'])
def do_service_enable(cs, args): """Enable the Zun service.""" res = cs.services.enable(args.host, args.binary) utils.print_dict(res[1]['service'])
def _show_container(container): zun_utils.format_container_addresses(container) utils.print_dict(container._info)
def do_stats(cs, args): """Display stats of the container.""" stats_info = cs.containers.stats(args.container) utils.print_dict(stats_info)
def _show_action(action): utils.print_dict(action._info)
def _show_capsule(capsule): zun_utils.format_container_addresses(capsule) utils.print_dict(capsule._info)
def _show_capsule(capsule): zun_utils.format_container_addresses(capsule) utils.print_dict(capsule._info)
def do_service_disable(cs, args): """Disable the Zun service.""" res = cs.services.disable(args.host, args.binary, args.reason) utils.print_dict(res[1]['service'])
def do_service_force_down(cs, args): """Force Zun service to down or unset the force state.""" res = cs.services.force_down(args.host, args.binary, args.force_down) utils.print_dict(res[1]['service'])
def do_quota_defaults(cs, args): """Print a default quotas for a project""" utils.print_dict(cs.quotas.defaults()._info)
def _show_capsule(capsule): utils.print_dict(capsule._info)
def do_service_disable(cs, args): """Disable the Zun service.""" res = cs.services.disable(args.host, args.binary, args.reason) utils.print_dict(res[1]['service'])
def _show_registry(registry): utils.print_dict(registry._info['registry'])