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, networks, nodeNames, privateKey, publicKey, script, securityGroups, tags, userMetadata
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
Constructor and Description |
---|
EC2TemplateOptions() |
Modifier and Type | Method and Description |
---|---|
EC2TemplateOptions |
authorizePublicKey(String publicKey)
authorize an rsa ssh key.
|
EC2TemplateOptions |
blockDeviceMappings(Iterable<? extends BlockDeviceMapping> blockDeviceMappings) |
EC2TemplateOptions |
blockOnComplete(boolean blockOnComplete)
As of version 1.1.0, we cannot kick off a script unless a node is in
RUNNING state.
|
EC2TemplateOptions |
blockOnPort(int port,
int seconds)
When the node is started, wait until the following port is active
|
EC2TemplateOptions |
blockUntilRunning(boolean blockUntilRunning)
Note
|
EC2TemplateOptions |
clientToken(String clientToken) |
EC2TemplateOptions |
clone() |
void |
copyTo(TemplateOptions to) |
EC2TemplateOptions |
dontAuthorizePublicKey() |
boolean |
equals(Object o) |
Set<BlockDeviceMapping> |
getBlockDeviceMappings() |
String |
getClientToken()
See here for more information.
|
Set<String> |
getGroups() |
String |
getKeyPair() |
int |
getMaxCount() |
byte[] |
getUserData() |
int |
hashCode() |
EC2TemplateOptions |
inboundPorts(int... ports)
Opens the set of ports to public access.
|
EC2TemplateOptions |
installPrivateKey(String privateKey)
replaces the rsa ssh key used at login.
|
EC2TemplateOptions |
keyPair(String keyPair)
Specifies the keypair used to run instances with
|
EC2TemplateOptions |
mapEBSSnapshotToDeviceName(String deviceName,
String snapshotId,
Integer sizeInGib,
boolean deleteOnTermination) |
EC2TemplateOptions |
mapEBSSnapshotToDeviceName(String deviceName,
String snapshotId,
Integer sizeInGib,
boolean deleteOnTermination,
String volumeType,
Integer iops,
boolean encrypted) |
EC2TemplateOptions |
mapEphemeralDeviceToDeviceName(String deviceName,
String virtualName) |
EC2TemplateOptions |
mapNewVolumeToDeviceName(String deviceName,
int sizeInGib,
boolean deleteOnTermination) |
EC2TemplateOptions |
mapNewVolumeToDeviceName(String deviceName,
int sizeInGib,
boolean deleteOnTermination,
String volumeType,
Integer iops,
boolean encrypted) |
EC2TemplateOptions |
maxCount(Integer maxCount) |
EC2TemplateOptions |
nameTask(String name) |
EC2TemplateOptions |
networks(Iterable<String> networks)
Assigns the created nodes to these networks
|
EC2TemplateOptions |
nodeNames(Iterable<String> nodeNames)
specifies names to be used for the created nodes.
|
EC2TemplateOptions |
noKeyPair()
Do not use a keypair on instances
|
EC2TemplateOptions |
overrideAuthenticateSudo(boolean authenticateSudo) |
EC2TemplateOptions |
overrideLoginCredentials(LoginCredentials overridingCredentials) |
EC2TemplateOptions |
overrideLoginPassword(String password) |
EC2TemplateOptions |
overrideLoginPrivateKey(String privateKey) |
EC2TemplateOptions |
overrideLoginUser(String loginUser) |
EC2TemplateOptions |
runAsRoot(boolean runAsRoot) |
EC2TemplateOptions |
runScript(Statement script)
This script will be executed as the root user upon system startup.
|
EC2TemplateOptions |
runScript(String script)
This script will be executed as the root user upon system startup.
|
EC2TemplateOptions |
securityGroups(Iterable<String> groupNames)
Specifies the security groups to be used for nodes with this template
|
EC2TemplateOptions |
securityGroups(String... groupNames) |
boolean |
shouldAutomaticallyCreateKeyPair() |
com.google.common.base.MoreObjects.ToStringHelper |
string() |
EC2TemplateOptions |
tags(Iterable<String> tags)
assigns tags to the created nodes
|
EC2TemplateOptions |
unmapDeviceNamed(String deviceName) |
EC2TemplateOptions |
userData(byte[] unencodedData)
Unencoded data
|
EC2TemplateOptions |
userMetadata(Map<String,String> userMetadata) |
EC2TemplateOptions |
userMetadata(String key,
String value) |
EC2TemplateOptions |
wrapInInitScript(boolean wrapInInitScript)
default true
|
as, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, networks, shouldBlockUntilRunning
copyTo, getLoginPassword, getLoginPrivateKey, getLoginUser, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, overrideLoginPassword, overrideLoginPrivateKey, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript, toString
public static final EC2TemplateOptions NONE
public EC2TemplateOptions clone()
clone
in class TemplateOptions
public void copyTo(TemplateOptions to)
copyTo
in class TemplateOptions
public boolean equals(Object o)
equals
in class TemplateOptions
public int hashCode()
hashCode
in class TemplateOptions
public com.google.common.base.MoreObjects.ToStringHelper string()
string
in class TemplateOptions
public EC2TemplateOptions securityGroups(String... groupNames)
securityGroups
in class TemplateOptions
EC2TemplateOptions#securityGroups(Iterable)
public EC2TemplateOptions securityGroups(Iterable<String> groupNames)
securityGroups
in class TemplateOptions
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 mapEBSSnapshotToDeviceName(String deviceName, String snapshotId, @Nullable Integer sizeInGib, boolean deleteOnTermination, @Nullable String volumeType, @Nullable Integer iops, boolean encrypted)
public EC2TemplateOptions mapNewVolumeToDeviceName(String deviceName, int sizeInGib, boolean deleteOnTermination)
public EC2TemplateOptions mapNewVolumeToDeviceName(String deviceName, int sizeInGib, boolean deleteOnTermination, @Nullable String volumeType, @Nullable Integer iops, boolean encrypted)
public EC2TemplateOptions mapEphemeralDeviceToDeviceName(String deviceName, String virtualName)
public EC2TemplateOptions unmapDeviceNamed(String deviceName)
public EC2TemplateOptions blockDeviceMappings(Iterable<? extends BlockDeviceMapping> blockDeviceMappings)
public EC2TemplateOptions maxCount(Integer maxCount)
public EC2TemplateOptions clientToken(String clientToken)
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
public EC2TemplateOptions blockUntilRunning(boolean blockUntilRunning)
TemplateOptions.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 Status#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
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 EC2TemplateOptions nodeNames(Iterable<String> nodeNames)
nodeNames
in class TemplateOptions
public EC2TemplateOptions networks(Iterable<String> networks)
networks
in class TemplateOptions
public EC2TemplateOptions runScript(String script)
runScript
in class TemplateOptions
public EC2TemplateOptions tags(Iterable<String> tags)
tags
in class TemplateOptions
public EC2TemplateOptions wrapInInitScript(boolean wrapInInitScript)
wrapInInitScript
in class TemplateOptions
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 EC2TemplateOptions blockOnComplete(boolean blockOnComplete)
blockOnComplete
in class TemplateOptions
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)public Set<String> getGroups()
getGroups
in class TemplateOptions
public String getKeyPair()
public boolean shouldAutomaticallyCreateKeyPair()
public byte[] getUserData()
public Set<BlockDeviceMapping> getBlockDeviceMappings()
public int getMaxCount()
Copyright © 2009-2021 The Apache Software Foundation. All Rights Reserved.