Example #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")
Example #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
Example #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
Example #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
Example #5
0
 def delete(self) -> bool:
     return db.delete_alert(self.id)
Example #6
0
 def delete(self):
     return db.delete_alert(self.id)
Example #7
0
 def delete(self):
     return db.delete_alert(self.id)
Example #8
0
 def delete(self) -> bool:
     return db.delete_alert(self.id)