public class TemplateOptions extends RunScriptOptions implements Cloneable
ComputeService#createNodesInGroup
operation.
import static org.jclouds.compute.options.TemplateOptions.Builder.*;
ComputeService client = // get connection
templateBuilder.options(inboundPorts(22, 80, 8080, 443));
Set extends NodeMetadata> set = client.createNodesInGroup(tag, 2, templateBuilder.build());
Note that options can only be assigned to a builder once, so if assigning e.g. inboundPorts and tags,
that must be done in with mutators in a single call to options --
templateBuilder.options(inboundPorts(22, 80, 8080, 443).tags("I love it!"))
-- not as repeated calls to options
.
Modifier and Type | Class and Description |
---|---|
static class |
TemplateOptions.Builder |
static class |
TemplateOptions.ImmutableTemplateOptions |
RunScriptOptions.ImmutableRunScriptOptions
Modifier and Type | Field and Description |
---|---|
protected boolean |
blockUntilRunning |
protected int[] |
inboundPorts |
static TemplateOptions |
NONE |
protected String |
privateKey |
protected String |
publicKey |
protected Statement |
script |
protected Set<String> |
tags |
protected Map<String,String> |
userMetadata |
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
Constructor and Description |
---|
TemplateOptions() |
getLoginPassword, getLoginPrivateKey, getLoginUser, getOverridingCredentials, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript
public static final TemplateOptions NONE
protected int[] inboundPorts
protected Statement script
protected String privateKey
protected String publicKey
protected boolean blockUntilRunning
public TemplateOptions clone()
public void copyTo(TemplateOptions to)
public int[] getInboundPorts()
public Statement getRunScript()
public String getPrivateKey()
public String getPublicKey()
public boolean shouldBlockUntilRunning()
public <T extends TemplateOptions> T as(Class<T> clazz)
@Deprecated public TemplateOptions runScript(Payload script)
public TemplateOptions runScript(String script)
public TemplateOptions runScript(Statement script)
public TemplateOptions installPrivateKey(String privateKey)
public TemplateOptions dontAuthorizePublicKey()
public TemplateOptions authorizePublicKey(String publicKey)
public TemplateOptions tags(Iterable<String> tags)
public TemplateOptions inboundPorts(int... ports)
public String toString()
toString
in class RunScriptOptions
public TemplateOptions blockUntilRunning(boolean blockUntilRunning)
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
and
RunScriptOptions.blockOnComplete(boolean)
, as all current
implementations utilize ssh in order to execute scripts.blockUntilRunning
- (default true) whether to block until the nodes in this template
are in NodeState.RUNNING
statepublic TemplateOptions userMetadata(Map<String,String> userMetadata)
userMetadata
- user-defined metadata to assign to this serverpublic TemplateOptions userMetadata(String key, String value)
key
- key to place into the metadata mapvalue
- value to associate with that keypublic Map<String,String> getUserMetadata()
userMetadata(Map)
public int hashCode()
hashCode
in class RunScriptOptions
public boolean equals(Object obj)
equals
in class RunScriptOptions
public TemplateOptions blockOnPort(int port, int seconds)
RunScriptOptions
blockOnPort
in class RunScriptOptions
public TemplateOptions nameTask(String name)
nameTask
in class RunScriptOptions
jclouds-script-timestamp
where timestamp is millis since
epochpublic TemplateOptions runAsRoot(boolean runAsRoot)
runAsRoot
in class RunScriptOptions
public TemplateOptions wrapInInitScript(boolean wrapInInitScript)
RunScriptOptions
wrapInInitScript
in class RunScriptOptions
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 TemplateOptions blockOnComplete(boolean blockOnComplete)
RunScriptOptions
blockOnComplete
in class RunScriptOptions
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)@Deprecated public TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
RunScriptOptions
overrideCredentialsWith
in class RunScriptOptions
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
@Deprecated public TemplateOptions overrideLoginUserWith(String loginUser)
RunScriptOptions
overrideLoginUserWith
in class RunScriptOptions
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
@Deprecated public TemplateOptions overrideLoginCredentialWith(String loginCredential)
RunScriptOptions
overrideLoginCredentialWith
in class RunScriptOptions
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
public TemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
overrideLoginCredentials
in class RunScriptOptions
public TemplateOptions overrideLoginPassword(String password)
overrideLoginPassword
in class RunScriptOptions
public TemplateOptions overrideLoginPrivateKey(String privateKey)
overrideLoginPrivateKey
in class RunScriptOptions
public TemplateOptions overrideLoginUser(String loginUser)
overrideLoginUser
in class RunScriptOptions
public TemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
overrideAuthenticateSudo
in class RunScriptOptions
Copyright © 2009-2012 jclouds. All Rights Reserved.