'Return summary of volumes.'

@wsgi.Controller.api_version(SUMMARY_BASE_MICRO_VERSION)
def summary(self, req):

    view_builder_v3 = volume_views_v3.ViewBuilder()
    context = req.environ['cinder.context']
    filters = req.params.copy()
    utils.remove_invalid_filter_options(context, filters, self._get_volume_filter_options())
    (num_vols, sum_size, metadata) = self.volume_api.get_volume_summary(context, filters=filters)
    req_version = req.api_version_request
    if req_version.matches('3.36'):
        all_distinct_metadata = metadata
    else:
        all_distinct_metadata = None
    return view_builder_v3.quick_summary(num_vols, int(sum_size), all_distinct_metadata)
