public final class GoogleComputeEngineTemplateOptions extends TemplateOptions
TemplateOptions.Builder, TemplateOptions.ImmutableTemplateOptionsRunScriptOptions.ImmutableRunScriptOptionsblockUntilRunning, inboundPorts, networks, nodeNames, NONE, privateKey, publicKey, script, securityGroups, tags, userMetadataauthenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript| Constructor and Description |
|---|
GoogleComputeEngineTemplateOptions() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
assignExternalIp()
Gets whether an external IP address should be assigned to the machine.
|
GoogleComputeEngineTemplateOptions |
assignExternalIp(boolean assignExternalIp)
Sets whether an external IP address should be assigned to the machine.
|
GoogleComputeEngineTemplateOptions |
authorizePublicKey(String publicKey)
authorize an rsa ssh key.
|
boolean |
autoCreateKeyPair()
Gets whether an SSH key pair should be created automatically.
|
GoogleComputeEngineTemplateOptions |
autoCreateKeyPair(boolean autoCreateKeyPair)
Sets whether an SSH key pair should be created automatically.
|
Boolean |
autoCreateWindowsPassword()
Whether a Windows password should be created automatically;
null means to generate
the password if and only if the image is for a Windows VM. |
GoogleComputeEngineTemplateOptions |
autoCreateWindowsPassword(Boolean autoCreateWindowsPassword)
Sets whether to auto-create a windows password.
|
GoogleComputeEngineTemplateOptions |
blockOnComplete(boolean blockOnComplete)
As of version 1.1.0, we cannot kick off a script unless a node is in
RUNNING state.
|
GoogleComputeEngineTemplateOptions |
blockOnPort(int port,
int seconds)
When the node is started, wait until the following port is active
|
GoogleComputeEngineTemplateOptions |
blockUntilRunning(boolean blockUntilRunning)
Note
|
String |
bootDiskType()
Gets the boot disk type.
|
GoogleComputeEngineTemplateOptions |
bootDiskType(String diskType)
Sets the boot disk type.
|
GoogleComputeEngineTemplateOptions |
clone() |
void |
copyTo(TemplateOptions to) |
GoogleComputeEngineTemplateOptions |
dontAuthorizePublicKey() |
GoogleComputeEngineTemplateOptions |
inboundPorts(int... ports)
Opens the set of ports to public access.
|
GoogleComputeEngineTemplateOptions |
installPrivateKey(String privateKey)
replaces the rsa ssh key used at login.
|
GoogleComputeEngineTemplateOptions |
nameTask(String name) |
GoogleComputeEngineTemplateOptions |
networks(Iterable<String> networks)
Assigns the created nodes to these networks
|
GoogleComputeEngineTemplateOptions |
networks(String... networks) |
GoogleComputeEngineTemplateOptions |
nodeNames(Iterable<String> nodeNames)
specifies names to be used for the created nodes.
|
GoogleComputeEngineTemplateOptions |
overrideAuthenticateSudo(boolean authenticateSudo) |
GoogleComputeEngineTemplateOptions |
overrideLoginCredentials(LoginCredentials overridingCredentials) |
GoogleComputeEngineTemplateOptions |
overrideLoginPassword(String password) |
GoogleComputeEngineTemplateOptions |
overrideLoginPrivateKey(String privateKey) |
GoogleComputeEngineTemplateOptions |
overrideLoginUser(String loginUser) |
boolean |
preemptible()
Gets whether the resulting instance should be preemptible.
|
GoogleComputeEngineTemplateOptions |
preemptible(boolean preemptible)
Sets whether the resulting instance should be preemptible.
|
GoogleComputeEngineTemplateOptions |
runAsRoot(boolean runAsRoot) |
GoogleComputeEngineTemplateOptions |
runScript(Statement script)
This script will be executed as the root user upon system startup.
|
GoogleComputeEngineTemplateOptions |
runScript(String script)
This script will be executed as the root user upon system startup.
|
List<Instance.ServiceAccount> |
serviceAccounts()
Gets the list of service accounts, with their specified scopes, that will be authorize on created instances.
|
GoogleComputeEngineTemplateOptions |
serviceAccounts(List<Instance.ServiceAccount> serviceAccounts)
Sets a list of service accounts, with their specified scopes, to authorize on created instance.
|
GoogleComputeEngineTemplateOptions |
tags(Iterable<String> tags)
assigns tags to the created nodes
|
GoogleComputeEngineTemplateOptions |
userMetadata(Map<String,String> userMetadata) |
GoogleComputeEngineTemplateOptions |
userMetadata(String key,
String value) |
GoogleComputeEngineTemplateOptions |
wrapInInitScript(boolean wrapInInitScript)
default true
|
as, equals, getGroups, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, hashCode, securityGroups, securityGroups, shouldBlockUntilRunning, stringcopyTo, getLoginPassword, getLoginPrivateKey, getLoginUser, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, overrideLoginPassword, overrideLoginPrivateKey, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript, toStringpublic GoogleComputeEngineTemplateOptions clone()
clone in class TemplateOptionspublic void copyTo(TemplateOptions to)
copyTo in class TemplateOptionspublic GoogleComputeEngineTemplateOptions bootDiskType(String diskType)
public String bootDiskType()
public GoogleComputeEngineTemplateOptions assignExternalIp(boolean assignExternalIp)
public boolean assignExternalIp()
public GoogleComputeEngineTemplateOptions autoCreateKeyPair(boolean autoCreateKeyPair)
public boolean autoCreateKeyPair()
public GoogleComputeEngineTemplateOptions serviceAccounts(List<Instance.ServiceAccount> serviceAccounts)
public GoogleComputeEngineTemplateOptions preemptible(boolean preemptible)
public boolean preemptible()
public Boolean autoCreateWindowsPassword()
null means to generate
the password if and only if the image is for a Windows VM.public GoogleComputeEngineTemplateOptions autoCreateWindowsPassword(Boolean autoCreateWindowsPassword)
null) is to always
do so for Windows VMs, inferring this from the image. An explicit value of true or false
overrides this.public List<Instance.ServiceAccount> serviceAccounts()
public GoogleComputeEngineTemplateOptions blockOnPort(int port, int seconds)
blockOnPort in class TemplateOptionspublic GoogleComputeEngineTemplateOptions inboundPorts(int... ports)
inboundPorts in class TemplateOptionspublic GoogleComputeEngineTemplateOptions authorizePublicKey(String publicKey)
authorizePublicKey in class TemplateOptionspublic GoogleComputeEngineTemplateOptions installPrivateKey(String privateKey)
installPrivateKey in class TemplateOptionspublic GoogleComputeEngineTemplateOptions blockUntilRunning(boolean blockUntilRunning)
TemplateOptions.runScript(Statement) and
RunScriptOptions.blockOnComplete(boolean), as all current
implementations utilize ssh in order to execute scripts.blockUntilRunning in class TemplateOptionsblockUntilRunning - (default true) whether to block until the nodes in this template
are in Status#RUNNING statepublic GoogleComputeEngineTemplateOptions dontAuthorizePublicKey()
dontAuthorizePublicKey in class TemplateOptionspublic GoogleComputeEngineTemplateOptions nameTask(String name)
nameTask in class TemplateOptionsjclouds-script-timestamp where timestamp is millis since
epochpublic GoogleComputeEngineTemplateOptions runAsRoot(boolean runAsRoot)
runAsRoot in class TemplateOptionspublic GoogleComputeEngineTemplateOptions runScript(Statement script)
runScript in class TemplateOptionspublic GoogleComputeEngineTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
overrideLoginCredentials in class TemplateOptionspublic GoogleComputeEngineTemplateOptions overrideLoginPassword(String password)
overrideLoginPassword in class TemplateOptionspublic GoogleComputeEngineTemplateOptions overrideLoginPrivateKey(String privateKey)
overrideLoginPrivateKey in class TemplateOptionspublic GoogleComputeEngineTemplateOptions overrideLoginUser(String loginUser)
overrideLoginUser in class TemplateOptionspublic GoogleComputeEngineTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
overrideAuthenticateSudo in class TemplateOptionspublic GoogleComputeEngineTemplateOptions userMetadata(Map<String,String> userMetadata)
userMetadata in class TemplateOptionsuserMetadata - user-defined metadata to assign to this serverpublic GoogleComputeEngineTemplateOptions userMetadata(String key, String value)
userMetadata in class TemplateOptionskey - key to place into the metadata mapvalue - value to associate with that keypublic GoogleComputeEngineTemplateOptions nodeNames(Iterable<String> nodeNames)
nodeNames in class TemplateOptionspublic GoogleComputeEngineTemplateOptions networks(Iterable<String> networks)
networks in class TemplateOptionspublic GoogleComputeEngineTemplateOptions networks(String... networks)
networks in class TemplateOptionsTemplateOptions.networks(Iterable)public GoogleComputeEngineTemplateOptions tags(Iterable<String> tags)
tags in class TemplateOptionspublic GoogleComputeEngineTemplateOptions wrapInInitScript(boolean wrapInInitScript)
wrapInInitScript in class TemplateOptionswrapInInitScript - if the command is long-running, use this option to ensure it is
wrapInInitScripted properly. (ex. have jclouds wrap it an init
script, nohup, etc)public GoogleComputeEngineTemplateOptions runScript(String script)
runScript in class TemplateOptionspublic GoogleComputeEngineTemplateOptions blockOnComplete(boolean blockOnComplete)
blockOnComplete in class TemplateOptionsblockOnComplete - (default true) false means kick off the script in the
background, but don't wait for it to finish. (as of version
1.1.0, implemented as nohup)Copyright © 2009-2018 The Apache Software Foundation. All Rights Reserved.