Skip to content
Snippets Groups Projects

WS-290: Abort executions of failed versions

Merged Nathan Hertz requested to merge WS-290-abort-running-executions into main
Files
4
@@ -293,6 +293,19 @@ class WorkflowRequestRestService:
# 4. submit ingestion workflow request
self.request.workflows.execute(ingest_request)
@view_config(request_method="POST", route_name="abort_workflow_request")
def abort(self):
"""
Given the ID of a workflow request, abort the execution of the request if it is running
"""
request_id = self.request.matchdict["request_id"]
self.request.workflows.abort_running_workflow(request_id)
return Response(
status_code=http.HTTPStatus.OK,
body=f"SUCCESS: Sent signal to abort running workflow request #{request_id}.",
)
@view_config(request_method="POST", route_name="qa_fail")
def qa_fail(self):
"""
@@ -596,6 +609,12 @@ def main(global_config, **settings):
"/workflows/{name}/requests/{request_id}/ingest",
factory=lookup_request,
)
# Use this route to abort a running workflow
config.add_route(
"abort_workflow_request",
"/workflows/requests/{request_id}/abort",
factory=lookup_request,
)
# Use this route to send a Do Not Calibrate message to the AAT system
config.add_route(
Loading