droplet_create {analogsea} | R Documentation |
Create a new droplet.
Description
There are defaults for each of size, image, and region so that a quick one-liner with one parameter is possible: simply specify the name of the droplet and your'e up and running.
Usage
droplet_create(
name = random_name(),
size = getOption("do_size", "s-1vcpu-1gb"),
image = getOption("do_image", "ubuntu-18-04-x64"),
region = getOption("do_region", "sfo3"),
ssh_keys = getOption("do_ssh_keys", NULL),
backups = getOption("do_backups", NULL),
ipv6 = getOption("do_ipv6", NULL),
private_networking = getOption("do_private_networking", NULL),
tags = list(),
user_data = NULL,
cloud_config = NULL,
wait = TRUE,
...
)
Arguments
name |
(character) Name of the droplet. The human-readable string you
wish to use when displaying the Droplet name. The name, if set to a domain
name managed in the DigitalOcean DNS management system, will configure a
PTR record for the Droplet. The name set during creation will also
determine the hostname for the Droplet in its internal configuration.
Default: picks a random name from |
size |
(character) Size slug identifier. See |
image |
(character/numeric) The image ID of a public or private image,
or the unique slug identifier for a public image. This image will be the
base image for your droplet. See |
region |
(character) The unique slug identifier for the region that you
wish to deploy in. See |
ssh_keys |
(character) A character vector of key names, an integer
vector of key ids, or NULL, to use all keys in your account. Accounts
with the corresponding private key will be able to log in to the droplet.
See |
backups |
(logical) Enable backups. A boolean indicating whether automated backups should be enabled for the droplet. Automated backups can only be enabled when the droplet is created, and cost extra. Default: FALSE |
ipv6 |
(logical) A boolean indicating whether IPv6 is enabled on the droplet. |
private_networking |
(logical) Use private networking. Private
networking is currently only available in certain regions.
Default: |
tags |
(character) A vector of tag names to apply to the Droplet after it is created. Tag names can either be existing or new tags. Default: list() |
user_data |
(character) Gets passed to the droplet at boot time. Not all regions have this enabled, and is not used by all images. |
cloud_config |
(character) Specify the name of a cloud config template
to automatically generate |
wait |
If |
... |
Additional options passed down to |
Details
Note that if you exit the R session or kill the function call after it's in waiting process (the string of ...), the droplet creation will continue.
Value
A droplet object
Missing droplet ID
If you get a droplet object back without an IP address, the IP
address was not assigned when the payload was returned by DigitalOcean.
Simply run d <- droplet(d$id)
to update your droplet object and the IP
address will populate.
Examples
## Not run:
# by default we give your droplet a name
droplet_create()
# you can set your own droplet name
droplet_create('droppinit')
# set name, size, image, and region
droplet_create(name="newdrop", size = '512mb', image = 'ubuntu-14-04-x64',
region = 'sfo3')
# use an ssh key
droplet_create(ssh_keys=89103)
# add tags
(d <- droplet_create(tags = c('venus', 'mars')))
summary(d)
## End(Not run)