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.ImmutableTemplateOptionsNested 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, userMetadataFields 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()voiddedicatedHostId(String hostId) Specifies the ID of the dedicated host on which the instance should resist.Enable Cloudwatch monitoringbooleanThe 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.inthashCode()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.booleanSpecifies 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) booleanspotOptions(RequestSpotInstancesOptions spotOptions) Options for starting spot instancesSpecifies the maximum spot price to usecom.google.common.base.MoreObjects.ToStringHelperstring()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, wrapInInitScriptMethods inherited from class org.jclouds.compute.options.TemplateOptions
as, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, networks, shouldBlockUntilRunningMethods 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:
clonein classEC2TemplateOptions
-
copyTo
- Overrides:
copyToin classEC2TemplateOptions
-
equals
- Overrides:
equalsin classEC2TemplateOptions
-
hashCode
public int hashCode()- Overrides:
hashCodein classEC2TemplateOptions
-
string
public com.google.common.base.MoreObjects.ToStringHelper string()- Overrides:
stringin 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:
blockDeviceMappingsin classEC2TemplateOptions
-
userMetadata
- Overrides:
userMetadatain classEC2TemplateOptions- Parameters:
userMetadata- user-defined metadata to assign to this server
-
userMetadata
- Overrides:
userMetadatain 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:
nodeNamesin classEC2TemplateOptions
-
networks
Assigns the created nodes to these networks- Overrides:
networksin classEC2TemplateOptions
-
keyPair
Specifies the keypair used to run instances with- Overrides:
keyPairin classEC2TemplateOptions
-
mapEBSSnapshotToDeviceName
public AWSEC2TemplateOptions mapEBSSnapshotToDeviceName(String deviceName, String snapshotId, Integer sizeInGib, boolean deleteOnTermination) - Overrides:
mapEBSSnapshotToDeviceNamein classEC2TemplateOptions
-
mapEphemeralDeviceToDeviceName
- Overrides:
mapEphemeralDeviceToDeviceNamein classEC2TemplateOptions
-
mapNewVolumeToDeviceName
public AWSEC2TemplateOptions mapNewVolumeToDeviceName(String deviceName, int sizeInGib, boolean deleteOnTermination) - Overrides:
mapNewVolumeToDeviceNamein classEC2TemplateOptions
-
noKeyPair
Do not use a keypair on instances- Overrides:
noKeyPairin classEC2TemplateOptions
-
securityGroups
Specifies the security groups to be used for nodes with this template- Overrides:
securityGroupsin classEC2TemplateOptions
-
securityGroups
- Overrides:
securityGroupsin classEC2TemplateOptions- See Also:
-
unmapDeviceNamed
- Overrides:
unmapDeviceNamedin classEC2TemplateOptions
-
userData
Unencoded data- Overrides:
userDatain classEC2TemplateOptions
-
blockOnPort
When the node is started, wait until the following port is active- Overrides:
blockOnPortin classEC2TemplateOptions
-
inboundPorts
Opens the set of ports to public access.- Overrides:
inboundPortsin classEC2TemplateOptions
-
authorizePublicKey
authorize an rsa ssh key.- Overrides:
authorizePublicKeyin classEC2TemplateOptions
-
installPrivateKey
replaces the rsa ssh key used at login.- Overrides:
installPrivateKeyin 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:
blockUntilRunningin classEC2TemplateOptions- Parameters:
blockUntilRunning- (default true) whether to block until the nodes in this template are instateinvalid reference
Status#RUNNING
-
dontAuthorizePublicKey
- Overrides:
dontAuthorizePublicKeyin classEC2TemplateOptions
-
nameTask
- Overrides:
nameTaskin classEC2TemplateOptions- Returns:
- What to call the task relating to this script; default
jclouds-script-timestampwhere timestamp is millis since epoch
-
runAsRoot
- Overrides:
runAsRootin 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:
runScriptin classEC2TemplateOptions
-
overrideLoginCredentials
- Overrides:
overrideLoginCredentialsin classEC2TemplateOptions
-
overrideLoginPassword
- Overrides:
overrideLoginPasswordin classEC2TemplateOptions
-
overrideLoginPrivateKey
- Overrides:
overrideLoginPrivateKeyin classEC2TemplateOptions
-
overrideLoginUser
- Overrides:
overrideLoginUserin classEC2TemplateOptions
-
overrideAuthenticateSudo
- Overrides:
overrideAuthenticateSudoin 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
-