Description Usage Arguments Details Value Creation logic Examples
Pass in the instance name to fetch its object, or create the instance via gce_vm_create.
1 2 | gce_vm(name, ..., project = gce_get_global_project(),
zone = gce_get_global_zone(), open_webports = TRUE)
|
name |
The name of the instance |
... |
Arguments passed on to
|
project |
Project ID for this request |
zone |
The name of the zone for this request |
open_webports |
If TRUE, will open firewall ports 80 and 443 if not open already |
Will get or create the instance as specified. Will wait for instance to be created if necessary.
Make sure the instance is big enough to handle what you need,
for instance the default f1-micro
will hang the instance when trying to install large R libraries.
A gce_instance
object
You need these parameters defined to call the right function for creation. Check the function definitions for more details.
If the VM name exists but is not running, it start the VM and return the VM object
If the VM is running, it will return the VM object
If you specify the argument template
it will call gce_vm_template
If you specify one of file
or cloud_init
it will call gce_vm_container
Otherwise it will call gce_vm_create
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## Not run:
library(googleComputeEngineR)
## auto auth, project and zone pre-set
## list your VMs in the project/zone
the_list <- gce_list_instances()
## start an existing instance
vm <- gce_vm("markdev")
## for rstudio, you also need to specify a username and password to login
vm <- gce_vm(template = "rstudio",
name = "rstudio-server",
username = "mark", password = "mark1234")
## specify your own cloud-init file and pass it into gce_vm_container()
vm <- gce_vm(cloud_init = "example.yml",
name = "test-container",
predefined_type = "f1-micro")
## specify disk size at creation
vm <- gce_vm('my-image3', disk_size_gb = 20)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.