View source: R/databases.R View source: R/databases.R
databases | R Documentation |
get a single database
list databases
create a database
create a snapshot of a database
list snapshots for a database
delete a database
databases(...) as.database(x) databases(...) database(database, ...) database_create( name, size, description = NULL, region = "nyc1", snapshot_id = NULL, engine = NULL, tags = NULL, ... ) database_snapshot_create(database, name, ...) database_snapshots(database, ...) database_delete(database, ...)
... |
Additional options passed down to |
x |
Object to coerce to an database |
database |
A database, or something that can be coerced to a database by
|
name |
(character) Name of the new database. required. |
size |
(integer) The size of the Block Storage database in GiB |
description |
(character) An optional free-form text field to describe a Block Storage database. |
region |
(character) The region where the Block Storage database will be created. When setting a region, the value should be the slug identifier for the region. When you query a Block Storage database, the entire region object will be returned. Should not be specified with a snapshot_id. Default: nyc1 |
snapshot_id |
(integer) The unique identifier for the database snapshot from which to create the database. Should not be specified with a region_id. |
engine |
(character) The name of the engine type to be used on the database. When provided, the database will be created with the specified backend type. Currently, the available options are "pg", "mysql", "redis" and "mongodb". |
tags |
(character) tag names to apply to the database after it is created. Tag names can either be existing or new tags. |
note that if you delete a database, and it has a snapshot, the snapshot still exists, so beware
A data.frame with available databases (RAM, disk, no. CPU's) and their costs
## Not run: databases() ## End(Not run) ## Not run: # list databases databases() # create a database vol1 <- database_create('testing', 5) vol2 <- database_create('foobar', 6, tags = c('stuff', 'things')) # create snapshot of a database xx <- database_snapshot_create(vol2, "howdy") # list snaphots for a database database_snapshots(xx) # list databases again res <- databases() # get a single database ## a whole database class object database(res$testing) ## by id database(res[[1]]$id) ## by name database(res[[1]]$name) # delete a database ## a whole database class object database_delete(res$testing) ## by id database_delete(res[[1]]$id) ## by name database_delete(res[[1]]$name) # delete many databases lapply(databases(), database_delete) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.