コード例 #1
0
 def kill_workflow_execution(self,
                             execution_id: Text) -> WorkflowExecutionProto:
     """
     Stop the instance of the workflow.
     :param execution_id: The ai flow workflow execution identify.
     :return: The result of the action.
     """
     request = scheduling_service_pb2.WorkflowExecutionRequest()
     request.execution_id = execution_id
     response = self.scheduling_stub.killWorkflowExecution(request)
     if response.result.status != StatusProto.OK:
         raise Exception(response.result.error_message)
     return response.workflow_execution
コード例 #2
0
 def get_workflow_execution(self,
                            execution_id: Text) -> WorkflowExecutionProto:
     """
     Get the WorkflowExecutionInfo from scheduler.
     :param execution_id:
     :return: WorkflowExecutionInfo
     """
     request = scheduling_service_pb2.WorkflowExecutionRequest()
     request.execution_id = execution_id
     response = self.scheduling_stub.getWorkflowExecution(request)
     if response.result.status != StatusProto.OK:
         raise Exception(response.result.error_message)
     return response.workflow_execution
コード例 #3
0
 def list_workflow_executions(
         self, namespace: Text,
         workflow_name: Text) -> List[WorkflowExecutionProto]:
     """
     :param namespace:
     :param workflow_name: The ai flow workflow identify.
     :return: All workflow executions of the workflow.
     """
     request = scheduling_service_pb2.WorkflowExecutionRequest()
     request.namespace = namespace
     request.workflow_name = workflow_name
     response = self.scheduling_stub.listWorkflowExecutions(request)
     if response.result.status != StatusProto.OK:
         raise Exception(response.result.error_message)
     return response.workflow_execution_list
コード例 #4
0
 def start_new_workflow_execution(
         self, namespace: Text,
         workflow_name: Text) -> WorkflowExecutionProto:
     """
     Run the project under the current project path.
     :param namespace:
     :param workflow_name: The ai flow workflow identify.
     :return: The result of the run action.
     """
     request = scheduling_service_pb2.WorkflowExecutionRequest()
     request.namespace = namespace
     request.workflow_name = workflow_name
     response = self.scheduling_stub.startNewWorkflowExecution(request)
     if response.result.status != StatusProto.OK:
         raise Exception(response.result.error_message)
     return response.workflow_execution