当前位置: 首页>>代码示例>>Python>>正文


Python Monitor.webCheck方法代码示例

本文整理汇总了Python中monitors.Monitor.webCheck方法的典型用法代码示例。如果您正苦于以下问题:Python Monitor.webCheck方法的具体用法?Python Monitor.webCheck怎么用?Python Monitor.webCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在monitors.Monitor的用法示例。


在下文中一共展示了Monitor.webCheck方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: checkaction_page

# 需要导入模块: from monitors import Monitor [as 别名]
# 或者: from monitors.Monitor import webCheck [as 别名]
def checkaction_page(cid, action):
  ''' 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)
      if user.uid == monitor.uid:
        if action == "failed":
          monitor.healthcheck = "web-failed"
          result = monitor.webCheck(g.rdb_conn)
          print("/dashboard/action-checks - Manual monitor failure")
        elif action == "healthy":
          monitor.healthcheck = "web-healthy"
          print("/dashboard/action-checks - Manual monitor healthy")
          result = monitor.webCheck(g.rdb_conn)
        
        if result:
          print("/dashboard/action-checks - Manual monitor queued")
          flash('Health check status change is queued', 'success')
        else:
          print("/dashboard/action-checks - Manual monitor action failed")
          flash('Something went wrong. Could not modify health check', 'danger')
      else:
        print("/dashboard/action-checks - Manual monitor action failed: do not own")
        flash('It does not appear you own this health check', 'danger')

  return redirect(url_for('dashboard_page'))
开发者ID:mose,项目名称:cloudroutes-service,代码行数:36,代码来源:web.py


注:本文中的monitors.Monitor.webCheck方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。