- @aria.pass_model_storage
- @aria.pass_resource_storage
- @aria.pass_plugin_manager
- @aria.pass_logger
- def start_execution(self, service_id, execution_id, input, workflow_name,
- model_storage,
- resource_storage,
- plugin_manager,
- logger):
- """
- Start an execution for the specified service
- """
- input = input['sdnc_directives'] if'sdnc_directives'in input else None
- runner = Runner(model_storage, resource_storage, plugin_manager,
- execution_id=execution_id,
- service_id=service_id,
- workflow_name=workflow_name,
- inputs=input)
-
- service = model_storage.service.get(service_id)
- tname = '{}_{}_{}'.format(service.name, workflow_name,
- runner.execution_id)
- thread = threading.ExceptionThread(target=runner.execute,
- name=tname)
- thread.start()
- execution_state[str(runner.execution_id)] = [runner, thread]
- logger.info("execution {} started".format(runner.execution_id))
- return json.dumps({"id": runner.execution_id}), 202
-