public class NovaTemplateOptions extends TemplateOptions implements Cloneable
ComputeService#runNode
operation on the
"openstack-nova" provider.
import static org.jclouds.aws.ec2.compute.options.NovaTemplateOptions.Builder.*;
ComputeService api = // get connection
templateBuilder.options(inboundPorts(22, 80, 8080, 443));
Set extends NodeMetadata> set = api.createNodesInGroup(tag, 2, templateBuilder.build());
Modifier and Type | Class and Description |
---|---|
static class |
NovaTemplateOptions.Builder |
TemplateOptions.ImmutableTemplateOptions
RunScriptOptions.ImmutableRunScriptOptions
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoAssignFloatingIp |
protected boolean |
configDrive |
protected String |
diskConfig |
protected boolean |
generateKeyPair |
protected String |
keyPairName |
static NovaTemplateOptions |
NONE |
protected Set<Network> |
novaNetworks |
protected com.google.common.base.Optional<Set<String>> |
securityGroupNames |
protected byte[] |
userData |
blockUntilRunning, inboundPorts, networks, nodeNames, privateKey, publicKey, script, securityGroups, tags, userMetadata
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
Constructor and Description |
---|
NovaTemplateOptions() |
Modifier and Type | Method and Description |
---|---|
NovaTemplateOptions |
authorizePublicKey(String publicKey)
authorize an rsa ssh key.
|
NovaTemplateOptions |
autoAssignFloatingIp(boolean enable) |
NovaTemplateOptions |
blockOnPort(int port,
int seconds)
When the node is started, wait until the following port is active
|
NovaTemplateOptions |
blockUntilRunning(boolean blockUntilRunning)
Note
|
NovaTemplateOptions |
clone() |
NovaTemplateOptions |
configDrive(boolean configDrive)
OpenStack can be configured to write metadata to a special configuration drive that will be
attached to the instance when it boots.
|
void |
copyTo(TemplateOptions to) |
NovaTemplateOptions |
diskConfig(String diskConfig) |
NovaTemplateOptions |
dontAuthorizePublicKey() |
boolean |
equals(Object o) |
NovaTemplateOptions |
generateKeyPair(boolean enable) |
boolean |
getConfigDrive() |
String |
getDiskConfig() |
String |
getKeyPairName()
Specifies the keypair used to run instances with
|
Set<Network> |
getNovaNetworks() |
com.google.common.base.Optional<Set<String>> |
getSecurityGroupNames()
if unset, generate a default group prefixed with
jclouds# according
to TemplateOptions.getInboundPorts() |
byte[] |
getUserData() |
int |
hashCode() |
NovaTemplateOptions |
inboundPorts(int... ports)
Opens the set of ports to public access.
|
NovaTemplateOptions |
installPrivateKey(String privateKey)
replaces the rsa ssh key used at login.
|
NovaTemplateOptions |
keyPairName(String keyPairName) |
NovaTemplateOptions |
nameTask(String name) |
NovaTemplateOptions |
networks(Iterable<String> networks)
Ensures NovaTemplateOptions can work with networks specified as Strings. |
NovaTemplateOptions |
networks(String... networks)
Ensures NovaTemplateOptions can work with networks specified as Strings. |
NovaTemplateOptions |
nodeNames(Iterable<String> nodeNames)
specifies names to be used for the created nodes.
|
NovaTemplateOptions |
novaNetworks(Set<Network> novaNetworks) |
NovaTemplateOptions |
overrideAuthenticateSudo(boolean authenticateSudo) |
NovaTemplateOptions |
overrideLoginCredentials(LoginCredentials overridingCredentials) |
NovaTemplateOptions |
overrideLoginPassword(String password) |
NovaTemplateOptions |
overrideLoginPrivateKey(String privateKey) |
NovaTemplateOptions |
overrideLoginUser(String loginUser) |
NovaTemplateOptions |
runAsRoot(boolean runAsRoot) |
NovaTemplateOptions |
runScript(Statement script)
This script will be executed as the root user upon system startup.
|
NovaTemplateOptions |
securityGroupNames(Iterable<String> securityGroupNames) |
NovaTemplateOptions |
securityGroupNames(String... securityGroupNames) |
boolean |
shouldAutoAssignFloatingIp()
Note
|
boolean |
shouldGenerateKeyPair()
Note
|
com.google.common.base.Objects.ToStringHelper |
string() |
NovaTemplateOptions |
userData(byte[] userData)
User data as bytes (not base64-encoded)
|
NovaTemplateOptions |
userMetadata(Map<String,String> userMetadata) |
NovaTemplateOptions |
userMetadata(String key,
String value) |
as, blockOnComplete, getGroups, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, runScript, securityGroups, securityGroups, shouldBlockUntilRunning, tags, wrapInInitScript
getLoginPassword, getLoginPrivateKey, getLoginUser, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript, toString
protected boolean autoAssignFloatingIp
protected boolean generateKeyPair
protected String keyPairName
protected byte[] userData
protected String diskConfig
protected boolean configDrive
public static final NovaTemplateOptions NONE
public NovaTemplateOptions 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.Objects.ToStringHelper string()
string
in class TemplateOptions
public NovaTemplateOptions autoAssignFloatingIp(boolean enable)
shouldAutoAssignFloatingIp()
public NovaTemplateOptions generateKeyPair(boolean enable)
shouldGenerateKeyPair()
public NovaTemplateOptions keyPairName(String keyPairName)
shouldGenerateKeyPair()
public NovaTemplateOptions securityGroupNames(String... securityGroupNames)
public NovaTemplateOptions securityGroupNames(Iterable<String> securityGroupNames)
public boolean shouldAutoAssignFloatingIp()
NovaApi#getExtensionForZone(String)
to return
present
public String getKeyPairName()
public boolean shouldGenerateKeyPair()
NovaApi#getKeyPairExtensionForZone(String)
to return
present
public com.google.common.base.Optional<Set<String>> getSecurityGroupNames()
jclouds#
according
to TemplateOptions.getInboundPorts()
public byte[] getUserData()
public String getDiskConfig()
CreateServerOptions.getDiskConfig()
public boolean getConfigDrive()
CreateServerOptions.getConfigDrive()
public Set<Network> getNovaNetworks()
CreateServerOptions.getNetworks()
public NovaTemplateOptions blockOnPort(int port, int seconds)
blockOnPort
in class TemplateOptions
public NovaTemplateOptions inboundPorts(int... ports)
inboundPorts
in class TemplateOptions
public NovaTemplateOptions authorizePublicKey(String publicKey)
authorizePublicKey
in class TemplateOptions
public NovaTemplateOptions installPrivateKey(String privateKey)
installPrivateKey
in class TemplateOptions
public NovaTemplateOptions 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 NovaTemplateOptions dontAuthorizePublicKey()
dontAuthorizePublicKey
in class TemplateOptions
public NovaTemplateOptions nameTask(String name)
nameTask
in class TemplateOptions
jclouds-script-timestamp
where timestamp is millis since
epochpublic NovaTemplateOptions runAsRoot(boolean runAsRoot)
runAsRoot
in class TemplateOptions
public NovaTemplateOptions runScript(Statement script)
runScript
in class TemplateOptions
public NovaTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
overrideLoginCredentials
in class TemplateOptions
public NovaTemplateOptions overrideLoginPassword(String password)
overrideLoginPassword
in class TemplateOptions
public NovaTemplateOptions overrideLoginPrivateKey(String privateKey)
overrideLoginPrivateKey
in class TemplateOptions
public NovaTemplateOptions overrideLoginUser(String loginUser)
overrideLoginUser
in class TemplateOptions
public NovaTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
overrideAuthenticateSudo
in class TemplateOptions
public NovaTemplateOptions userMetadata(Map<String,String> userMetadata)
userMetadata
in class TemplateOptions
userMetadata
- user-defined metadata to assign to this serverpublic NovaTemplateOptions userMetadata(String key, String value)
userMetadata
in class TemplateOptions
key
- key to place into the metadata mapvalue
- value to associate with that keypublic NovaTemplateOptions nodeNames(Iterable<String> nodeNames)
nodeNames
in class TemplateOptions
public NovaTemplateOptions networks(Iterable<String> networks)
networks
in class TemplateOptions
public NovaTemplateOptions networks(String... networks)
networks
in class TemplateOptions
TemplateOptions.networks(Iterable)
public NovaTemplateOptions userData(byte[] userData)
public NovaTemplateOptions diskConfig(String diskConfig)
CreateServerOptions.getDiskConfig()
public NovaTemplateOptions configDrive(boolean configDrive)
CreateServerOptions.getConfigDrive()
public NovaTemplateOptions novaNetworks(Set<Network> novaNetworks)
novaNetworks
- The list of network declarations.
Nova-specific network declarations allow for specifying network UUIDs, port UUIDs, and fixed IPs.
Unline networks(Iterable)
this supports setting additional network parameters and not just network UUIDs.CreateServerOptions.getNetworks()
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.