public final class GoogleComputeEngineTemplateOptions extends TemplateOptions
TemplateOptions.Builder, TemplateOptions.ImmutableTemplateOptions
RunScriptOptions.ImmutableRunScriptOptions
blockUntilRunning, inboundPorts, networks, nodeNames, NONE, privateKey, publicKey, script, securityGroups, tags, userMetadata
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
Constructor and Description |
---|
GoogleComputeEngineTemplateOptions() |
Modifier and Type | Method and Description |
---|---|
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, string
copyTo, getLoginPassword, getLoginPrivateKey, getLoginUser, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, overrideLoginPassword, overrideLoginPrivateKey, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript, toString
public GoogleComputeEngineTemplateOptions clone()
clone
in class TemplateOptions
public void copyTo(TemplateOptions to)
copyTo
in class TemplateOptions
public GoogleComputeEngineTemplateOptions bootDiskType(String diskType)
public String bootDiskType()
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 TemplateOptions
public GoogleComputeEngineTemplateOptions inboundPorts(int... ports)
inboundPorts
in class TemplateOptions
public GoogleComputeEngineTemplateOptions authorizePublicKey(String publicKey)
authorizePublicKey
in class TemplateOptions
public GoogleComputeEngineTemplateOptions installPrivateKey(String privateKey)
installPrivateKey
in class TemplateOptions
public 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 TemplateOptions
blockUntilRunning
- (default true) whether to block until the nodes in this template
are in Status#RUNNING
statepublic GoogleComputeEngineTemplateOptions dontAuthorizePublicKey()
dontAuthorizePublicKey
in class TemplateOptions
public GoogleComputeEngineTemplateOptions nameTask(String name)
nameTask
in class TemplateOptions
jclouds-script-timestamp
where timestamp is millis since
epochpublic GoogleComputeEngineTemplateOptions runAsRoot(boolean runAsRoot)
runAsRoot
in class TemplateOptions
public GoogleComputeEngineTemplateOptions runScript(Statement script)
runScript
in class TemplateOptions
public GoogleComputeEngineTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
overrideLoginCredentials
in class TemplateOptions
public GoogleComputeEngineTemplateOptions overrideLoginPassword(String password)
overrideLoginPassword
in class TemplateOptions
public GoogleComputeEngineTemplateOptions overrideLoginPrivateKey(String privateKey)
overrideLoginPrivateKey
in class TemplateOptions
public GoogleComputeEngineTemplateOptions overrideLoginUser(String loginUser)
overrideLoginUser
in class TemplateOptions
public GoogleComputeEngineTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
overrideAuthenticateSudo
in class TemplateOptions
public GoogleComputeEngineTemplateOptions userMetadata(Map<String,String> userMetadata)
userMetadata
in class TemplateOptions
userMetadata
- user-defined metadata to assign to this serverpublic GoogleComputeEngineTemplateOptions userMetadata(String key, String value)
userMetadata
in class TemplateOptions
key
- key to place into the metadata mapvalue
- value to associate with that keypublic GoogleComputeEngineTemplateOptions nodeNames(Iterable<String> nodeNames)
nodeNames
in class TemplateOptions
public GoogleComputeEngineTemplateOptions networks(Iterable<String> networks)
networks
in class TemplateOptions
public GoogleComputeEngineTemplateOptions networks(String... networks)
networks
in class TemplateOptions
TemplateOptions.networks(Iterable)
public GoogleComputeEngineTemplateOptions tags(Iterable<String> tags)
tags
in class TemplateOptions
public GoogleComputeEngineTemplateOptions wrapInInitScript(boolean wrapInInitScript)
wrapInInitScript
in class TemplateOptions
wrapInInitScript
- 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 TemplateOptions
public GoogleComputeEngineTemplateOptions blockOnComplete(boolean blockOnComplete)
blockOnComplete
in class TemplateOptions
blockOnComplete
- (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-2016 The Apache Software Foundation. All Rights Reserved.