Remove a version of an asset of a 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.

removeVersion(project, asset, version, staging, url, force = FALSE)

Arguments

project

String specifying the project containing the version of the asset to remove.

asset

String specifying the asset containing the version to remove.

version

String containing the version of 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 to correct project-level usage statistics. Similarly, refreshLatest may also need to be called.

Value

NULL is invisibly returned if the version was successfully removed.

See also

removeProject and removeAsset, to remove a project or asset.

rerouteLinks, to reroute links to this version'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 a version if it doesn't already exist.
src <- allocateUploadDirectory(info$staging)
write(file=file.path(src, "foo"), "BAR")
uploadDirectory("test", "simple", "v1", src, staging=info$staging, url=info$url)
listVersions("test", "simple", registry=info$registry)
#> [1] "v1"

# Removing the version.
removeVersion("test", "simple", "v1", staging=info$staging, url=info$url)
listVersions("test", "simple", registry=info$registry)
#> character(0)