def get_do_recipe(action_spec): params = RaiseAlarm._get_vertex_params(action_spec) params[VProps.STATE] = AlarmProps.ALARM_ACTIVE_STATE add_vertex_step = ActionStepWrapper(ADD_VERTEX, params) return [add_vertex_step]
def get_undo_recipe(action_spec): params = RaiseAlarm._get_vertex_params(action_spec) params[VProps.STATE] = AlarmProps.ALARM_INACTIVE_STATE remove_vertex_step = ActionStepWrapper(REMOVE_VERTEX, params) return [remove_vertex_step]
def get_undo_recipe(action_spec): edge_params = AddCausalRelationship._get_edge_params( action_spec.targets) remove_edge_step = ActionStepWrapper(REMOVE_EDGE, edge_params) return [remove_edge_step]
def get_do_recipe(action_spec): edge_params = AddCausalRelationship._get_edge_params( action_spec.targets) add_edge_step = ActionStepWrapper(ADD_EDGE, edge_params) return [add_edge_step]
def _get_update_vertex_step(target_id, vitrage_state): update_vertex_params = { VProps.VITRAGE_ID: target_id, VProps.VITRAGE_STATE: vitrage_state } update_vertex_step = ActionStepWrapper(UPDATE_VERTEX, update_vertex_params) return update_vertex_step
def _get_update_vertex_step(target_id, is_marked_down): update_vertex_params = { VProps.VITRAGE_ID: target_id, VProps.IS_MARKED_DOWN: is_marked_down } update_vertex_step = ActionStepWrapper(UPDATE_VERTEX, update_vertex_params) return update_vertex_step
def _get_execute_external_step(properties): properties[EXECUTION_ENGINE] = MISTRAL execute_external_step = ActionStepWrapper(EXECUTE_EXTERNAL, properties) return execute_external_step