'Return a list of attachments, transformed through view builder.'

def _items(self, req):

    context = req.environ['cinder.context']
    req_version = req.api_version_request
    search_opts = req.GET.copy()
    (sort_keys, sort_dirs) = common.get_sort_params(search_opts)
    (marker, limit, offset) = common.get_pagination_params(search_opts)
    self._process_attachment_filtering(context=context, filters=search_opts, req_version=req_version)
    if search_opts.get('instance_id', None):
        search_opts['instance_uuid'] = search_opts.pop('instance_id', None)
    if (context.is_admin and ('all_tenants' in search_opts)):
        del search_opts['all_tenants']
        return objects.VolumeAttachmentList.get_all(context, search_opts=search_opts, marker=marker, limit=limit, offset=offset, sort_keys=sort_keys, sort_direction=sort_dirs)
    else:
        return objects.VolumeAttachmentList.get_all_by_project(context, context.project_id, search_opts=search_opts, marker=marker, limit=limit, offset=offset, sort_keys=sort_keys, sort_direction=sort_dirs)
