'Delete a group_snapshot.'

@wsgi.Controller.api_version(GROUP_SNAPSHOT_API_VERSION)
def delete(self, req, id):

    LOG.debug('delete    called    for    member    %s', id)
    context = req.environ['cinder.context']
    LOG.info('Delete    group_snapshot    with    id:    %s', id, context=context)
    try:
        group_snapshot = self.group_snapshot_api.get_group_snapshot(context, group_snapshot_id=id)
        self._check_default_cgsnapshot_type(group_snapshot.group_type_id)
        self.group_snapshot_api.delete_group_snapshot(context, group_snapshot)
    except exception.InvalidGroupSnapshot as e:
        raise exc.HTTPBadRequest(explanation=six.text_type(e))
    except exception.GroupSnapshotNotFound:
        raise
    except Exception:
        msg = (_('Error    occurred    when    deleting    group    snapshot    %s.') % id)
        LOG.exception(msg)
        raise exc.HTTPBadRequest(explanation=msg)
    return webob.Response(status_int=http_client.ACCEPTED)
