Class NovaTemplateOptions
java.lang.Object
org.jclouds.compute.options.RunScriptOptions
org.jclouds.compute.options.TemplateOptions
org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions
- All Implemented Interfaces:
Cloneable
Contains options supported in the
ComputeService#runNode
operation on the
"openstack-nova" provider. Usage
The recommended way to instantiate a NovaTemplateOptions object is to statically import NovaTemplateOptions.* and invoke a static creation method followed by an instance mutator (if needed):
import static org.jclouds.aws.ec2.compute.options.NovaTemplateOptions.Builder.*;
ComputeService api = // get connection
templateBuilder.options(inboundPorts(22, 80, 8080, 443));
Setinvalid input: '<'? extends NodeMetadata> set = api.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
FieldsModifier and TypeFieldDescriptionprotected boolean
protected String
protected Set
<BlockDeviceMapping> protected boolean
protected String
protected boolean
protected String
protected byte[]
Fields inherited from class org.jclouds.compute.options.TemplateOptions
blockUntilRunning, inboundPorts, networks, nodeNames, NONE, 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.autoAssignFloatingIp
(boolean enable) availabilityZone
(String availabilityZone) blockDeviceMappings
(Iterable<BlockDeviceMapping> blockDeviceMappings) blockDeviceMappings
(BlockDeviceMapping... blockDeviceMappings) blockOnPort
(int port, int seconds) When the node is started, wait until the following port is activeblockUntilRunning
(boolean blockUntilRunning) Noteclone()
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
diskConfig
(String diskConfig) boolean
floatingIpPoolNames
(Iterable<String> floatingIpPoolNames) floatingIpPoolNames
(String... floatingIpPoolNames) generateKeyPair
(boolean enable) boolean
The floating IP pool name(s) to use when allocating a FloatingIP.Specifies the keypair used to run instances withbyte[]
int
hashCode()
inboundPorts
(int... ports) Opens the set of ports to public access.installPrivateKey
(String privateKey) replaces the rsa ssh key used at login.keyPairName
(String keyPairName)
Ensures NovaTemplateOptions can work with networks specified as Strings.
Ensures NovaTemplateOptions can work with networks specified as Strings.specifies names to be used for the created nodes.novaNetworks
(Set<Network> novaNetworks) overrideAuthenticateSudo
(boolean authenticateSudo) overrideLoginCredentials
(LoginCredentials overridingCredentials) overrideLoginPassword
(String password) overrideLoginPrivateKey
(String privateKey) overrideLoginUser
(String loginUser) runAsRoot
(boolean runAsRoot) This script will be executed as the root user upon system startup.boolean
Noteboolean
Notecom.google.common.base.MoreObjects.ToStringHelper
string()
userData
(byte[] userData) User data as bytes (not base64-encoded)userMetadata
(String key, String value) userMetadata
(Map<String, String> userMetadata) Methods inherited from class org.jclouds.compute.options.TemplateOptions
as, blockOnComplete, getGroups, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, runScript, securityGroups, securityGroups, shouldBlockUntilRunning, tags, wrapInInitScript
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
-
autoAssignFloatingIp
protected boolean autoAssignFloatingIp -
floatingIpPoolNames
-
generateKeyPair
protected boolean generateKeyPair -
keyPairName
-
userData
protected byte[] userData -
diskConfig
-
configDrive
protected boolean configDrive -
novaNetworks
-
availabilityZone
-
blockDeviceMappings
-
-
Constructor Details
-
NovaTemplateOptions
public NovaTemplateOptions()
-
-
Method Details
-
clone
- Overrides:
clone
in classTemplateOptions
-
copyTo
- Overrides:
copyTo
in classTemplateOptions
-
equals
- Overrides:
equals
in classTemplateOptions
-
hashCode
public int hashCode()- Overrides:
hashCode
in classTemplateOptions
-
string
public com.google.common.base.MoreObjects.ToStringHelper string()- Overrides:
string
in classTemplateOptions
-
autoAssignFloatingIp
- See Also:
-
floatingIpPoolNames
- See Also:
-
floatingIpPoolNames
- See Also:
-
generateKeyPair
- See Also:
-
keyPairName
- See Also:
-
shouldAutoAssignFloatingIp
public boolean shouldAutoAssignFloatingIp()- Returns:
- true if auto assignment of a floating ip to each vm is enabled
-
availabilityZone
- See Also:
-
blockDeviceMappings
- See Also:
-
blockDeviceMappings
- See Also:
-
getFloatingIpPoolNames
The floating IP pool name(s) to use when allocating a FloatingIP. Applicable only if #shouldAutoAssignFloatingIp() returns true. If not set will attempt to use whatever FloatingIP(s) can be found regardless of which pool they originated from- Returns:
- floating-ip-pool names to use
-
getKeyPairName
Specifies the keypair used to run instances with- Returns:
- the keypair to be used
-
shouldGenerateKeyPair
public boolean shouldGenerateKeyPair()- Returns:
- true if auto generation of keypairs is enabled
-
getUserData
public byte[] getUserData() -
getDiskConfig
- See Also:
-
getConfigDrive
public boolean getConfigDrive()- See Also:
-
getNovaNetworks
- See Also:
-
getAvailabilityZone
- See Also:
-
getBlockDeviceMappings
-
blockOnPort
When the node is started, wait until the following port is active- Overrides:
blockOnPort
in classTemplateOptions
-
inboundPorts
Opens the set of ports to public access.- Overrides:
inboundPorts
in classTemplateOptions
-
authorizePublicKey
authorize an rsa ssh key.- Overrides:
authorizePublicKey
in classTemplateOptions
-
installPrivateKey
replaces the rsa ssh key used at login.- Overrides:
installPrivateKey
in classTemplateOptions
-
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 classTemplateOptions
- Parameters:
blockUntilRunning
- (default true) whether to block until the nodes in this template are ininvalid reference
Status#RUNNING
-
dontAuthorizePublicKey
- Overrides:
dontAuthorizePublicKey
in classTemplateOptions
-
nameTask
- Overrides:
nameTask
in classTemplateOptions
- Returns:
- What to call the task relating to this script; default
jclouds-script-timestamp
where timestamp is millis since epoch
-
runAsRoot
- Overrides:
runAsRoot
in classTemplateOptions
-
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 classTemplateOptions
-
overrideLoginCredentials
- Overrides:
overrideLoginCredentials
in classTemplateOptions
-
overrideLoginPassword
- Overrides:
overrideLoginPassword
in classTemplateOptions
-
overrideLoginPrivateKey
- Overrides:
overrideLoginPrivateKey
in classTemplateOptions
-
overrideLoginUser
- Overrides:
overrideLoginUser
in classTemplateOptions
-
overrideAuthenticateSudo
- Overrides:
overrideAuthenticateSudo
in classTemplateOptions
-
userMetadata
- Overrides:
userMetadata
in classTemplateOptions
- Parameters:
userMetadata
- user-defined metadata to assign to this server
-
userMetadata
- Overrides:
userMetadata
in classTemplateOptions
- 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 classTemplateOptions
-
networks
Ensures NovaTemplateOptions can work with networks specified as Strings. Also provides for compatibility with the abstraction layer.- Overrides:
networks
in classTemplateOptions
-
networks
Ensures NovaTemplateOptions can work with networks specified as Strings. Also provides for compatibility with the abstraction layer.- Overrides:
networks
in classTemplateOptions
- See Also:
-
userData
User data as bytes (not base64-encoded) -
diskConfig
- See Also:
-
configDrive
OpenStack can be configured to write metadata to a special configuration drive that will be attached to the instance when it boots. The instance can retrieve any information that would normally be available through the metadata service by mounting this disk and reading files from it. To enable the config drive, set this parameter to "true". This has to be enabled for user data cases.- See Also:
-
novaNetworks
- Parameters:
novaNetworks
- The list of network declarations. Nova-specific network declarations allow for specifying network UUIDs, port UUIDs, and fixed IPs. Unlinenetworks(Iterable)
this supports setting additional network parameters and not just network UUIDs.- See Also:
-