def METHOD_NAME():
    from alerta.tasks import action_alerts
    action = request.json.get('action', None)
    text = request.json.get('text', 'bulk status update')
    timeout = request.json.get('timeout', None)
    if not action:
        raise ApiError("must supply 'action' as json data", 400)
    query = qb.alerts.from_params(request.args)
    alerts = [alert.id for alert in Alert.find_all(query)]
    if not alerts:
        raise ApiError('not found', 404)
    task = action_alerts.delay(alerts, action, text, timeout, g.login)
    return jsonify(status='ok', message=f'{len(alerts)} alerts queued for action'), 202, {'Location': absolute_url('/_bulk/task/' + task.id)}