Beispiel #1
0
def delete_alert(id):

    if request.method == 'DELETE' or (request.method == 'POST' and request.json['_method'] == 'delete'):
        delete_timer.start_timer()
        response = db.delete_alert(id)
        delete_timer.stop_timer()

        if response:
            return jsonify(status="ok")
        else:
            return jsonify(status="error", message="failed to delete alert")
Beispiel #2
0
def delete_alert(id):

    if (request.method == 'DELETE' or
            (request.method == 'POST' and '_method' in request.json and request.json['_method'] == 'delete')):
        started = delete_timer.start_timer()
        try:
            response = db.delete_alert(id)
        except Exception as e:
            return jsonify(status="error", message=str(e)), 500
        delete_timer.stop_timer(started)

        if response:
            return jsonify(status="ok")
        else:
            return jsonify(status="error", message="not found"), 404
Beispiel #3
0
def delete_alert(id):

    if (request.method == 'DELETE' or
            (request.method == 'POST' and '_method' in request.json and request.json['_method'] == 'delete')):
        started = delete_timer.start_timer()
        try:
            response = db.delete_alert(id)
        except Exception as e:
            return jsonify(status="error", message=str(e)), 500
        delete_timer.stop_timer(started)

        if response:
            return jsonify(status="ok")
        else:
            return jsonify(status="error", message="not found"), 404
Beispiel #4
0
def delete_alert(tenant,id):

    started = delete_timer.start_timer()

    tenant = generateDBName(tenant)

    try:
        response = db.delete_alert(tenant,id)
    except Exception as e:
        return jsonify(status="error", message=str(e)), 500
    delete_timer.stop_timer(started)

    if response:
        return jsonify(status="ok")
    else:
        return jsonify(status="error", message="not found"), 404
Beispiel #5
0
 def delete(self) -> bool:
     return db.delete_alert(self.id)
Beispiel #6
0
 def delete(self):
     return db.delete_alert(self.id)
Beispiel #7
0
 def delete(self):
     return db.delete_alert(self.id)
Beispiel #8
0
 def delete(self) -> bool:
     return db.delete_alert(self.id)