auto_process_ngs.cli.transfer_data
- class auto_process_ngs.cli.transfer_data.TransferData(runner, working_dir, poll_interval)
Class for handling workflow for data transfer
Wraps the “SimpleScheduler” class and provides the following methods:
run_job: runs a “Command” instance
wait: blocks until specified jobs (or all jobs) have completed
finish: checks the exit status of all jobs
- Parameters:
runner (JobRunner) – the default job runner to use when executing jobs
working_dir (str) – path to the working directory
poll_interval (int) – polling interval for scheduler
- finish()
Wait for all jobs then check and return status
- Returns:
- status code (0 for success, 1 if any
of the jobs failed).
- Return type:
Integer
- run_job(name, cmd, runner=None, wait_for=None)
Submits the specified command to the scheduler
- Parameters:
name (str) – name for the command
cmd (Command) – the command to run
runner (JobRunner) – optional, job runner to use
wait_for (list) – optional, list of jobs to wait for before scheduling this command
- Returns:
- a SchedulerJob instance for the submitted
job.
- Return type:
- wait(*jobs)
Block until specified jobs have completed.
If one or more jobs are supplied then wait for those jobs to complete before returning; otherwise wait for all jobs currently scheduled to complete.
- Parameters:
jobs (list) – optional list of SchedulerJobs to wait for (otherwise wait for all jobs)
- class auto_process_ngs.cli.transfer_data.TransferDataSchedulerReporter
Custom reporter for scheduler
- auto_process_ngs.cli.transfer_data.get_templates_dir()
Return location of ‘templates’ directory
Returns the path to the ‘templates’ directory, or None if it doesn’t exist.
- auto_process_ngs.cli.transfer_data.main(argv=None)
Run the ‘transfer_data’ utility
- Parameters:
argv (list) – optional, command line arguments to process (otherwise take arguments from ‘sys.argv’)
- Returns:
0 on success, 1 on failure.
- Return type:
Integer