Class GoogleComputeEngineTemplateOptions
java.lang.Object
org.jclouds.compute.options.RunScriptOptions
org.jclouds.compute.options.TemplateOptions
org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions
- All Implemented Interfaces:
Cloneable
Instance options specific to Google Compute Engine.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jclouds.compute.options.TemplateOptions
TemplateOptions.Builder, TemplateOptions.ImmutableTemplateOptionsNested classes/interfaces inherited from class org.jclouds.compute.options.RunScriptOptions
RunScriptOptions.ImmutableRunScriptOptions -
Field Summary
Fields inherited from class org.jclouds.compute.options.TemplateOptions
blockUntilRunning, inboundPorts, networks, nodeNames, NONE, privateKey, publicKey, script, securityGroups, tags, userMetadataFields inherited from class org.jclouds.compute.options.RunScriptOptions
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets whether an external IP address should be assigned to the machine.assignExternalIp(boolean assignExternalIp) Sets whether an external IP address should be assigned to the machine.authorizePublicKey(String publicKey) authorize an rsa ssh key.booleanGets whether an SSH key pair should be created automatically.autoCreateKeyPair(boolean autoCreateKeyPair) Sets whether an SSH key pair should be created automatically.Whether a Windows password should be created automatically;} means to generate the password if and only if the image is for a Windows VM.invalid @link
{@link nullautoCreateWindowsPassword(Boolean autoCreateWindowsPassword) Sets whether to auto-create a windows password.blockOnComplete(boolean blockOnComplete) As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.blockOnPort(int port, int seconds) When the node is started, wait until the following port is activeblockUntilRunning(boolean blockUntilRunning) NoteGets the boot disk type.bootDiskType(String diskType) Sets the boot disk type.clone()voidinboundPorts(int... ports) Opens the set of ports to public access.installPrivateKey(String privateKey) replaces the rsa ssh key used at login.Assigns the created nodes to these networksspecifies names to be used for the created nodes.overrideAuthenticateSudo(boolean authenticateSudo) overrideLoginCredentials(LoginCredentials overridingCredentials) overrideLoginPassword(String password) overrideLoginPrivateKey(String privateKey) overrideLoginUser(String loginUser) booleanGets whether the resulting instance should be preemptible.preemptible(boolean preemptible) Sets whether the resulting instance should be preemptible.runAsRoot(boolean runAsRoot) This script will be executed as the root user upon system startup.This script will be executed as the root user upon system startup.Gets the list of service accounts, with their specified scopes, that will be authorize on created instances.serviceAccounts(List<Instance.ServiceAccount> serviceAccounts) Sets a list of service accounts, with their specified scopes, to authorize on created instance.assigns tags to the created nodesuserMetadata(String key, String value) userMetadata(Map<String, String> userMetadata) wrapInInitScript(boolean wrapInInitScript) default trueMethods inherited from class org.jclouds.compute.options.TemplateOptions
as, equals, getGroups, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, hashCode, securityGroups, securityGroups, shouldBlockUntilRunning, stringMethods inherited from class org.jclouds.compute.options.RunScriptOptions
copyTo, getLoginPassword, getLoginPrivateKey, getLoginUser, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, overrideLoginPassword, overrideLoginPrivateKey, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript, toString
-
Constructor Details
-
GoogleComputeEngineTemplateOptions
public GoogleComputeEngineTemplateOptions()
-
-
Method Details
-
clone
- Overrides:
clonein classTemplateOptions
-
copyTo
- Overrides:
copyToin classTemplateOptions
-
bootDiskType
Sets the boot disk type. -
bootDiskType
Gets the boot disk type. -
assignExternalIp
Sets whether an external IP address should be assigned to the machine. -
assignExternalIp
public boolean assignExternalIp()Gets whether an external IP address should be assigned to the machine. -
autoCreateKeyPair
Sets whether an SSH key pair should be created automatically. -
autoCreateKeyPair
public boolean autoCreateKeyPair()Gets whether an SSH key pair should be created automatically. -
serviceAccounts
public GoogleComputeEngineTemplateOptions serviceAccounts(List<Instance.ServiceAccount> serviceAccounts) Sets a list of service accounts, with their specified scopes, to authorize on created instance. For example, to give a node the 'compute' scope you would add a service account with the email 'default' and the scope 'https://www.googleapis.com/auth/compute' These scopes will be given to all nodes created with these template options. -
preemptible
Sets whether the resulting instance should be preemptible. -
preemptible
public boolean preemptible()Gets whether the resulting instance should be preemptible. -
autoCreateWindowsPassword
Whether a Windows password should be created automatically;} means to generate the password if and only if the image is for a Windows VM.invalid @link
{@link null -
autoCreateWindowsPassword
public GoogleComputeEngineTemplateOptions autoCreateWindowsPassword(Boolean autoCreateWindowsPassword) Sets whether to auto-create a windows password. The default (null) is to always do so for Windows VMs, inferring this from the image. An explicit value of true or false overrides this. -
serviceAccounts
Gets the list of service accounts, with their specified scopes, that will be authorize on created instances. -
blockOnPort
When the node is started, wait until the following port is active- Overrides:
blockOnPortin classTemplateOptions
-
inboundPorts
Opens the set of ports to public access.- Overrides:
inboundPortsin classTemplateOptions
-
authorizePublicKey
authorize an rsa ssh key.- Overrides:
authorizePublicKeyin classTemplateOptions
-
installPrivateKey
replaces the rsa ssh key used at login.- Overrides:
installPrivateKeyin classTemplateOptions
-
blockUntilRunning
Note
As of version 1.1.0, this option is incompatible withTemplateOptions.runScript(Statement)andRunScriptOptions.blockOnComplete(boolean), as all current implementations utilize ssh in order to execute scripts.- Overrides:
blockUntilRunningin classTemplateOptions- Parameters:
blockUntilRunning- (default true) whether to block until the nodes in this template are instateinvalid reference
Status#RUNNING
-
dontAuthorizePublicKey
- Overrides:
dontAuthorizePublicKeyin classTemplateOptions
-
nameTask
- Overrides:
nameTaskin classTemplateOptions- Returns:
- What to call the task relating to this script; default
jclouds-script-timestampwhere timestamp is millis since epoch
-
runAsRoot
- Overrides:
runAsRootin classTemplateOptions
-
runScript
This script will be executed as the root user upon system startup. This script gets a prologue, so no #!/bin/bash required, path set up, etc- Overrides:
runScriptin classTemplateOptions
-
overrideLoginCredentials
public GoogleComputeEngineTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials) - Overrides:
overrideLoginCredentialsin classTemplateOptions
-
overrideLoginPassword
- Overrides:
overrideLoginPasswordin classTemplateOptions
-
overrideLoginPrivateKey
- Overrides:
overrideLoginPrivateKeyin classTemplateOptions
-
overrideLoginUser
- Overrides:
overrideLoginUserin classTemplateOptions
-
overrideAuthenticateSudo
- Overrides:
overrideAuthenticateSudoin classTemplateOptions
-
userMetadata
- Overrides:
userMetadatain classTemplateOptions- Parameters:
userMetadata- user-defined metadata to assign to this server
-
userMetadata
- Overrides:
userMetadatain classTemplateOptions- Parameters:
key- key to place into the metadata mapvalue- value to associate with that key
-
nodeNames
specifies names to be used for the created nodes. Note that this does not guarantee uniqueness - if there are already existing nodes with a name specified here, there will still be a new node created with the same name. Also, if more nodes are to be created than there are names, subsequent names will use the default naming strategy for that cloud.- Overrides:
nodeNamesin classTemplateOptions
-
networks
Assigns the created nodes to these networks- Overrides:
networksin classTemplateOptions
-
networks
- Overrides:
networksin classTemplateOptions- See Also:
-
tags
assigns tags to the created nodes- Overrides:
tagsin classTemplateOptions
-
wrapInInitScript
default true- Overrides:
wrapInInitScriptin classTemplateOptions- Parameters:
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)- Returns:
-
runScript
This script will be executed as the root user upon system startup. This script gets a prologue, so no #!/bin/bash required, path set up, etc- Overrides:
runScriptin classTemplateOptions
-
blockOnComplete
As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.- Overrides:
blockOnCompletein classTemplateOptions- Parameters:
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)
-