本文整理汇总了Python中monitors.Monitor.deleteMonitor方法的典型用法代码示例。如果您正苦于以下问题:Python Monitor.deleteMonitor方法的具体用法?Python Monitor.deleteMonitor怎么用?Python Monitor.deleteMonitor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类monitors.Monitor
的用法示例。
在下文中一共展示了Monitor.deleteMonitor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delcheck_page
# 需要导入模块: from monitors import Monitor [as 别名]
# 或者: from monitors.Monitor import deleteMonitor [as 别名]
def delcheck_page(cid):
'''
Dashboard Delete Checks:
This will delete health checks via the url parameters
'''
verify = verifyLogin(
app.config['SECRET_KEY'], app.config['COOKIE_TIMEOUT'], request.cookies)
if verify:
user = User()
user.get('uid', verify, g.rdb_conn)
if user.status != "active":
pass
else:
# Delete the Monitor
monitor = Monitor(cid)
monitor.get(cid, g.rdb_conn)
result = monitor.deleteMonitor(user.uid, cid, g.rdb_conn)
if result:
print("/dashboard/delete-checks - Delete successful")
flash('Health Check was successfully deleted.', 'success')
else:
print("/dashboard/delete-checks - Delete failed")
flash('Health Check was not deleted', 'danger')
return redirect(url_for('member.dashboard_page'))