예제 #1
0
def delete_heartbeat(id):

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

        if response:
            return jsonify(status="ok")
        else:
            return jsonify(status="error", message="failed to delete heartbeat")
예제 #2
0
파일: views.py 프로젝트: yekeqiang/alerta
def delete_heartbeat(id):

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

        if response:
            return jsonify(status="ok")
        else:
            return jsonify(status="error", message="not found"), 404
예제 #3
0
파일: views.py 프로젝트: wangbodong/alerta
def delete_heartbeat(id):

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

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

    tenant =  generateDBName(tenant)

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

    if response:
        return jsonify(status="ok")
    else:
        return jsonify(status="error", message="not found"), 404
예제 #5
0
 def delete(self) -> bool:
     return db.delete_heartbeat(self.id)
예제 #6
0
 def delete(self):
     return db.delete_heartbeat(self.id)
예제 #7
0
파일: heartbeat.py 프로젝트: 3IWOH/alerta
 def delete(self):
     return db.delete_heartbeat(self.id)