'Returns a list of consistency groups through view builder.'

def _get_consistencygroups(self, req, is_detail):

    context = req.environ['cinder.context']
    filters = req.params.copy()
    (marker, limit, offset) = common.get_pagination_params(filters)
    (sort_keys, sort_dirs) = common.get_sort_params(filters)
    groups = self.group_api.get_all(context, filters=filters, marker=marker, limit=limit, offset=offset, sort_keys=sort_keys, sort_dirs=sort_dirs)
    if is_detail:
        groups = self._view_builder.detail_list(req, groups)
    else:
        groups = self._view_builder.summary_list(req, groups)
    return groups
