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
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
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
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