retrieve a snapshot
list snapshots, all, droplets, or volumes
delete a snapshot
as.snapshot(x)
snapshots(type = NULL, ...)
snapshot(id, ...)
snapshot_delete(snapshot, ...)
Object to coerce to an snapshot
(character) NULL
(all snapshots), or one of droplet
(droplet snapshots) or volume (volume snapshots)
A snapshot id (varies depending on droplet or volume ID)
A snapshot, or something that can be coerced to a snapshot by
as.snapshot
.
if (FALSE) {
# list all snapshots
(res <- snapshots())
# list droplet snapshots
snapshots(type = "droplet")
# list volume snapshots
snapshots(type = "volume")
# get a single snapshot
snapshot(res[[1]]$id)
# delete a snapshot
## a whole snapshot class object
snapshot_delete(res[[2]])
## by id
snapshot_delete(res[[2]]$id)
## by name
snapshot_delete(res[[2]]$name)
# delete many snapshots
lapply(snapshots(), snapshot_delete)
}