public class EC2TemplateOptions extends TemplateOptions implements Cloneable
ComputeService#runNode
operation on
the "ec2" provider.
import static org.jclouds.aws.ec2.compute.options.EC2TemplateOptions.Builder.*;
ComputeService client = // get connection
templateBuilder.options(inboundPorts(22, 80, 8080, 443));
Set extends NodeMetadata> set = client.createNodesInGroup(tag, 2, templateBuilder.build());
Modifier and Type | Class and Description |
---|---|
static class |
EC2TemplateOptions.Builder |
TemplateOptions.ImmutableTemplateOptions
RunScriptOptions.ImmutableRunScriptOptions
Modifier and Type | Field and Description |
---|---|
static EC2TemplateOptions |
NONE |
blockUntilRunning, inboundPorts, privateKey, publicKey, script, tags, userMetadata
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
Constructor and Description |
---|
EC2TemplateOptions() |
as, blockOnComplete, getInboundPorts, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, runScript, shouldBlockUntilRunning, tags, wrapInInitScript
getLoginPassword, getLoginPrivateKey, getLoginUser, getOverridingCredentials, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript
public static final EC2TemplateOptions NONE
public EC2TemplateOptions clone()
clone
in class TemplateOptions
public void copyTo(TemplateOptions to)
copyTo
in class TemplateOptions
public EC2TemplateOptions securityGroups(String... groupNames)
EC2TemplateOptions#securityGroups(Iterable)
public EC2TemplateOptions securityGroups(Iterable<String> groupNames)
public EC2TemplateOptions userData(byte[] unencodedData)
public EC2TemplateOptions keyPair(String keyPair)
public EC2TemplateOptions noKeyPair()
public EC2TemplateOptions mapEBSSnapshotToDeviceName(String deviceName, String snapshotId, @Nullable Integer sizeInGib, boolean deleteOnTermination)
public EC2TemplateOptions mapNewVolumeToDeviceName(String deviceName, int sizeInGib, boolean deleteOnTermination)
public EC2TemplateOptions mapEphemeralDeviceToDeviceName(String deviceName, String virtualName)
public EC2TemplateOptions unmapDeviceNamed(String deviceName)
public EC2TemplateOptions blockDeviceMappings(Iterable<? extends BlockDeviceMapping> blockDeviceMappings)
public EC2TemplateOptions blockOnPort(int port, int seconds)
blockOnPort
in class TemplateOptions
public EC2TemplateOptions inboundPorts(int... ports)
inboundPorts
in class TemplateOptions
public EC2TemplateOptions authorizePublicKey(String publicKey)
authorizePublicKey
in class TemplateOptions
public EC2TemplateOptions installPrivateKey(String privateKey)
installPrivateKey
in class TemplateOptions
@Deprecated public EC2TemplateOptions runScript(Payload script)
runScript
in class TemplateOptions
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
,
Payloads
public EC2TemplateOptions blockUntilRunning(boolean blockUntilRunning)
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
and
RunScriptOptions.blockOnComplete(boolean)
, as all current
implementations utilize ssh in order to execute scripts.blockUntilRunning
in class TemplateOptions
blockUntilRunning
- (default true) whether to block until the nodes in this template
are in NodeState.RUNNING
statepublic EC2TemplateOptions dontAuthorizePublicKey()
dontAuthorizePublicKey
in class TemplateOptions
public EC2TemplateOptions nameTask(String name)
nameTask
in class TemplateOptions
jclouds-script-timestamp
where timestamp is millis since
epochpublic EC2TemplateOptions runAsRoot(boolean runAsRoot)
runAsRoot
in class TemplateOptions
public EC2TemplateOptions runScript(Statement script)
runScript
in class TemplateOptions
@Deprecated public EC2TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
overrideCredentialsWith
in class TemplateOptions
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
@Deprecated public EC2TemplateOptions overrideLoginUserWith(String loginUser)
overrideLoginUserWith
in class TemplateOptions
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
@Deprecated public EC2TemplateOptions overrideLoginCredentialWith(String loginCredential)
overrideLoginCredentialWith
in class TemplateOptions
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
public EC2TemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
overrideLoginCredentials
in class TemplateOptions
public EC2TemplateOptions overrideLoginPassword(String password)
overrideLoginPassword
in class TemplateOptions
public EC2TemplateOptions overrideLoginPrivateKey(String privateKey)
overrideLoginPrivateKey
in class TemplateOptions
public EC2TemplateOptions overrideLoginUser(String loginUser)
overrideLoginUser
in class TemplateOptions
public EC2TemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
overrideAuthenticateSudo
in class TemplateOptions
public EC2TemplateOptions userMetadata(Map<String,String> userMetadata)
userMetadata
in class TemplateOptions
userMetadata
- user-defined metadata to assign to this serverpublic EC2TemplateOptions userMetadata(String key, String value)
userMetadata
in class TemplateOptions
key
- key to place into the metadata mapvalue
- value to associate with that keypublic Set<String> getGroups()
public String getKeyPair()
public boolean shouldAutomaticallyCreateKeyPair()
public byte[] getUserData()
public Set<BlockDeviceMapping> getBlockDeviceMappings()
public int hashCode()
hashCode
in class TemplateOptions
public boolean equals(Object obj)
equals
in class TemplateOptions
public String toString()
toString
in class TemplateOptions
Copyright © 2009-2012 jclouds. All Rights Reserved.