gce_set_metadata: Sets metadata for the specified instance or projectwise to...

Description Usage Arguments Details See Also Examples

Description

Set, change and append metadata for an instance.

Usage

1
2
gce_set_metadata(metadata, instance, project = gce_get_global_project(),
  zone = gce_get_global_zone())

Arguments

metadata

A named list of metadata key/value pairs to assign to this instance

instance

Name of the instance scoping this request. If "project-wide" will set the metadata project wide, available to all instances

project

Project ID for this request, default as set by gce_get_global_project

zone

The name of the zone for this request, default as set by gce_get_global_zone

Details

Authentication scopes used by this function are:

To append to existing metadata passed a named list.

To change existing metadata pass a named list with the same key and modified value you will change.

To delete metadata pass an empty string "" with the same key

See Also

Google Documentation

Other Metadata functions: Metadata

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
 # Use "project-wide" to set "enable-oslogin" = "TRUE" to take advantage of OS Login.
 # But you won't be able to login via SSH if you do
 gce_set_metadata(list("enable-oslogin" = "TRUE"), instance = "project-wide")
 
 # enable google logging
 gce_set_metadata(list("google-logging-enabled"="True"), instance = "project-wide")

## End(Not run)
 

googleComputeEngineR documentation built on May 6, 2019, 1:01 a.m.