# NOT RUN {
# list volumes
volumes()
# create a volume
vol1 <- volume_create('testing', 5)
vol2 <- volume_create('foobar', 6)
# create snapshot of a volume
xx <- volume_snapshot_create(vol2, "howdy")
# list snaphots for a volume
volume_snapshots(xx)
# list volumes again
res <- volumes()
# get a single volume
## a whole volume class object
volume(res$testing)
## by id
volume(res[[1]]$id)
## by name
volume(res[[1]]$name)
# delete a volume
## a whole volume class object
volume_delete(res$testing)
## by id
volume_delete(res[[1]]$id)
## by name
volume_delete(res[[1]]$name)
# delete many volumes
lapply(volumes(), volume_delete)
# }
Run the code above in your browser using DataCamp Workspace