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)

Arguments

project

String specifying the project containing the asset to remove.

asset

String specifying the asset to remove.

staging

String containing the path to the staging directory.

url

String containing the URL of the gobbler REST API.

force

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.

Value

NULL is invisibly returned if the asset was successfully removed.

See also

removeProject and removeVersion, to remove projects and versions respectively.

rerouteLinks, to reroute links to this asset's contents prior to deletion.

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