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


Python ActionExecutionState.add_or_update方法代码示例

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


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

示例1: _update_state_models

# 需要导入模块: from st2common.persistence.executionstate import ActionExecutionState [as 别名]
# 或者: from st2common.persistence.executionstate.ActionExecutionState import add_or_update [as 别名]
 def _update_state_models(cls):
     states = ResultsTrackerTests.states
     state1 = ActionExecutionState.get_by_id(states['state1.yaml'].id)
     state1.execution_id = ResultsTrackerTests.liveactions['liveaction1.yaml'].id
     state2 = ActionExecutionState.get_by_id(states['state2.yaml'].id)
     state2.execution_id = ResultsTrackerTests.liveactions['liveaction2.yaml'].id
     ResultsTrackerTests.states['state1.yaml'] = ActionExecutionState.add_or_update(state1)
     ResultsTrackerTests.states['state2.yaml'] = ActionExecutionState.add_or_update(state2)
开发者ID:nzlosh,项目名称:st2,代码行数:10,代码来源:test_resultstracker.py

示例2: setup_query

# 需要导入模块: from st2common.persistence.executionstate import ActionExecutionState [as 别名]
# 或者: from st2common.persistence.executionstate.ActionExecutionState import add_or_update [as 别名]
def setup_query(liveaction_id, runnertype_db, query_context):
    if not getattr(runnertype_db, 'query_module', None):
        raise Exception('The runner "%s" does not have a query module.' % runnertype_db.name)

    state_db = ActionExecutionStateDB(
        execution_id=liveaction_id,
        query_module=runnertype_db.query_module,
        query_context=query_context
    )

    ActionExecutionState.add_or_update(state_db)
开发者ID:StackStorm,项目名称:st2,代码行数:13,代码来源:queries.py

示例3: _create_execution_state

# 需要导入模块: from st2common.persistence.executionstate import ActionExecutionState [as 别名]
# 或者: from st2common.persistence.executionstate.ActionExecutionState import add_or_update [as 别名]
 def _create_execution_state(self, liveaction_id, runnertype_db, query_context):
     state_db = ActionExecutionStateDB(
         execution_id=liveaction_id, query_module=runnertype_db.query_module, query_context=query_context
     )
     try:
         return ActionExecutionState.add_or_update(state_db)
     except:
         LOG.exception("Unable to create execution state db for liveaction_id %s." % liveaction_id)
         return None
开发者ID:pixelrebel,项目名称:st2,代码行数:11,代码来源:base.py

示例4: _create_save_actionstate

# 需要导入模块: from st2common.persistence.executionstate import ActionExecutionState [as 别名]
# 或者: from st2common.persistence.executionstate.ActionExecutionState import add_or_update [as 别名]
 def _create_save_actionstate():
     created = ActionExecutionStateDB()
     created.query_context = {'id': 'some_external_service_id'}
     created.query_module = 'dummy.modules.query1'
     created.execution_id = bson.ObjectId()
     return ActionExecutionState.add_or_update(created)
开发者ID:StackStorm,项目名称:st2,代码行数:8,代码来源:test_db_action_state.py

示例5: get_state

# 需要导入模块: from st2common.persistence.executionstate import ActionExecutionState [as 别名]
# 或者: from st2common.persistence.executionstate.ActionExecutionState import add_or_update [as 别名]
 def get_state(cls, exec_db):
     state = ActionExecutionStateDB(execution_id=str(exec_db.id), query_context={'id': 'foo'},
                                    query_module='test_querymodule')
     return ActionExecutionState.add_or_update(state)
开发者ID:StackStorm,项目名称:st2,代码行数:6,代码来源:test_action_state_consumer.py


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