Skip to content
Snippets Groups Projects
Commit 217abd4a authored by Vermaat's avatar Vermaat
Browse files

Optional email for batch jobs from webservices

parent 1d03cfa0
No related branches found
No related tags found
No related merge requests found
...@@ -71,14 +71,20 @@ class MutalyzerService(ServiceBase): ...@@ -71,14 +71,20 @@ class MutalyzerService(ServiceBase):
super(MutalyzerService, self).__init__(environ) super(MutalyzerService, self).__init__(environ)
#__init__ #__init__
@srpc(Mandatory.ByteArray, Unicode, Unicode, _returns=Unicode) @srpc(Mandatory.ByteArray, Unicode, Unicode, Unicode, _returns=Unicode)
def submitBatchJob(data, process='NameChecker', argument=''): def submitBatchJob(data, process='NameChecker', argument='', email=None):
""" """
Submit a batch job. Submit a batch job.
Input and output file formats for batch jobs are explained on the Input and output file formats for batch jobs are explained on the
website <https://mutalyzer.nl/batch>. website <https://mutalyzer.nl/batch>.
Batch jobs are processed using round-robin scheduling grouped by email
address. Per email address, jobs are processed sequentially in order
of submission. Jobs with no email address specified end up in a shared
group. This means your job is likely to be processed sooner if you
provide an email address.
On error an exception is raised: On error an exception is raised:
- detail: Human readable description of the error. - detail: Human readable description of the error.
- faultstring: A code to indicate the type of error. - faultstring: A code to indicate the type of error.
...@@ -90,6 +96,8 @@ class MutalyzerService(ServiceBase): ...@@ -90,6 +96,8 @@ class MutalyzerService(ServiceBase):
(default), SyntaxChecker, PositionConverter, SnpConverter. (default), SyntaxChecker, PositionConverter, SnpConverter.
@arg argument: Additional argument. Currently only used if batch_type @arg argument: Additional argument. Currently only used if batch_type
is PositionConverter, denoting the human genome build. is PositionConverter, denoting the human genome build.
@arg email: Optional email address. Notification of job completion
will be sent to this address.
@return: Batch job identifier. @return: Batch job identifier.
""" """
...@@ -139,7 +147,7 @@ class MutalyzerService(ServiceBase): ...@@ -139,7 +147,7 @@ class MutalyzerService(ServiceBase):
if job is None: if job is None:
raise Fault('EPARSE', 'Could not parse input file, please check your file format.') raise Fault('EPARSE', 'Could not parse input file, please check your file format.')
result_id = scheduler.addJob('job@webservice', job, columns, result_id = scheduler.addJob(email or 'job@webservice', job, columns,
batch_types[process], argument) batch_types[process], argument)
return result_id return result_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment