|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jclouds.compute.options.RunScriptOptions org.jclouds.compute.options.TemplateOptions org.jclouds.ec2.compute.options.EC2TemplateOptions
public class EC2TemplateOptions
Contains options supported in the 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());
- Author:
- Adrian Cole
Nested Class Summary
static class
EC2TemplateOptions.Builder
Nested 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
static EC2TemplateOptions
NONE
Fields inherited from class org.jclouds.compute.options.TemplateOptions
blockUntilRunning, inboundPorts, privateKey, publicKey, script, tags, userMetadata
Fields inherited from class org.jclouds.compute.options.RunScriptOptions
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
Constructor Summary
EC2TemplateOptions()
Methods inherited from class org.jclouds.compute.options.TemplateOptions
as, blockOnComplete, getInboundPorts, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, runScript, shouldBlockUntilRunning, tags, wrapInInitScript
Methods inherited from class org.jclouds.compute.options.RunScriptOptions
getLoginPassword, getLoginPrivateKey, getLoginUser, getOverridingCredentials, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Field Detail
NONE
public static final EC2TemplateOptions NONE
Constructor Detail
EC2TemplateOptions
public EC2TemplateOptions()
Method Detail
clone
public EC2TemplateOptions clone()
- Overrides:
clone
in class TemplateOptions
copyTo
public void copyTo(TemplateOptions to)
- Overrides:
copyTo
in class TemplateOptions
securityGroups
public EC2TemplateOptions securityGroups(String... groupNames)
- See Also:
EC2TemplateOptions#securityGroups(Iterable)
securityGroups
public EC2TemplateOptions securityGroups(Iterable<String> groupNames)
- Specifies the security groups to be used for nodes with this template
userData
public EC2TemplateOptions userData(byte[] unencodedData)
- Unencoded data
keyPair
public EC2TemplateOptions keyPair(String keyPair)
- Specifies the keypair used to run instances with
noKeyPair
public EC2TemplateOptions noKeyPair()
- Do not use a keypair on instances
mapEBSSnapshotToDeviceName
public EC2TemplateOptions mapEBSSnapshotToDeviceName(String deviceName,
String snapshotId,
@Nullable
Integer sizeInGib,
boolean deleteOnTermination)
mapNewVolumeToDeviceName
public EC2TemplateOptions mapNewVolumeToDeviceName(String deviceName,
int sizeInGib,
boolean deleteOnTermination)
mapEphemeralDeviceToDeviceName
public EC2TemplateOptions mapEphemeralDeviceToDeviceName(String deviceName,
String virtualName)
unmapDeviceNamed
public EC2TemplateOptions unmapDeviceNamed(String deviceName)
blockDeviceMappings
public EC2TemplateOptions blockDeviceMappings(Iterable<? extends BlockDeviceMapping> blockDeviceMappings)
blockOnPort
public EC2TemplateOptions blockOnPort(int port,
int seconds)
- When the node is started, wait until the following port is active
- Overrides:
blockOnPort
in class TemplateOptions
inboundPorts
public EC2TemplateOptions inboundPorts(int... ports)
- Opens the set of ports to public access.
- Overrides:
inboundPorts
in class TemplateOptions
authorizePublicKey
public EC2TemplateOptions authorizePublicKey(String publicKey)
- authorize an rsa ssh key.
- Overrides:
authorizePublicKey
in class TemplateOptions
installPrivateKey
public EC2TemplateOptions installPrivateKey(String privateKey)
- replaces the rsa ssh key used at login.
- Overrides:
installPrivateKey
in class TemplateOptions
runScript
@Deprecated
public EC2TemplateOptions runScript(Payload script)
- Deprecated.
- to be removed in jclouds 1.4.0
- Overrides:
runScript
in class TemplateOptions
- See Also:
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
,
Payloads
blockUntilRunning
public EC2TemplateOptions blockUntilRunning(boolean blockUntilRunning)
Note
As of version 1.1.0, this option is incompatible with
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
and
RunScriptOptions.blockOnComplete(boolean)
, as all current
implementations utilize ssh in order to execute scripts.
- Overrides:
blockUntilRunning
in class TemplateOptions
- Parameters:
blockUntilRunning
- (default true) whether to block until the nodes in this template
are in NodeState.RUNNING
state
dontAuthorizePublicKey
public EC2TemplateOptions dontAuthorizePublicKey()
-
- Overrides:
dontAuthorizePublicKey
in class TemplateOptions
nameTask
public EC2TemplateOptions nameTask(String name)
-
- Overrides:
nameTask
in class TemplateOptions
- Returns:
- What to call the task relating to this script; default
jclouds-script-timestamp
where timestamp is millis since
epoch
runAsRoot
public EC2TemplateOptions runAsRoot(boolean runAsRoot)
-
- Overrides:
runAsRoot
in class TemplateOptions
runScript
public EC2TemplateOptions runScript(Statement script)
- 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 class TemplateOptions
overrideCredentialsWith
@Deprecated
public EC2TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
- Deprecated.
- to be removed in jclouds 1.4.0
- Overrides:
overrideCredentialsWith
in class TemplateOptions
- See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
overrideLoginUserWith
@Deprecated
public EC2TemplateOptions overrideLoginUserWith(String loginUser)
- Deprecated.
- to be removed in jclouds 1.4.0
- Overrides:
overrideLoginUserWith
in class TemplateOptions
- See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
overrideLoginCredentialWith
@Deprecated
public EC2TemplateOptions overrideLoginCredentialWith(String loginCredential)
- Deprecated.
- to be removed in jclouds 1.4.0
- Overrides:
overrideLoginCredentialWith
in class TemplateOptions
- See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
overrideLoginCredentials
public EC2TemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
-
- Overrides:
overrideLoginCredentials
in class TemplateOptions
overrideLoginPassword
public EC2TemplateOptions overrideLoginPassword(String password)
-
- Overrides:
overrideLoginPassword
in class TemplateOptions
overrideLoginPrivateKey
public EC2TemplateOptions overrideLoginPrivateKey(String privateKey)
-
- Overrides:
overrideLoginPrivateKey
in class TemplateOptions
overrideLoginUser
public EC2TemplateOptions overrideLoginUser(String loginUser)
-
- Overrides:
overrideLoginUser
in class TemplateOptions
overrideAuthenticateSudo
public EC2TemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
-
- Overrides:
overrideAuthenticateSudo
in class TemplateOptions
userMetadata
public EC2TemplateOptions userMetadata(Map<String,String> userMetadata)
-
- Overrides:
userMetadata
in class TemplateOptions
- Parameters:
userMetadata
- user-defined metadata to assign to this server
userMetadata
public EC2TemplateOptions userMetadata(String key,
String value)
-
- Overrides:
userMetadata
in class TemplateOptions
- Parameters:
key
- key to place into the metadata mapvalue
- value to associate with that key
getGroups
public Set<String> getGroups()
- Returns:
- groupNames the user specified to run instances with, or zero
length set to create an implicit group
getKeyPair
public String getKeyPair()
- Returns:
- keyPair to use when running the instance or null, to generate a
keypair.
shouldAutomaticallyCreateKeyPair
public boolean shouldAutomaticallyCreateKeyPair()
- Returns:
- true (default) if we are supposed to use a keypair
getUserData
public byte[] getUserData()
- Returns:
- unencoded user data.
getBlockDeviceMappings
public Set<BlockDeviceMapping> getBlockDeviceMappings()
- Returns:
- BlockDeviceMapping to use when running the instance or null.
hashCode
public int hashCode()
- Overrides:
hashCode
in class TemplateOptions
equals
public boolean equals(Object obj)
- Overrides:
equals
in class TemplateOptions
toString
public String toString()
- Overrides:
toString
in class TemplateOptions
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2009-2012 jclouds. All Rights Reserved.