當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。