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.ImmutableTemplateOptionsNested classes/interfaces inherited from class org.jclouds.compute.options.RunScriptOptions
RunScriptOptions.ImmutableRunScriptOptions -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected Set<BlockDeviceMapping> protected booleanprotected Stringprotected booleanprotected Stringprotected byte[]Fields inherited from class org.jclouds.compute.options.TemplateOptions
blockUntilRunning, inboundPorts, networks, nodeNames, NONE, 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.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.voiddiskConfig(String diskConfig) booleanfloatingIpPoolNames(Iterable<String> floatingIpPoolNames) floatingIpPoolNames(String... floatingIpPoolNames) generateKeyPair(boolean enable) booleanThe floating IP pool name(s) to use when allocating a FloatingIP.Specifies the keypair used to run instances withbyte[]inthashCode()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.booleanNotebooleanNotecom.google.common.base.MoreObjects.ToStringHelperstring()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, wrapInInitScriptMethods 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:
clonein classTemplateOptions
-
copyTo
- Overrides:
copyToin classTemplateOptions
-
equals
- Overrides:
equalsin classTemplateOptions
-
hashCode
public int hashCode()- Overrides:
hashCodein classTemplateOptions
-
string
public com.google.common.base.MoreObjects.ToStringHelper string()- Overrides:
stringin 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:
blockOnPortin classTemplateOptions
-
inboundPorts
Opens the set of ports to public access.- Overrides:
inboundPortsin classTemplateOptions
-
authorizePublicKey
authorize an rsa ssh key.- Overrides:
authorizePublicKeyin classTemplateOptions
-
installPrivateKey
replaces the rsa ssh key used at login.- Overrides:
installPrivateKeyin 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:
blockUntilRunningin classTemplateOptions- Parameters:
blockUntilRunning- (default true) whether to block until the nodes in this template are instateinvalid reference
Status#RUNNING
-
dontAuthorizePublicKey
- Overrides:
dontAuthorizePublicKeyin classTemplateOptions
-
nameTask
- Overrides:
nameTaskin classTemplateOptions- Returns:
- What to call the task relating to this script; default
jclouds-script-timestampwhere timestamp is millis since epoch
-
runAsRoot
- Overrides:
runAsRootin 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:
runScriptin classTemplateOptions
-
overrideLoginCredentials
- Overrides:
overrideLoginCredentialsin classTemplateOptions
-
overrideLoginPassword
- Overrides:
overrideLoginPasswordin classTemplateOptions
-
overrideLoginPrivateKey
- Overrides:
overrideLoginPrivateKeyin classTemplateOptions
-
overrideLoginUser
- Overrides:
overrideLoginUserin classTemplateOptions
-
overrideAuthenticateSudo
- Overrides:
overrideAuthenticateSudoin classTemplateOptions
-
userMetadata
- Overrides:
userMetadatain classTemplateOptions- Parameters:
userMetadata- user-defined metadata to assign to this server
-
userMetadata
- Overrides:
userMetadatain 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:
nodeNamesin classTemplateOptions
-
networks
Ensures NovaTemplateOptions can work with networks specified as Strings. Also provides for compatibility with the abstraction layer.- Overrides:
networksin classTemplateOptions
-
networks
Ensures NovaTemplateOptions can work with networks specified as Strings. Also provides for compatibility with the abstraction layer.- Overrides:
networksin 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:
-