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.ImmutableTemplateOptions
Nested 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, userMetadata
Fields 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 TypeMethodDescriptionboolean
Gets 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.boolean
Gets 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;invalid @link
{@link null
autoCreateWindowsPassword
(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()
void
inboundPorts
(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) boolean
Gets 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, string
Methods 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:
clone
in classTemplateOptions
-
copyTo
- Overrides:
copyTo
in 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;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:
blockOnPort
in classTemplateOptions
-
inboundPorts
Opens the set of ports to public access.- Overrides:
inboundPorts
in classTemplateOptions
-
authorizePublicKey
authorize an rsa ssh key.- Overrides:
authorizePublicKey
in classTemplateOptions
-
installPrivateKey
replaces the rsa ssh key used at login.- Overrides:
installPrivateKey
in 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:
blockUntilRunning
in classTemplateOptions
- Parameters:
blockUntilRunning
- (default true) whether to block until the nodes in this template are ininvalid reference
Status#RUNNING
-
dontAuthorizePublicKey
- Overrides:
dontAuthorizePublicKey
in classTemplateOptions
-
nameTask
- Overrides:
nameTask
in classTemplateOptions
- Returns:
- What to call the task relating to this script; default
jclouds-script-timestamp
where timestamp is millis since epoch
-
runAsRoot
- Overrides:
runAsRoot
in 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:
runScript
in classTemplateOptions
-
overrideLoginCredentials
public GoogleComputeEngineTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials) - Overrides:
overrideLoginCredentials
in classTemplateOptions
-
overrideLoginPassword
- Overrides:
overrideLoginPassword
in classTemplateOptions
-
overrideLoginPrivateKey
- Overrides:
overrideLoginPrivateKey
in classTemplateOptions
-
overrideLoginUser
- Overrides:
overrideLoginUser
in classTemplateOptions
-
overrideAuthenticateSudo
- Overrides:
overrideAuthenticateSudo
in classTemplateOptions
-
userMetadata
- Overrides:
userMetadata
in classTemplateOptions
- Parameters:
userMetadata
- user-defined metadata to assign to this server
-
userMetadata
- Overrides:
userMetadata
in 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:
nodeNames
in classTemplateOptions
-
networks
Assigns the created nodes to these networks- Overrides:
networks
in classTemplateOptions
-
networks
- Overrides:
networks
in classTemplateOptions
- See Also:
-
tags
assigns tags to the created nodes- Overrides:
tags
in classTemplateOptions
-
wrapInInitScript
default true- Overrides:
wrapInInitScript
in 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:
runScript
in classTemplateOptions
-
blockOnComplete
As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.- Overrides:
blockOnComplete
in 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)
-