Example #1
0
    def get(self, name):
        LOG.debug("Fetch workbook [name=%s]" % name)

        values = db_api.workbook_get(name)

        if not values:
            abort(404)
        else:
            return Workbook.from_dict(values)
Example #2
0
    def get(self, name):
        LOG.debug("Fetch workbook [name=%s]" % name)

        values = db_api.workbook_get(name)

        if not values:
            abort(404)
        else:
            return Workbook.from_dict(values)
Example #3
0
    def scheduler_triggers(self, ctx):
        LOG.debug('Processing next Scheduler triggers.')

        for trigger in sched.get_next_triggers():
            wb = db_api.workbook_get(trigger['workbook_name'])
            context.set_ctx(trusts.create_context(wb))

            try:
                task = parser.get_workbook(
                    wb['definition']).get_trigger_task_name(trigger['name'])
                self.engine.start_workflow_execution(wb['name'], task)
            finally:
                sched.set_next_execution_time(trigger)
                context.set_ctx(None)
Example #4
0
    def scheduler_triggers(self, ctx):
        LOG.debug('Processing next Scheduler triggers.')

        for trigger in sched.get_next_triggers():
            wb = db_api.workbook_get(trigger['workbook_name'])
            context.set_ctx(trusts.create_context(wb))

            try:
                task = parser.get_workbook(
                    wb['definition']).get_trigger_task_name(trigger['name'])
                self.engine.start_workflow_execution(wb['name'], task)
            finally:
                sched.set_next_execution_time(trigger)
                context.set_ctx(None)
Example #5
0
    def post(self, workbook_name, execution):
        """Create a new Execution."""
        LOG.debug("Create execution [workbook_name=%s, execution=%s]" %
                  (workbook_name, execution))

        if (db_api.workbook_get(workbook_name)
                and db_api.workbook_definition_get(workbook_name)):
            context = None
            if execution.context:
                context = json.loads(execution.context)

            engine = pecan.request.context['engine']
            values = engine.start_workflow_execution(execution.workbook_name,
                                                     execution.task,
                                                     context)

            return Execution.from_dict(values)
Example #6
0
 def _get_workbook(cls, workbook_name):
     wb = db_api.workbook_get(workbook_name)
     return parser.get_workbook(wb["definition"])
Example #7
0
    def _add_variables_to_data_flow_context(cls, df_ctx, execution):
        db_workbook = db_api.workbook_get(execution['workbook_name'])

        data_flow.add_openstack_data_to_context(df_ctx, db_workbook)
        data_flow.add_execution_to_context(df_ctx, execution)
Example #8
0
    def get(self, name):
        """Return the named workbook."""
        LOG.debug("Fetch workbook [name=%s]" % name)

        values = db_api.workbook_get(name)
        return Workbook.from_dict(values)
    def _add_variables_to_data_flow_context(cls, context, execution):
        db_workbook = db_api.workbook_get(execution['workbook_name'])

        data_flow.add_token_to_context(context, db_workbook)
        data_flow.add_execution_to_context(context, execution)
Example #10
0
    def get_all(self, workbook_name):
        """Return all Executions."""
        LOG.debug("Fetch executions [workbook_name=%s]" % workbook_name)

        if db_api.workbook_get(workbook_name):
            return self._get_all(workbook_name=workbook_name)
Example #11
0
 def _get_workbook(cls, workbook_name):
     wb = db_api.workbook_get(workbook_name)
     return parser.get_workbook(wb["definition"])
Example #12
0
    def _add_variables_to_data_flow_context(cls, context, execution):
        db_workbook = db_api.workbook_get(execution['workbook_name'])

        data_flow.add_token_to_context(context, db_workbook)
        data_flow.add_execution_to_context(context, execution)