Package org.jclouds.compute.options
Class TemplateOptions.ImmutableTemplateOptions
java.lang.Object
org.jclouds.compute.options.RunScriptOptions
org.jclouds.compute.options.TemplateOptions
org.jclouds.compute.options.TemplateOptions.ImmutableTemplateOptions
- All Implemented Interfaces:
Cloneable
- Enclosing class:
TemplateOptions
-
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 TypeMethodDescription<T extends TemplateOptions>
TauthorizePublicKey
(String publicKey) authorize an rsa ssh key.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) unsupported as objects of this class are immutableclone()
void
int[]
int
getPort()
int
getTags()
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) runAsRoot
(boolean runAsRoot) unsupported as objects of this class are immutablesecurityGroups
(Iterable<String> securityGroups) assigns the created nodes to these security groupssecurityGroups
(String... securityGroups) boolean
boolean
boolean
Whether to run the script as root (or run with current privileges).boolean
Whether to wait until the script has completed.assigns tags to the created nodestoString()
userMetadata
(String key, String value) userMetadata
(Map<String, String> userMetadata) wrapInInitScript
(boolean wrapInInitScript) default trueMethods inherited from class org.jclouds.compute.options.TemplateOptions
equals, getNetworks, hashCode, runScript, string
Methods inherited from class org.jclouds.compute.options.RunScriptOptions
copyTo, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, overrideLoginPassword, overrideLoginPrivateKey
-
Constructor Details
-
ImmutableTemplateOptions
-
-
Method Details
-
clone
- Overrides:
clone
in classTemplateOptions
-
getTaskName
- Overrides:
getTaskName
in classRunScriptOptions
-
getPort
public int getPort()- Overrides:
getPort
in classRunScriptOptions
-
getSeconds
public int getSeconds()- Overrides:
getSeconds
in classRunScriptOptions
-
shouldRunAsRoot
public boolean shouldRunAsRoot()Description copied from class:RunScriptOptions
Whether to run the script as root (or run with current privileges). By default, true.- Overrides:
shouldRunAsRoot
in classRunScriptOptions
- Returns:
- value
-
shouldBlockOnComplete
public boolean shouldBlockOnComplete()- Overrides:
shouldBlockOnComplete
in classRunScriptOptions
- See Also:
-
shouldWrapInInitScript
public boolean shouldWrapInInitScript()Description copied from class:RunScriptOptions
Whether to wait until the script has completed. By default, true.- Overrides:
shouldWrapInInitScript
in classRunScriptOptions
- Returns:
- value
-
copyTo
- Overrides:
copyTo
in classTemplateOptions
-
toString
- Overrides:
toString
in classRunScriptOptions
-
runScript
unsupported as objects of this class are immutable- Overrides:
runScript
in classTemplateOptions
-
dontAuthorizePublicKey
- Overrides:
dontAuthorizePublicKey
in classTemplateOptions
-
blockOnPort
Description copied from class:RunScriptOptions
When the node is started, wait until the following port is active- Overrides:
blockOnPort
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
-
wrapInInitScript
Description copied from class:RunScriptOptions
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:
-
blockOnComplete
Description copied from class:RunScriptOptions
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)
-
overrideLoginCredentials
- Overrides:
overrideLoginCredentials
in classTemplateOptions
-
overrideLoginPassword
- Overrides:
overrideLoginPassword
in classTemplateOptions
-
overrideLoginPrivateKey
- Overrides:
overrideLoginPrivateKey
in classTemplateOptions
-
overrideAuthenticateSudo
- Overrides:
overrideAuthenticateSudo
in classTemplateOptions
-
getLoginUser
- Overrides:
getLoginUser
in classRunScriptOptions
- Returns:
- the login user for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
shouldAuthenticateSudo
- Overrides:
shouldAuthenticateSudo
in classRunScriptOptions
- Returns:
- Whether the login user should authenticate sudo during
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
getLoginPassword
- Overrides:
getLoginPassword
in classRunScriptOptions
- Returns:
- the login password for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
getLoginPrivateKey
- Overrides:
getLoginPrivateKey
in classRunScriptOptions
- Returns:
- the login ssh key for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
overrideLoginUser
- Overrides:
overrideLoginUser
in classTemplateOptions
-
as
- Overrides:
as
in classTemplateOptions
-
authorizePublicKey
Description copied from class:TemplateOptions
authorize an rsa ssh key.- Overrides:
authorizePublicKey
in classTemplateOptions
-
blockUntilRunning
unsupported as objects of this class are immutable- Overrides:
blockUntilRunning
in classTemplateOptions
- Parameters:
blockUntilRunning
- (default true) whether to block until the nodes in this template are ininvalid reference
Status#RUNNING
-
getInboundPorts
public int[] getInboundPorts()- Overrides:
getInboundPorts
in classTemplateOptions
-
getPrivateKey
- Overrides:
getPrivateKey
in classTemplateOptions
-
getPublicKey
- Overrides:
getPublicKey
in classTemplateOptions
-
getRunScript
- Overrides:
getRunScript
in classTemplateOptions
-
shouldBlockUntilRunning
public boolean shouldBlockUntilRunning()- Overrides:
shouldBlockUntilRunning
in classTemplateOptions
- See Also:
-
inboundPorts
Description copied from class:TemplateOptions
Opens the set of ports to public access.- Overrides:
inboundPorts
in classTemplateOptions
-
installPrivateKey
Description copied from class:TemplateOptions
replaces the rsa ssh key used at login.- Overrides:
installPrivateKey
in classTemplateOptions
-
getTags
- Overrides:
getTags
in classTemplateOptions
-
tags
Description copied from class:TemplateOptions
assigns tags to the created nodes- Overrides:
tags
in classTemplateOptions
-
getNodeNames
- Overrides:
getNodeNames
in classTemplateOptions
-
nodeNames
Description copied from class:TemplateOptions
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
-
getGroups
- Overrides:
getGroups
in classTemplateOptions
-
securityGroups
Description copied from class:TemplateOptions
assigns the created nodes to these security groups- Overrides:
securityGroups
in classTemplateOptions
-
securityGroups
- Overrides:
securityGroups
in classTemplateOptions
- See Also:
-
networks
Description copied from class:TemplateOptions
Assigns the created nodes to these networks- Overrides:
networks
in classTemplateOptions
-
networks
- Overrides:
networks
in classTemplateOptions
- See Also:
-
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
-
getUserMetadata
- Overrides:
getUserMetadata
in classTemplateOptions
- See Also:
-