docs: def cli(env, start, end, sortby):
      """Bandwidth report for every pool/server.
  
      This reports on the total data transfered for each virtual sever, hardware
      server and bandwidth pool.
      """
  
      env.err('Generating bandwidth report for %s to %s' % (start, end))
  
      table = formatting.Table([
          'type',
          'hostname',
          'public_in',
          'public_out',
          'private_in',
          'private_out',
          'pool',
      ])
      table.sortby = sortby
  
      def f_type(key, results):
          "Filter metric data by type"
          return (result['counter'] for result in results
                  if result['type'] == key)
  
      try:
          for item in itertools.chain(_get_pooled_bandwidth(env, start, end),
                                      _get_virtual_bandwidth(env, start, end),
                                      _get_hardware_bandwidth(env, start, end)):
              pub_in = int(sum(f_type('publicIn_net_octet', item['data'])))
              pub_out = int(sum(f_type('publicOut_net_octet', item['data'])))
              pri_in = int(sum(f_type('privateIn_net_octet', item['data'])))
              pri_out = int(sum(f_type('privateOut_net_octet', item['data'])))
              table.add_row([
                  item['type'],
                  item['name'],
                  formatting.b_to_gb(pub_in),
                  formatting.b_to_gb(pub_out),
                  formatting.b_to_gb(pri_in),
                  formatting.b_to_gb(pri_out),
                  item.get('pool') or formatting.blank(),
              ])
      except KeyboardInterrupt:
          env.err("Printing collected results and then aborting.")
  
      env.out(env.fmt(table))