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

snapshot(id, ...)

snapshot_delete(snapshot, ...)

Arguments

x

Object to coerce to an snapshot

type

(character) NULL (all snapshots), or one of droplet (droplet snapshots) or volume (volume snapshots)

...

Additional options passed down to GET, POST, etc.

id

A snapshot id (varies depending on droplet or volume ID)

snapshot

A snapshot, or something that can be coerced to a snapshot by as.snapshot.

Examples

## Not run: 
# 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)

## End(Not run)

[Package analogsea version 1.0.0 Index]