def build_resource_info(plural_mappings, resource_map, which_service,
                        action_map=None, register_quota=False,
                        translate_name=False, allow_bulk=False):
    resources = []
    if not which_service:
        which_service = constants.CORE
    if action_map is None:
        action_map = {}
    if which_service != constants.CORE:
        plugin = manager.NeutronManager.get_service_plugins()[which_service]
    else:
        plugin = manager.NeutronManager.get_plugin()
    path_prefix = getattr(plugin, "path_prefix", "")
    LOG.debug('Service %(service)s assigned prefix: %(prefix)s'
              % {'service': which_service, 'prefix': path_prefix})
    for collection_name in resource_map:
        resource_name = plural_mappings[collection_name]
        params = resource_map.get(collection_name, {})
        if translate_name:
            collection_name = collection_name.replace('_', '-')
        if register_quota:
            resource_registry.register_resource_by_name(resource_name)
        member_actions = action_map.get(resource_name, {})
        controller = base.create_resource(
            collection_name, resource_name, plugin, params,
            member_actions=member_actions,
            allow_bulk=allow_bulk,
            allow_pagination=cfg.CONF.allow_pagination,
            allow_sorting=cfg.CONF.allow_sorting)
        resource = extensions.ResourceExtension(
            collection_name,
            controller,
            path_prefix=path_prefix,
            member_actions=member_actions,
            attr_map=params)
        resources.append(resource)
    return resources
Limit the number of documents to scan when performing the query.
dataset/ETHPy150Open openstack/neutron/neutron/api/v2/resource_helper.py/build_resource_info--crossover with--dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py/Cursor.max_scan