Fetch the summary for a version of an asset of a project. This will call the REST API if the caller is not on the same filesystem as the registry.

fetchSummary(
  project,
  asset,
  version,
  registry,
  url,
  cache = NULL,
  forceRemote = FALSE,
  overwrite = FALSE
)

Arguments

project

String containing the project name.

asset

String containing the asset name.

version

String containing the version name.

registry

String containing a path to the registry.

url

String containing the URL to the Gobbler REST API. Only used for remote access.

cache

String containing a path to a cache directory. If NULL, an appropriate location is automatically chosen. Only used for remote access.

forceRemote

Logical scalar indicating whether to force remote access. This will download all files in the path via the REST API and cache them locally, even if registry is on the same filesystem as the caller.

overwrite

Logical scalar indicating whether to overwrite the existing cache. Only used for remote access.

Value

List containing the summary for this version, with the following fields:

  • upload_user_id, string containing the identity of the uploader.

  • upload_start, a POSIXct object containing the upload start time.

  • upload_finish, a POSIXct object containing the upload finish time.

  • on_probation (optional), a logical scalar indicating whether the upload is probational. If missing, this can be assumed to be FALSE.

Author

Aaron Lun

Examples

info <- startGobbler()
removeProject("test", info$staging, url=info$url) # start with a clean slate.
createProject("test", info$staging, url=info$url)

# Mocking up an upload. 
src <- allocateUploadDirectory(info$staging)
write(file=file.path(src, "foo"), "BAR")
uploadDirectory("test", "simple", "v1", src, staging=info$staging, url=info$url)

# Obtain a summary for this version.
fetchSummary("test", "simple", "v1", registry=info$registry, url=info$url)
#> $upload_user_id
#> [1] "root"
#> 
#> $upload_start
#> [1] "2024-09-18 15:57:09 UTC"
#> 
#> $upload_finish
#> [1] "2024-09-18 15:57:09 UTC"
#> 

# Force remote access.
fetchSummary(
    "test", 
    "simple", 
    "v1", 
    registry=info$registry, 
    url=info$url, 
    forceRemote=TRUE
)
#> $upload_user_id
#> [1] "root"
#> 
#> $upload_start
#> [1] "2024-09-18 15:57:09 UTC"
#> 
#> $upload_finish
#> [1] "2024-09-18 15:57:09 UTC"
#>