Package org.jclouds.aws.ec2.compute
Class AWSEC2TemplateOptions
java.lang.Object
org.jclouds.compute.options.RunScriptOptions
org.jclouds.compute.options.TemplateOptions
org.jclouds.ec2.compute.options.EC2TemplateOptions
org.jclouds.aws.ec2.compute.AWSEC2TemplateOptions
- All Implemented Interfaces:
Cloneable
Contains options supported in the
ComputeService#runNode
operation on
the "ec2" provider. Usage
The recommended way to instantiate a AWSEC2TemplateOptions object is to statically import AWSEC2TemplateOptions.* and invoke a static creation method followed by an instance mutator (if needed):
import static org.jclouds.aws.ec2.compute.options.AWSEC2TemplateOptions.Builder.*;
ComputeService client = // get connection
templateBuilder.options(inboundPorts(22, 80, 8080, 443));
Setinvalid input: '<'? extends NodeMetadata> set = client.createNodesInGroup(tag, 2, templateBuilder.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.jclouds.compute.options.TemplateOptions
TemplateOptions.ImmutableTemplateOptions
Nested classes/interfaces inherited from class org.jclouds.compute.options.RunScriptOptions
RunScriptOptions.ImmutableRunScriptOptions
-
Field Summary
FieldsFields inherited from class org.jclouds.compute.options.TemplateOptions
blockUntilRunning, inboundPorts, networks, nodeNames, 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 TypeMethodDescriptionauthorizePublicKey
(String publicKey) authorize an rsa ssh key.blockDeviceMappings
(Iterable<? extends BlockDeviceMapping> blockDeviceMappings) blockOnPort
(int port, int seconds) When the node is started, wait until the following port is activeblockUntilRunning
(boolean blockUntilRunning) Noteclone()
void
dedicatedHostId
(String hostId) Specifies the ID of the dedicated host on which the instance should resist.Enable Cloudwatch monitoringboolean
The Amazon resource name (ARN) of the IAM Instance Profile (IIP) to associate with the instance.The name of the IAM Instance Profile (IIP) to associate with the instance.int
hashCode()
iamInstanceProfileName
(String name) inboundPorts
(int... ports) Opens the set of ports to public access.installPrivateKey
(String privateKey) replaces the rsa ssh key used at login.boolean
Specifies the keypair used to run instances withmapEBSSnapshotToDeviceName
(String deviceName, String snapshotId, Integer sizeInGib, boolean deleteOnTermination) mapEphemeralDeviceToDeviceName
(String deviceName, String virtualName) mapNewVolumeToDeviceName
(String deviceName, int sizeInGib, boolean deleteOnTermination) Assigns the created nodes to these networksspecifies names to be used for the created nodes.Do not use a keypair on instancesDo not use a keypair on instancesoverrideAuthenticateSudo
(boolean authenticateSudo) overrideLoginCredentials
(LoginCredentials overridingCredentials) overrideLoginPassword
(String password) overrideLoginPrivateKey
(String privateKey) overrideLoginUser
(String loginUser) placementGroup
(String placementGroup) Specifies the keypair used to run instances withprivateIpAddress
(String address) runAsRoot
(boolean runAsRoot) This script will be executed as the root user upon system startup.securityGroupIds
(Iterable<String> groupIds) Specifies the security group ids to be used for nodes with this templatesecurityGroupIds
(String... groupIds) securityGroups
(Iterable<String> groupIds) Specifies the security groups to be used for nodes with this templatesecurityGroups
(String... groupIds) boolean
spotOptions
(RequestSpotInstancesOptions spotOptions) Options for starting spot instancesSpecifies the maximum spot price to usecom.google.common.base.MoreObjects.ToStringHelper
string()
Specifies the subnetId used to run instances inSpecifies the tenancy used to run instances withunmapDeviceNamed
(String deviceName) userData
(byte[] unencodedData) Unencoded datauserMetadata
(String key, String value) userMetadata
(Map<String, String> userMetadata) Methods inherited from class org.jclouds.ec2.compute.options.EC2TemplateOptions
blockOnComplete, clientToken, getBlockDeviceMappings, getClientToken, getGroups, getKeyPair, getMaxCount, getUserData, mapEBSSnapshotToDeviceName, mapNewVolumeToDeviceName, maxCount, runScript, shouldAutomaticallyCreateKeyPair, tags, wrapInInitScript
Methods inherited from class org.jclouds.compute.options.TemplateOptions
as, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, networks, shouldBlockUntilRunning
Methods inherited from class org.jclouds.compute.options.RunScriptOptions
copyTo, getLoginPassword, getLoginPrivateKey, getLoginUser, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, overrideLoginPassword, overrideLoginPrivateKey, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript, toString
-
Field Details
-
NONE
-
-
Constructor Details
-
AWSEC2TemplateOptions
public AWSEC2TemplateOptions()
-
-
Method Details
-
clone
- Overrides:
clone
in classEC2TemplateOptions
-
copyTo
- Overrides:
copyTo
in classEC2TemplateOptions
-
equals
- Overrides:
equals
in classEC2TemplateOptions
-
hashCode
public int hashCode()- Overrides:
hashCode
in classEC2TemplateOptions
-
string
public com.google.common.base.MoreObjects.ToStringHelper string()- Overrides:
string
in classEC2TemplateOptions
-
enableMonitoring
Enable Cloudwatch monitoring- See Also:
-
placementGroup
Specifies the keypair used to run instances with -
noPlacementGroup
Do not use a keypair on instances -
subnetId
Specifies the subnetId used to run instances in -
iamInstanceProfileArn
- See Also:
-
iamInstanceProfileName
- See Also:
-
privateIpAddress
-
tenancy
Specifies the tenancy used to run instances with -
dedicatedHostId
Specifies the ID of the dedicated host on which the instance should resist. -
spotPrice
Specifies the maximum spot price to use -
spotOptions
Options for starting spot instances -
securityGroupIds
- See Also:
-
securityGroupIds
Specifies the security group ids to be used for nodes with this template -
getGroupIds
-
blockDeviceMappings
public AWSEC2TemplateOptions blockDeviceMappings(Iterable<? extends BlockDeviceMapping> blockDeviceMappings) - Overrides:
blockDeviceMappings
in classEC2TemplateOptions
-
userMetadata
- Overrides:
userMetadata
in classEC2TemplateOptions
- Parameters:
userMetadata
- user-defined metadata to assign to this server
-
userMetadata
- Overrides:
userMetadata
in classEC2TemplateOptions
- Parameters:
key
- key to place into the metadata mapvalue
- value to associate with that key
-
nodeNames
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 classEC2TemplateOptions
-
networks
Assigns the created nodes to these networks- Overrides:
networks
in classEC2TemplateOptions
-
keyPair
Specifies the keypair used to run instances with- Overrides:
keyPair
in classEC2TemplateOptions
-
mapEBSSnapshotToDeviceName
public AWSEC2TemplateOptions mapEBSSnapshotToDeviceName(String deviceName, String snapshotId, Integer sizeInGib, boolean deleteOnTermination) - Overrides:
mapEBSSnapshotToDeviceName
in classEC2TemplateOptions
-
mapEphemeralDeviceToDeviceName
- Overrides:
mapEphemeralDeviceToDeviceName
in classEC2TemplateOptions
-
mapNewVolumeToDeviceName
public AWSEC2TemplateOptions mapNewVolumeToDeviceName(String deviceName, int sizeInGib, boolean deleteOnTermination) - Overrides:
mapNewVolumeToDeviceName
in classEC2TemplateOptions
-
noKeyPair
Do not use a keypair on instances- Overrides:
noKeyPair
in classEC2TemplateOptions
-
securityGroups
Specifies the security groups to be used for nodes with this template- Overrides:
securityGroups
in classEC2TemplateOptions
-
securityGroups
- Overrides:
securityGroups
in classEC2TemplateOptions
- See Also:
-
unmapDeviceNamed
- Overrides:
unmapDeviceNamed
in classEC2TemplateOptions
-
userData
Unencoded data- Overrides:
userData
in classEC2TemplateOptions
-
blockOnPort
When the node is started, wait until the following port is active- Overrides:
blockOnPort
in classEC2TemplateOptions
-
inboundPorts
Opens the set of ports to public access.- Overrides:
inboundPorts
in classEC2TemplateOptions
-
authorizePublicKey
authorize an rsa ssh key.- Overrides:
authorizePublicKey
in classEC2TemplateOptions
-
installPrivateKey
replaces the rsa ssh key used at login.- Overrides:
installPrivateKey
in classEC2TemplateOptions
-
blockUntilRunning
Note
As of version 1.1.0, this option is incompatible withTemplateOptions.runScript(Statement)
andRunScriptOptions.blockOnComplete(boolean)
, as all current implementations utilize ssh in order to execute scripts.- Overrides:
blockUntilRunning
in classEC2TemplateOptions
- Parameters:
blockUntilRunning
- (default true) whether to block until the nodes in this template are ininvalid reference
Status#RUNNING
-
dontAuthorizePublicKey
- Overrides:
dontAuthorizePublicKey
in classEC2TemplateOptions
-
nameTask
- Overrides:
nameTask
in classEC2TemplateOptions
- Returns:
- What to call the task relating to this script; default
jclouds-script-timestamp
where timestamp is millis since epoch
-
runAsRoot
- Overrides:
runAsRoot
in classEC2TemplateOptions
-
runScript
This script will be executed as the root user upon system startup. This script gets a prologue, so no #!/bin/bash required, path set up, etc- Overrides:
runScript
in classEC2TemplateOptions
-
overrideLoginCredentials
- Overrides:
overrideLoginCredentials
in classEC2TemplateOptions
-
overrideLoginPassword
- Overrides:
overrideLoginPassword
in classEC2TemplateOptions
-
overrideLoginPrivateKey
- Overrides:
overrideLoginPrivateKey
in classEC2TemplateOptions
-
overrideLoginUser
- Overrides:
overrideLoginUser
in classEC2TemplateOptions
-
overrideAuthenticateSudo
- Overrides:
overrideAuthenticateSudo
in classEC2TemplateOptions
-
getPlacementGroup
- Returns:
- placementGroup to use when running the instance or null, to generate a placementGroup.
-
shouldAutomaticallyCreatePlacementGroup
public boolean shouldAutomaticallyCreatePlacementGroup()- Returns:
- true (default) if we are supposed to use a placementGroup
-
isMonitoringEnabled
public boolean isMonitoringEnabled()- Returns:
- true (default) if we are supposed to enable cloudwatch
-
getSubnetId
- Returns:
- subnetId to use when running the instance or null.
-
getSpotPrice
- Returns:
- maximum spot price or null.
-
getSpotOptions
- Returns:
- options for controlling spot instance requests.
-
getIAMInstanceProfileArn
The Amazon resource name (ARN) of the IAM Instance Profile (IIP) to associate with the instance.- See Also:
-
getIAMInstanceProfileName
The name of the IAM Instance Profile (IIP) to associate with the instance.- See Also:
-
getPrivateIpAddress
-
getTenancy
-
getDedicatedHostId
-