task_status()
retrieves the status of a task
started by copy()
or transfer()
.
task_cancel()
cancels a task started with
copy()
or transfer()
.
task_list()
retrieves information on all tasks
submitted by the user.
Usage
task_status(.data, all_fields = FALSE)
task_cancel(.data)
task_list(filter = "", orderby = "request_time DESC", all_fields = FALSE)
Arguments
- .data
a
tibble
with columntask_id
, as returned bycopy()
ortransfer()
.- all_fields
logical(1)
indicating whether abbreviated or detailed information about the task status should be returned- filter
character(1) query parameter restricting which tasks are returned by
task_list()
. See details.- orderby
character(1) task list ordering; the default places the most recently requested task at the top.
Value
task_status()
and task_list()
return a tibble
summarizing the
status of the task(s). The meaning of each column is described in the
Globus documentation at
https://docs.globus.org/api/transfer/task/#task_document
With the default value all_fields = FALSE
, the tibble
)
contains columns
task_id
: the id of the task.type
: one ofTRANSFER
orDELETE
.status
: one ofACTIVE
,INACTIVE
,SUCCEEDED
orFAILED
.nice_status
:NULL
for a completed task;OK
orQueued
tasks proceeding normally; or an indication of the reason forACTIVE
orINACTIVE
errors. Examples ofnice_status
indicating transient failure include:PERMISSION_DENIED
if the user does not currently have access to the source or destination resource;CONNECT_FAILED
if the Globus Connect Personal client is not currently on-line;GC_PAUSED
if the client is paused.
task_cancel()
returns its input argument, invisibly.
Details
The input to task_status()
is usually the return value from
copy()
or transfer()
.
task_cancel()
prints a message indicating successful
submission of the task cancellation operation.
For task_list()
, the filter
and orderby
syntax is described at
https://docs.globus.org/api/transfer/task/#filter_and_order_by_options
A simple task list filter is to return all 'ACTIVE' tasks, with filter = "status:ACTIVE"
.
Examples
if (exists("task")) {
## check transfer task status
task_status <- task_status(task)
print(task_status)
## tasks that are failing need to be cancelled
status <- dplyr::pull(task_status, "status")
nice_status <- dplyr::pull(task_status, "nice_status")
cancel <-
## task has failed, or...
identical(status, "FAILED") ||
## ...something's gone wrong
(!is.null(nice_status) && !nice_status %in% c("OK", "Queued"))
if (cancel)
task_cancel(task)
}
task_list()
#> # A tibble: 53 × 5
#> task_id type status nice_status label
#> <chr> <chr> <chr> <lgl> <chr>
#> 1 952b2276-5a74-11ef-a026-9921d9de2129 TRANSFER FAILED NA 2024-08-…
#> 2 91469230-5a74-11ef-a026-9921d9de2129 TRANSFER SUCCEEDED NA 2024-08-…
#> 3 8abd2f3c-5a74-11ef-be9a-83cd94efb466 TRANSFER SUCCEEDED NA 2024-08-…
#> 4 a96d620e-5a73-11ef-9081-a128da25f366 TRANSFER FAILED NA 2024-08-…
#> 5 a57d63ec-5a73-11ef-9081-a128da25f366 TRANSFER SUCCEEDED NA 2024-08-…
#> 6 9dfc2af6-5a73-11ef-a026-9921d9de2129 TRANSFER SUCCEEDED NA 2024-08-…
#> 7 20cf8380-5a66-11ef-a026-9921d9de2129 TRANSFER FAILED NA 2024-08-…
#> 8 1cec4f6e-5a66-11ef-a026-9921d9de2129 TRANSFER SUCCEEDED NA 2024-08-…
#> 9 1625ca66-5a66-11ef-be9a-83cd94efb466 TRANSFER SUCCEEDED NA 2024-08-…
#> 10 9d53aa4a-5a65-11ef-9081-a128da25f366 TRANSFER FAILED NA 2024-08-…
#> # ℹ 43 more rows