'Returns a list of cgsnapshots, transformed through view builder.'

def _get_cgsnapshots(self, req, is_detail):

    context = req.environ['cinder.context']
    grp_snapshots = self.group_snapshot_api.get_all_group_snapshots(context)
    grpsnap_limited_list = common.limited(grp_snapshots, req)
    if is_detail:
        grp_snapshots = self._view_builder.detail_list(req, grpsnap_limited_list)
    else:
        grp_snapshots = self._view_builder.summary_list(req, grpsnap_limited_list)
    return grp_snapshots
