'Returns a list of group_snapshots through view builder.'

def _get_group_snapshots(self, req, is_detail):

    context = req.environ['cinder.context']
    req_version = req.api_version_request
    filters = marker = limit = offset = sort_keys = sort_dirs = None
    if req_version.matches('3.29'):
        filters = req.params.copy()
        (marker, limit, offset) = common.get_pagination_params(filters)
        (sort_keys, sort_dirs) = common.get_sort_params(filters)
    if req_version.matches(common.FILTERING_VERSION):
        support_like = (True if req_version.matches(common.LIKE_FILTER_VERSION) else False)
        common.reject_invalid_filters(context, filters, 'group_snapshot', support_like)
    group_snapshots = self.group_snapshot_api.get_all_group_snapshots(context, filters=filters, marker=marker, limit=limit, offset=offset, sort_keys=sort_keys, sort_dirs=sort_dirs)
    if is_detail:
        group_snapshots = self._view_builder.detail_list(req, group_snapshots)
    else:
        group_snapshots = self._view_builder.summary_list(req, group_snapshots)
    new_group_snapshots = []
    for grp_snap in group_snapshots['group_snapshots']:
        try:
            self._check_default_cgsnapshot_type(grp_snap['group_type_id'])
            if (not is_detail):
                grp_snap.pop('group_type_id', None)
            new_group_snapshots.append(grp_snap)
        except exc.HTTPBadRequest:
            pass
    group_snapshots['group_snapshots'] = new_group_snapshots
    return group_snapshots
