Fetch the quota usage for a project.

fetchUsage(project, registry, url, forceRemote = FALSE)

Arguments

project

String containing the project name.

registry

String containing a path to the registry.

url

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

forceRemote

Logical scalar indicating whether to force remote access via the API, even if registry is on the same filesystem as the caller.

Value

Numeric scalar specifying the quota usage for the project, in bytes.

See also

refreshUsage, to recompute the used quota.

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")
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