def _HasOneSimplePort(ports):
  """Check if this list of ports only contains a single simple port.

  Args:
    ports: JSON-serializable representation of address ports.

  Returns:
    True if ports is length 1 and the only attribute is just a port number
    with no protocol.
  """
  if len(ports) == 1:
    protocol = ports[0].get('protocol', None)
    port_name = ports[0].get('name', None)
    return (not protocol) and (not port_name)
  else:
    return False