cancel_alarm.py 502 B

1234567891011121314151617
  1. from abstract_api import AbstractApi
  2. from apis.operate_mysql import OperateMysql
  3. import traceback
  4. class Cancel_alarm(AbstractApi):
  5. def operation(self, request):
  6. operate_mysql = OperateMysql()
  7. id = request['id']
  8. sql = "UPDATE alarm_data_tbl SET is_cancel=1 WHERE id=%s;" % (id)
  9. try:
  10. operate_mysql.execute_sql(sql)
  11. return "告警关闭成功"
  12. except:
  13. print(traceback.format_exc())
  14. return "告警关闭失败"