toil.server.wes.abstract_backend
¶
Module Contents¶
Classes¶
A class to represent a GA4GH Workflow Execution Service (WES) API backend. |
Functions¶
|
This decorator catches errors from the wrapped function and returns a JSON |
Attributes¶
- toil.server.wes.abstract_backend.logger¶
- toil.server.wes.abstract_backend.TaskLog¶
- exception toil.server.wes.abstract_backend.VersionNotImplementedException(wf_type, version=None, supported_versions=None)¶
Bases:
digraph inheritance86a81c09d0 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "VersionNotImplementedException" [URL="#toil.server.wes.abstract_backend.VersionNotImplementedException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Raised when the requested workflow version is not implemented."]; }Exception
Raised when the requested workflow version is not implemented.
- exception toil.server.wes.abstract_backend.MalformedRequestException(message)¶
Bases:
digraph inheritance6d7abd4296 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "MalformedRequestException" [URL="#toil.server.wes.abstract_backend.MalformedRequestException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Raised when the request is malformed."]; }Exception
Raised when the request is malformed.
- Parameters:
message (str) –
- exception toil.server.wes.abstract_backend.WorkflowNotFoundException¶
Bases:
digraph inheritancecf3e939240 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "WorkflowNotFoundException" [URL="#toil.server.wes.abstract_backend.WorkflowNotFoundException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Raised when the requested run ID is not found."]; }Exception
Raised when the requested run ID is not found.
- exception toil.server.wes.abstract_backend.WorkflowConflictException(run_id)¶
Bases:
digraph inheritance504b933b05 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "WorkflowConflictException" [URL="#toil.server.wes.abstract_backend.WorkflowConflictException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Raised when the requested workflow is not in the expected state."]; }Exception
Raised when the requested workflow is not in the expected state.
- Parameters:
run_id (str) –
- exception toil.server.wes.abstract_backend.OperationForbidden(message)¶
Bases:
digraph inheritancee0ebc7b1d3 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "OperationForbidden" [URL="#toil.server.wes.abstract_backend.OperationForbidden",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Raised when the request is forbidden."]; }Exception
Raised when the request is forbidden.
- Parameters:
message (str) –
- exception toil.server.wes.abstract_backend.WorkflowExecutionException(message)¶
Bases:
digraph inheritance5b56d64636 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "WorkflowExecutionException" [URL="#toil.server.wes.abstract_backend.WorkflowExecutionException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Raised when an internal error occurred during the execution of the workflow."]; }Exception
Raised when an internal error occurred during the execution of the workflow.
- Parameters:
message (str) –
- toil.server.wes.abstract_backend.handle_errors(func)¶
This decorator catches errors from the wrapped function and returns a JSON formatted error message with the appropriate status code defined by the GA4GH WES spec.
- Parameters:
func (Callable[Ellipsis, Any]) –
- Return type:
Callable[Ellipsis, Any]
- class toil.server.wes.abstract_backend.WESBackend(options)¶
A class to represent a GA4GH Workflow Execution Service (WES) API backend. Intended to be inherited. Subclasses should implement all abstract methods to handle user requests when they hit different endpoints.
- Parameters:
options (List[str]) –
- resolve_operation_id(operation_id)¶
Map an operationId defined in the OpenAPI or swagger yaml file to a function.
- Parameters:
operation_id (str) – The operation ID defined in the specification.
- Returns:
A function that should be called when the given endpoint is reached.
- Return type:
Any
- abstract get_service_info()¶
Get information about the Workflow Execution Service.
GET /service-info
- Return type:
Dict[str, Any]
- abstract list_runs(page_size=None, page_token=None)¶
List the workflow runs.
GET /runs
- abstract run_workflow()¶
Run a workflow. This endpoint creates a new workflow run and returns a RunId to monitor its progress.
POST /runs
- abstract get_run_log(run_id)¶
Get detailed info about a workflow run.
GET /runs/{run_id}
- abstract cancel_run(run_id)¶
Cancel a running workflow.
POST /runs/{run_id}/cancel
- abstract get_run_status(run_id)¶
Get quick status info about a workflow run, returning a simple result with the overall state of the workflow run.
GET /runs/{run_id}/status
- static log_for_run(run_id, message)¶
- collect_attachments(run_id, temp_dir)¶
Collect attachments from the current request by staging uploaded files to temp_dir, and return the temp_dir and parsed body of the request.