def print_load_balancer(w):
    """
    Helper for printing LoadBalancer details.
    """
    print('%s (%s) %s' % (w.name, w.uuid, w.status))
    print('  input: %s on %s:%d' % (w.type, w.address, w.port))
    if w.type == 'HTTP':
        if not w.domains:
            print('  no domains')
        else:
            print('  domains:')
            for d in w.domains:
                print('    %s' % d)
    if w.monitor:
        print('  health monitor:', end=' ')
        m = w.monitor
        if m.check_type == 'tcp':
            print('tcp-connection, interval %0.3f sec, timeout %0.3f sec' %
                (m.interval_ms / 1000.0, m.timeout_ms / 1000.0))
        elif m.check_type == 'http':
            print(
                'http-request, interval %0.3f sec, timeout %0.3f sec, request "%s %s", expected %s'
                 % (m.interval_ms, m.timeout_ms, m.http_method, m.http_path,
                ','.join(m.http_expect_alive)))
        else:
            print('unknown')
    if not w.backends:
        print('  no backends')
    else:
        print('  backends:')
        for b in w.backends:
            print('    %s:%i, weight=%i (%s)' % (b.ip, b.port, b.weight, b.
                uuid))
    if w.history:
        print('  recent actions:')
        for h in w.history:
            print('    %s: (%s %s) %s %s' % (h.time, h.auth, h.ip, h.action,
                h.arguments if h.arguments else ''))
    print()
