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
public static class TemplateOptions.ImmutableTemplateOptions extends 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 Constructor Description ImmutableTemplateOptions(TemplateOptions delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends TemplateOptions>
Tas(Class<T> clazz)
TemplateOptions
authorizePublicKey(String publicKey)
authorize an rsa ssh key.TemplateOptions
blockOnComplete(boolean blockOnComplete)
As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.TemplateOptions
blockOnPort(int port, int seconds)
When the node is started, wait until the following port is activeTemplateOptions
blockUntilRunning(boolean blockUntilRunning)
unsupported as objects of this class are immutableTemplateOptions
clone()
void
copyTo(TemplateOptions to)
TemplateOptions
dontAuthorizePublicKey()
Set<String>
getGroups()
int[]
getInboundPorts()
String
getLoginPassword()
String
getLoginPrivateKey()
String
getLoginUser()
Set<String>
getNodeNames()
int
getPort()
String
getPrivateKey()
String
getPublicKey()
Statement
getRunScript()
int
getSeconds()
Set<String>
getTags()
String
getTaskName()
Map<String,String>
getUserMetadata()
TemplateOptions
inboundPorts(int... ports)
Opens the set of ports to public access.TemplateOptions
installPrivateKey(String privateKey)
replaces the rsa ssh key used at login.TemplateOptions
nameTask(String name)
TemplateOptions
networks(Iterable<String> networks)
Assigns the created nodes to these networksTemplateOptions
networks(String... networks)
TemplateOptions
nodeNames(Iterable<String> nodeNames)
specifies names to be used for the created nodes.TemplateOptions
overrideAuthenticateSudo(boolean authenticateSudo)
TemplateOptions
overrideLoginCredentials(LoginCredentials overridingCredentials)
TemplateOptions
overrideLoginPassword(String password)
TemplateOptions
overrideLoginPrivateKey(String privateKey)
TemplateOptions
overrideLoginUser(String loginUser)
TemplateOptions
runAsRoot(boolean runAsRoot)
TemplateOptions
runScript(Statement script)
unsupported as objects of this class are immutableTemplateOptions
securityGroups(Iterable<String> securityGroups)
assigns the created nodes to these security groupsTemplateOptions
securityGroups(String... securityGroups)
Boolean
shouldAuthenticateSudo()
boolean
shouldBlockOnComplete()
boolean
shouldBlockUntilRunning()
boolean
shouldRunAsRoot()
Whether to run the script as root (or run with current privileges).boolean
shouldWrapInInitScript()
Whether to wait until the script has completed.TemplateOptions
tags(Iterable<String> tags)
assigns tags to the created nodesString
toString()
TemplateOptions
userMetadata(String key, String value)
TemplateOptions
userMetadata(Map<String,String> userMetadata)
TemplateOptions
wrapInInitScript(boolean wrapInInitScript)
default true-
Methods 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 Detail
-
ImmutableTemplateOptions
public ImmutableTemplateOptions(TemplateOptions delegate)
-
-
Method Detail
-
clone
public TemplateOptions clone()
- Overrides:
clone
in classTemplateOptions
-
getTaskName
public String 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:
RunScriptOptions.blockOnComplete(boolean)
-
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
public void copyTo(TemplateOptions to)
- Overrides:
copyTo
in classTemplateOptions
-
toString
public String toString()
- Overrides:
toString
in classRunScriptOptions
-
runScript
public TemplateOptions runScript(Statement script)
unsupported as objects of this class are immutable- Overrides:
runScript
in classTemplateOptions
-
dontAuthorizePublicKey
public TemplateOptions dontAuthorizePublicKey()
- Overrides:
dontAuthorizePublicKey
in classTemplateOptions
-
blockOnPort
public TemplateOptions blockOnPort(int port, int seconds)
Description copied from class:RunScriptOptions
When the node is started, wait until the following port is active- Overrides:
blockOnPort
in classTemplateOptions
-
nameTask
public TemplateOptions nameTask(String name)
- 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
public TemplateOptions runAsRoot(boolean runAsRoot)
- Overrides:
runAsRoot
in classTemplateOptions
-
wrapInInitScript
public TemplateOptions wrapInInitScript(boolean 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
public TemplateOptions blockOnComplete(boolean 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
public TemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
- Overrides:
overrideLoginCredentials
in classTemplateOptions
-
overrideLoginPassword
public TemplateOptions overrideLoginPassword(String password)
- Overrides:
overrideLoginPassword
in classTemplateOptions
-
overrideLoginPrivateKey
public TemplateOptions overrideLoginPrivateKey(String privateKey)
- Overrides:
overrideLoginPrivateKey
in classTemplateOptions
-
overrideAuthenticateSudo
public TemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
- Overrides:
overrideAuthenticateSudo
in classTemplateOptions
-
getLoginUser
public String 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
public Boolean 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
public String 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
public String 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
public TemplateOptions overrideLoginUser(String loginUser)
- Overrides:
overrideLoginUser
in classTemplateOptions
-
as
public <T extends TemplateOptions> T as(Class<T> clazz)
- Overrides:
as
in classTemplateOptions
-
authorizePublicKey
public TemplateOptions authorizePublicKey(String publicKey)
Description copied from class:TemplateOptions
authorize an rsa ssh key.- Overrides:
authorizePublicKey
in classTemplateOptions
-
blockUntilRunning
public TemplateOptions blockUntilRunning(boolean 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 inStatus#RUNNING
state
-
getInboundPorts
public int[] getInboundPorts()
- Overrides:
getInboundPorts
in classTemplateOptions
-
getPrivateKey
public String getPrivateKey()
- Overrides:
getPrivateKey
in classTemplateOptions
-
getPublicKey
public String getPublicKey()
- Overrides:
getPublicKey
in classTemplateOptions
-
getRunScript
public Statement getRunScript()
- Overrides:
getRunScript
in classTemplateOptions
-
shouldBlockUntilRunning
public boolean shouldBlockUntilRunning()
- Overrides:
shouldBlockUntilRunning
in classTemplateOptions
- See Also:
TemplateOptions.blockUntilRunning(boolean)
-
inboundPorts
public TemplateOptions inboundPorts(int... ports)
Description copied from class:TemplateOptions
Opens the set of ports to public access.- Overrides:
inboundPorts
in classTemplateOptions
-
installPrivateKey
public TemplateOptions installPrivateKey(String privateKey)
Description copied from class:TemplateOptions
replaces the rsa ssh key used at login.- Overrides:
installPrivateKey
in classTemplateOptions
-
getTags
public Set<String> getTags()
- Overrides:
getTags
in classTemplateOptions
-
tags
public TemplateOptions tags(Iterable<String> tags)
Description copied from class:TemplateOptions
assigns tags to the created nodes- Overrides:
tags
in classTemplateOptions
-
getNodeNames
public Set<String> getNodeNames()
- Overrides:
getNodeNames
in classTemplateOptions
-
nodeNames
public TemplateOptions nodeNames(Iterable<String> 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
public Set<String> getGroups()
- Overrides:
getGroups
in classTemplateOptions
-
securityGroups
public TemplateOptions securityGroups(Iterable<String> securityGroups)
Description copied from class:TemplateOptions
assigns the created nodes to these security groups- Overrides:
securityGroups
in classTemplateOptions
-
securityGroups
public TemplateOptions securityGroups(String... securityGroups)
- Overrides:
securityGroups
in classTemplateOptions
- See Also:
TemplateOptions#securityGroups(Iterable
)
-
networks
public TemplateOptions networks(Iterable<String> networks)
Description copied from class:TemplateOptions
Assigns the created nodes to these networks- Overrides:
networks
in classTemplateOptions
-
networks
public TemplateOptions networks(String... networks)
- Overrides:
networks
in classTemplateOptions
- See Also:
TemplateOptions.networks(Iterable)
-
userMetadata
public TemplateOptions userMetadata(Map<String,String> userMetadata)
- Overrides:
userMetadata
in classTemplateOptions
- Parameters:
userMetadata
- user-defined metadata to assign to this server
-
userMetadata
public TemplateOptions userMetadata(String key, String value)
- Overrides:
userMetadata
in classTemplateOptions
- Parameters:
key
- key to place into the metadata mapvalue
- value to associate with that key
-
getUserMetadata
public Map<String,String> getUserMetadata()
- Overrides:
getUserMetadata
in classTemplateOptions
- See Also:
TemplateOptions.userMetadata(Map)
-
-