Remove an asset of the project from the registry.
This should only be performed by Gobbler instance administrators,
who should consider running rerouteLinks
beforehand to avoid dangling references to this version.
removeAsset(project, asset, staging, url, force = FALSE)
String specifying the project containing the asset to remove.
String specifying the asset to remove.
String containing the path to the staging directory.
String containing the URL of the gobbler REST API.
Logical scalar indicating that the asset should be forcibly removed if it contains invalid files.
If this needs to be set to TRUE
, users may need to call refreshUsage
afterwards to correct project-level usage statistics.
NULL
is invisibly returned if the asset was successfully removed.
removeProject
and removeVersion
, to remove projects and versions respectively.
rerouteLinks
, to reroute links to this asset's contents prior to deletion.
info <- startGobbler()
removeProject("test", info$staging, url=info$url) # start with a clean slate.
createProject("test", info$staging, url=info$url)
# Mocking up an asset so we have something to remove.
src <- allocateUploadDirectory(info$staging)
write(file=file.path(src, "foo"), "BAR")
uploadDirectory("test", "simple", "v1", src, staging=info$staging, url=info$url)
listAssets("test", registry=info$registry)
#> [1] "simple"
# Removing the asset.
removeAsset("test", "simple", staging=info$staging, url=info$url)
listAssets("test", registry=info$registry)
#> character(0)