Class CloudStackTemplateOptions
- java.lang.Object
-
- org.jclouds.compute.options.RunScriptOptions
-
- org.jclouds.compute.options.TemplateOptions
-
- org.jclouds.cloudstack.compute.options.CloudStackTemplateOptions
-
- All Implemented Interfaces:
Cloneable
public class CloudStackTemplateOptions extends TemplateOptions implements Cloneable
Contains options supported by theComputeService#createNodesInGroup(String, int, TemplateOptions)
andComputeService#createNodesInGroup(String, int, TemplateOptions)
operations on the gogrid provider.Usage
The recommended way to instantiate aCloudStackTemplateOptions
object is to statically importCloudStackTemplateOptions.*
and invoke a static creation method followed by an instance mutator (if needed):import static org.jclouds.compute.options.CloudStackTemplateOptions.Builder.*; ComputeService client = // get connection templateBuilder.options(inboundPorts(22, 80, 8080, 443)); Set<? extends NodeMetadata> set = client.createNodesInGroup(tag, 2, templateBuilder.build());
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CloudStackTemplateOptions.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
-
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 Constructor Description CloudStackTemplateOptions()
-
Method Summary
-
Methods inherited from class org.jclouds.compute.options.TemplateOptions
as, blockOnComplete, getGroups, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, networks, runScript, securityGroups, securityGroups, shouldBlockUntilRunning, string, 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
-
-
-
-
Method Detail
-
securityGroupIds
public CloudStackTemplateOptions securityGroupIds(Iterable<String> securityGroupIds)
-
ipsToNetworks
public CloudStackTemplateOptions ipsToNetworks(Map<String,String> ipsToNetworks)
-
ipOnDefaultNetwork
public CloudStackTemplateOptions ipOnDefaultNetwork(String ipOnDefaultNetwork)
-
keyPair
public CloudStackTemplateOptions keyPair(String keyPair)
-
setupStaticNat
public CloudStackTemplateOptions setupStaticNat(boolean setupStaticNat)
-
account
public CloudStackTemplateOptions account(String account)
-
domainId
public CloudStackTemplateOptions domainId(String domainId)
-
generateKeyPair
public CloudStackTemplateOptions generateKeyPair(boolean generateKeyPair)
-
generateSecurityGroup
public CloudStackTemplateOptions generateSecurityGroup(boolean generateSecurityGroup)
-
diskOfferingId
public CloudStackTemplateOptions diskOfferingId(String diskOfferingId)
-
dataDiskSize
public CloudStackTemplateOptions dataDiskSize(int dataDiskSize)
-
userData
public CloudStackTemplateOptions userData(byte[] userData)
-
userData
public CloudStackTemplateOptions userData(String userData)
-
userData
public CloudStackTemplateOptions userData(URL userDataUrl) throws IOException
- Throws:
IOException
-
getIpOnDefaultNetwork
public String getIpOnDefaultNetwork()
-
getKeyPair
public String getKeyPair()
-
shouldSetupStaticNat
public boolean shouldSetupStaticNat()
-
getAccount
public String getAccount()
-
getDomainId
public String getDomainId()
-
shouldGenerateKeyPair
public boolean shouldGenerateKeyPair()
-
shouldGenerateSecurityGroup
public boolean shouldGenerateSecurityGroup()
-
getDiskOfferingId
public String getDiskOfferingId()
-
getDataDiskSize
public int getDataDiskSize()
-
getUserData
public byte[] getUserData()
-
clone
public CloudStackTemplateOptions clone()
- Overrides:
clone
in classTemplateOptions
-
copyTo
public void copyTo(TemplateOptions to)
- Overrides:
copyTo
in classTemplateOptions
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classTemplateOptions
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classTemplateOptions
-
toString
public String toString()
- Overrides:
toString
in classRunScriptOptions
-
blockOnPort
public CloudStackTemplateOptions blockOnPort(int port, int seconds)
When the node is started, wait until the following port is active- Overrides:
blockOnPort
in classTemplateOptions
-
inboundPorts
public CloudStackTemplateOptions inboundPorts(int... ports)
Opens the set of ports to public access.- Overrides:
inboundPorts
in classTemplateOptions
-
authorizePublicKey
public CloudStackTemplateOptions authorizePublicKey(String publicKey)
authorize an rsa ssh key.- Overrides:
authorizePublicKey
in classTemplateOptions
-
installPrivateKey
public CloudStackTemplateOptions installPrivateKey(String privateKey)
replaces the rsa ssh key used at login.- Overrides:
installPrivateKey
in classTemplateOptions
-
blockUntilRunning
public CloudStackTemplateOptions blockUntilRunning(boolean 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 inStatus#RUNNING
state
-
dontAuthorizePublicKey
public CloudStackTemplateOptions dontAuthorizePublicKey()
- Overrides:
dontAuthorizePublicKey
in classTemplateOptions
-
nameTask
public CloudStackTemplateOptions nameTask(String name)
- 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
public CloudStackTemplateOptions runAsRoot(boolean runAsRoot)
- Overrides:
runAsRoot
in classTemplateOptions
-
runScript
public CloudStackTemplateOptions 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 classTemplateOptions
-
overrideLoginCredentials
public CloudStackTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
- Overrides:
overrideLoginCredentials
in classTemplateOptions
-
overrideLoginPassword
public CloudStackTemplateOptions overrideLoginPassword(String password)
- Overrides:
overrideLoginPassword
in classTemplateOptions
-
overrideLoginPrivateKey
public CloudStackTemplateOptions overrideLoginPrivateKey(String privateKey)
- Overrides:
overrideLoginPrivateKey
in classTemplateOptions
-
overrideLoginUser
public CloudStackTemplateOptions overrideLoginUser(String loginUser)
- Overrides:
overrideLoginUser
in classTemplateOptions
-
overrideAuthenticateSudo
public CloudStackTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
- Overrides:
overrideAuthenticateSudo
in classTemplateOptions
-
userMetadata
public CloudStackTemplateOptions userMetadata(Map<String,String> userMetadata)
- Overrides:
userMetadata
in classTemplateOptions
- Parameters:
userMetadata
- user-defined metadata to assign to this server
-
userMetadata
public CloudStackTemplateOptions userMetadata(String key, String value)
- Overrides:
userMetadata
in classTemplateOptions
- Parameters:
key
- key to place into the metadata mapvalue
- value to associate with that key
-
nodeNames
public CloudStackTemplateOptions nodeNames(Iterable<String> 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
public CloudStackTemplateOptions networks(Iterable<String> networks)
Assigns the created nodes to these networks- Overrides:
networks
in classTemplateOptions
-
-