'Gets the resources on the backend available for management by Cinder.
Receives the parameters from "get_manageable_volumes" and
"get_manageable_snapshots" and gets the available resources
:param cinder_resources: A list of resources in this host that Cinder
currently manages
:param resource_type: If it\'s a volume or a snapshot
:param marker: The last item of the previous page; we return the
next results after this value (after sorting)
:param limit: Maximum number of items to return
:param offset: Number of items to skip after marker
:param sort_keys: List of keys to sort results by (valid keys
are \'identifier\' and \'size\')
:param sort_dirs: List of directions to sort by, corresponding to
sort_keys (valid directions are \'asc\' and \'desc\')
:returns: list of dictionaries, each specifying a volume or snapshot
(resource) in the host, with the following keys:
- reference (dictionary): The reference for a resource,
which can be passed to "manage_existing_snapshot".
- size (int): The size of the resource according to the storage
backend, rounded up to the nearest GB.
- safe_to_manage (boolean): Whether or not this resource is
safe to manage according to the storage backend.
- reason_not_safe (string): If safe_to_manage is False,
the reason why.
- cinder_id (string): If already managed, provide the Cinder ID.
- extra_info (string): Any extra information to return to the
user
- source_reference (string): Similar to "reference", but for the
snapshot\'s source volume.'

def _get_manageable_resource_info(self, cinder_resources, resource_type, marker, limit, offset, sort_keys, sort_dirs):

    entries = []
    exports = {}
    bend_rsrc = {}
    cinder_ids = [resource.id for resource in cinder_resources]
    for service in self.config['services']:
        exp_path = self.config['services'][service]['hdp']
        exports[exp_path] = self.config['services'][service]['export']['fs']
    for exp in exports.keys():
        bend_rsrc[exp] = self._get_volumes_from_export(exp)
        mnt_point = self._get_mount_point_for_share(exp)
        for resource in bend_rsrc[exp]:
            if (((resource_type == 'volume') and (('.' in resource) or ('snapshot' in resource))) or ((resource_type == 'snapshot') and ('.' not in resource) and ('snapshot' not in resource))):
                continue
            path = ('%s/%s' % (exp, resource))
            mnt_path = ('%s/%s' % (mnt_point, resource))
            size = self._get_file_size(mnt_path)
            rsrc_inf = {'reference': {'source-name': path}, 'size': size, 'cinder_id': None, 'extra_info': None}
            if (resource_type == 'volume'):
                potential_id = utils.extract_id_from_volume_name(resource)
            elif ('snapshot' in resource):
                potential_id = utils.extract_id_from_snapshot_name(resource)
            else:
                potential_id = resource.split('.')[1]
            if (potential_id in cinder_ids):
                rsrc_inf['safe_to_manage'] = False
                rsrc_inf['reason_not_safe'] = 'already    managed'
                rsrc_inf['cinder_id'] = potential_id
            else:
                rsrc_inf['safe_to_manage'] = True
                rsrc_inf['reason_not_safe'] = None
            if (resource_type == 'snapshot'):
                if ('snapshot' not in resource):
                    origin = self._get_snapshot_origin_from_name(resource)
                    if ('unmanage' in origin):
                        origin = origin[16:]
                    else:
                        origin = origin[7:]
                    rsrc_inf['source_reference'] = {'id': origin}
                else:
                    path = path.split(':')[1]
                    origin = self._get_snapshot_origin(path, exports[exp])
                    if (not origin):
                        continue
                    elif (len(origin) == 1):
                        origin = origin[0].split('/')[2]
                        origin = utils.extract_id_from_volume_name(origin)
                        rsrc_inf['source_reference'] = {'id': origin}
                    else:
                        LOG.warning('Could    not    determine    the    volume    that    owns    the    snapshot    %(snap)s', {'snap': resource})
                        rsrc_inf['source_reference'] = {'id': 'unknown'}
                        rsrc_inf['extra_info'] = 'Could    not    determine    the    volume    that    owns    the    snapshot'
            entries.append(rsrc_inf)
    return utils.paginate_entries_list(entries, marker, limit, offset, sort_keys, sort_dirs)
