Task class
A task execution require auth, project_id, pipeline_id and inputs
parameters, there are two ways to execute a task, the recommended
way is to use a cascading method to create a project object called
p
then just call p$task_run()
to pass your
parameters. This way you save your time passing auth and
project_id. The other way is to create a Task object with all
required fields and call run
method. Please check example
in the end or tutorial for easy API.
id
[characterORNULL] The task ID number, used when referring to the task in other Seven Bridges API calls
name
[characterORNULL] Name of the task you wish to execute. If this is not specified, the task will be named automatically.
description
[characterORNULL] Description of the task you wish to execute.
pipeline_id
[characterORNULL] ID of the pipeline you wish to execute.
pipeline_revision
[characterORNULL] Revision number of the pipeline you wish to execute. If this is not specified, the latest pipeline revision is used.
start_time
[numericORNULL] start time.
status
[characterORNULL] 1) active: task is currently running. 2) completed: task has finished successfully. 3) aborted: task was aborted by user. 4) failed: task has failed to finish due to either bad inputs and/or parameters, or because of the internal infrastructure failures.
message
[characterORNULL] task message
jobs_completed
[numericORNULL] completed jobs
jobs_total
[numericORNULL] total jobs.
inputs
[listORNULL] required for task execution. List of key-value pairs containing mappings of pipeline input node ID to file IDs. Note that you must supply an array of file IDs for each input nodes, even if the array is empty.
parameters
[listORNULL] required for task execution. List of key-value pairs containing mappings of node IDs to apps specific parameters. Note that you must supply some value for parameters, even if this an empty list of key-value pairs.
project_id
[characterORNULL] required for task execution. ID of the project you want to execute the task in.
token <- "aef7e9e3f6c54fb1b338ac4ecddf1a56" a <- Auth(token) ## A task constructor Task(auth = Auth(token), name = "my task", description = "A text description", pipeline_id = "fake_pipeline_id", project_id = "fake_project_id", inputs = list("177252" = list("fake_id")))#>#>#>#>#>#>#>#>#>#>#>#>#>#># \donttest{ ## replace with real token then follow the examples here ## get billing info b <- a$billing()#> Error: HTTP Status 404: /1.1/billing not foundp <- a$project("API")#> Error: HTTP Status 404: /1.1/project not found## get the pipeline from your project not public one f.pipe <- p$pipeline(name = "FastQC")#> Error in eval(expr, envir, enclos): object 'p' not found## check the inputs needed for running tasks f.pipe$details()#> Error in eval(expr, envir, enclos): object 'f.pipe' not found## Ready to run a task? go f.task <- p$task_run( name = "my task", description = "A text description", pipeline_id = f.pipe$id, inputs = list("177252" = list(f.file$id)))#> Error in eval(expr, envir, enclos): object 'p' not foundf.task$run()#> Error in eval(expr, envir, enclos): object 'f.task' not found## or you can just run with Task constructor f.task <- Task( auth = Auth(token), name = "my task", description = "A text description", pipeline_id = f.pipe$id, project_id = p$id, inputs = list("177252" = list(f.file$id)))#> Error in initRefFields(.self, .refClassDef, as.environment(.self), list(...)): object 'f.pipe' not found## Monitor you task f.task$monitor(30)#> Error in eval(expr, envir, enclos): object 'f.task' not found## download a task output files f.task <- p$task("my task")#> Error in eval(expr, envir, enclos): object 'p' not foundf.task$download("~/Desktop/")#> Error in eval(expr, envir, enclos): object 'f.task' not found## Abort the task f.task$abort()#> Error in eval(expr, envir, enclos): object 'f.task' not found# }