def _lookup_vpc_count_min_max(session=None, **bfilter):
if session is None:<EOL><INDENT>session = bc.get_reader_session()<EOL><DEDENT>try:<EOL><INDENT>res = session.query(<EOL>func.count(nexus_models_v2.NexusVPCAlloc.vpc_id),<EOL>func.min(nexus_models_v2.NexusVPCAlloc.vpc_id),<EOL>func.max(nexus_models_v2.NexusVPCAlloc.vpc_id),<EOL>).filter(nexus_models_v2.NexusVPCAlloc.switch_ip ==<EOL>bfilter['<STR_LIT>']).one()<EOL>count = res[<NUM_LIT:0>]<EOL>sw_min = res[<NUM_LIT:1>]<EOL>sw_max = res[<NUM_LIT:2>]<EOL>return count, sw_min, sw_max<EOL><DEDENT>except sa_exc.NoResultFound:<EOL><INDENT>pass<EOL><DEDENT>raise c_exc.NexusVPCAllocNotFound(**bfilter)<EOL>
Look up count/min/max Nexus VPC Allocs for given switch.

    :param session: db session
    :param bfilter: filter for mappings query
    :returns: number of VPCs and min value if query gave a result,
             else raise NexusVPCAllocNotFound.