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


Python LiveAction.publish_update方法代码示例

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


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

示例1: _update_action_results

# 需要导入模块: from st2common.persistence.liveaction import LiveAction [as 别名]
# 或者: from st2common.persistence.liveaction.LiveAction import publish_update [as 别名]
 def _update_action_results(self, execution_id, status, results):
     liveaction_db = LiveAction.get_by_id(execution_id)
     if not liveaction_db:
         raise Exception('No DB model for liveaction_id: %s' % execution_id)
     liveaction_db.result = results
     liveaction_db.status = status
     # update liveaction, update actionexecution and then publish update.
     updated_liveaction = LiveAction.add_or_update(liveaction_db, publish=False)
     executions.update_execution(updated_liveaction)
     LiveAction.publish_update(updated_liveaction)
     return updated_liveaction
开发者ID:Kailashkatheth1,项目名称:st2,代码行数:13,代码来源:base.py

示例2: _update_action_results

# 需要导入模块: from st2common.persistence.liveaction import LiveAction [as 别名]
# 或者: from st2common.persistence.liveaction.LiveAction import publish_update [as 别名]
    def _update_action_results(self, execution_id, status, results):
        liveaction_db = LiveAction.get_by_id(execution_id)
        if not liveaction_db:
            raise Exception('No DB model for liveaction_id: %s' % execution_id)

        liveaction_db.result = results
        liveaction_db.status = status

        done = status in DONE_STATES
        if done and not liveaction_db.end_timestamp:
            # Action has completed, record end_timestamp
            liveaction_db.end_timestamp = date_utils.get_datetime_utc_now()

        # update liveaction, update actionexecution and then publish update.
        updated_liveaction = LiveAction.add_or_update(liveaction_db, publish=False)
        executions.update_execution(updated_liveaction)
        LiveAction.publish_update(updated_liveaction)

        return updated_liveaction
开发者ID:ruslantum,项目名称:st2,代码行数:21,代码来源:base.py

示例3: _update_action_results

# 需要导入模块: from st2common.persistence.liveaction import LiveAction [as 别名]
# 或者: from st2common.persistence.liveaction.LiveAction import publish_update [as 别名]
    def _update_action_results(self, execution_id, status, results):
        liveaction_db = LiveAction.get_by_id(execution_id)
        if not liveaction_db:
            raise Exception("No DB model for liveaction_id: %s" % execution_id)

        if liveaction_db.status != action_constants.LIVEACTION_STATUS_CANCELED:
            liveaction_db.status = status

        liveaction_db.result = results

        # Action has completed, record end_timestamp
        if liveaction_db.status in action_constants.LIVEACTION_COMPLETED_STATES and not liveaction_db.end_timestamp:
            liveaction_db.end_timestamp = date_utils.get_datetime_utc_now()

        # update liveaction, update actionexecution and then publish update.
        updated_liveaction = LiveAction.add_or_update(liveaction_db, publish=False)
        executions.update_execution(updated_liveaction)
        LiveAction.publish_update(updated_liveaction)

        return updated_liveaction
开发者ID:Pulsant,项目名称:st2,代码行数:22,代码来源:base.py


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