as.snapshot {analogsea} | R Documentation |
Snapshot operations
Description
- snapshot
retrieve a snapshot
- snapshots
list snapshots, all, droplets, or volumes
- snapshot_delete
delete a snapshot
Usage
as.snapshot(x)
snapshots(type = NULL, page = 1, per_page = 20, ...)
snapshot(id, ...)
snapshot_delete(snapshot, ...)
Arguments
x |
Object to coerce to an snapshot |
type |
(character) |
page |
Which 'page' of paginated results to return (default 1). |
per_page |
Number of items returned per page (default 20, maximum 200) |
... |
|
id |
A snapshot id (varies depending on droplet or volume ID) |
snapshot |
A snapshot, or something that can be coerced to a snapshot by
|
Examples
## Not run:
# list all snapshots
(res <- snapshots())
# list droplet snapshots
snapshots(type = "droplet")
# list volume snapshots
snapshots(type = "volume")
# paging
snapshots(per_page = 5)
snapshots(per_page = 5, page = 2)
# 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)
## End(Not run)
[Package analogsea version 1.0.7.2 Index]