Fetch the quota usage for a project.
fetchUsage(project, registry, url, forceRemote = FALSE)
String containing the project name.
String containing a path to the registry.
String containing the URL to the Gobbler REST API. Only used for remote access.
Logical scalar indicating whether to force remote access via the API,
even if registry
is on the same filesystem as the caller.
Numeric scalar specifying the quota usage for the project, in bytes.
refreshUsage
, to recompute the used quota.
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")
write(file=file.path(src, "whee"), "stuff")
uploadDirectory("test", "simple", "v1", src, staging=info$staging, url=info$url)
# Obtaining the project usage.
fetchUsage("test", registry=info$registry)
#> [1] 10