do_options: Set Digital Ocean options including ssh keys, etc.

Description Usage Arguments Details Examples

View source: R/do_options.R

Description

This function sets options and prints them so you know what options are set.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
do_options(
  size = NULL,
  image = NULL,
  region = NULL,
  ssh_keys = NULL,
  private_networking = NULL,
  backups = NULL,
  ipv6 = NULL,
  unset = FALSE
)

Arguments

size

(optional) A Digital Ocean size slug name, e.g. '1gb'. Saved in options as 'do_size'

image

(optional) A Digital Ocean image name, e.g., 'ubuntu-14-04-x64'. Saved in options as 'do_image'

region

(optional) A Digital Ocean region name, e.g., 'nyc1'. Saved in options as 'do_region'

ssh_keys

(optional) One or more ssh key id numbers or fingerprints. Put many in a list or vector. Saved in options as 'do_ssh_keys'

private_networking

(optional) A logical, whether to use private networking or not. Saved in options as 'do_private_networking'

backups

(optional) A logical, whether to enable backups. Automated backups can only be enabled when the Droplet is created. Saved in options as 'do_backups'

ipv6

(optional) A boolean indicating whether IPv6 is enabled on the Droplet. Saved in options as 'do_ipv6'

unset

(optional) A boolean. If TRUE, unsets options so as to use defaults in droplet_create. If FALSE (default) your options are used in droplet_create.

Details

These options are read and used by droplet_create.

You can only set one value for each of size, image, and region, but multiple values for ssh_keys as you can use multiple ssh keys on one DO droplet.

Keep in mind that there are defaults set for size, image, and region in droplet_create.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
do_options()
do_options(ssh_keys=89103)
getOption('do_ssh_keys')
do_options(size="8gb")
do_options(size="1gb", image='ubuntu-14-04-x64', region='nyc1')
getOption('do_size')
getOption('do_image')
getOption('do_region')

## End(Not run)

Example output

Attaching package: 'analogsea'

The following object is masked from 'package:graphics':

    image

Default options for spinning up a new droplet: 
[size]:      not set (Defaults to: 512mb) 
[image]:     not set (Defaults to: ubuntu-14-04-x64) 
[region]:    not set (Defaults to: sfo1) 
[ssh keys]:  
[private networking] 
[backups]:   
[ipv6]:     Default options for spinning up a new droplet: 
[size]:      not set (Defaults to: 512mb) 
[image]:     not set (Defaults to: ubuntu-14-04-x64) 
[region]:    not set (Defaults to: sfo1) 
[ssh keys]:  89103 
[private networking] 
[backups]:   
[ipv6]:     [1] 89103
Default options for spinning up a new droplet: 
[size]:      8gb 
[image]:     not set (Defaults to: ubuntu-14-04-x64) 
[region]:    not set (Defaults to: sfo1) 
[ssh keys]:  89103 
[private networking] 
[backups]:   
[ipv6]:     Default options for spinning up a new droplet: 
[size]:      1gb 
[image]:     ubuntu-14-04-x64 
[region]:    nyc1 
[ssh keys]:  89103 
[private networking] 
[backups]:   
[ipv6]:     [1] "1gb"
[1] "ubuntu-14-04-x64"
[1] "nyc1"

analogsea documentation built on Nov. 9, 2021, 1:06 a.m.