Class SoftLayerTemplateOptions
- java.lang.Object
-
- org.jclouds.compute.options.RunScriptOptions
-
- org.jclouds.compute.options.TemplateOptions
-
- org.jclouds.softlayer.compute.options.SoftLayerTemplateOptions
-
- All Implemented Interfaces:
Cloneable
public class SoftLayerTemplateOptions 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 aSoftLayerTemplateOptionsobject is to statically importSoftLayerTemplateOptions.*and invoke a static creation method followed by an instance mutator (if needed):import static org.jclouds.compute.options.SoftLayerTemplateOptions.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 classSoftLayerTemplateOptions.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 Modifier and Type Field Description protected List<Integer>blockDevicesprotected BooleandedicatedAccountHostOnlyFlagprotected StringdiskTypeprotected StringdomainNameprotected BooleanhourlyBillingFlagprotected IntegerportSpeedprotected StringpostInstallScriptUriprotected IntegerprimaryBackendNetworkComponentNetworkVlanIdprotected IntegerprimaryNetworkComponentNetworkVlanIdprotected BooleanprivateNetworkOnlyFlagprotected List<Integer>sshKeysprotected StringuserData-
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 SoftLayerTemplateOptions()
-
Method Summary
-
Methods inherited from class org.jclouds.compute.options.TemplateOptions
as, blockOnComplete, equals, getGroups, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, hashCode, 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, toString
-
-
-
-
Field Detail
-
domainName
protected String domainName
-
diskType
protected String diskType
-
portSpeed
protected Integer portSpeed
-
userData
protected String userData
-
primaryNetworkComponentNetworkVlanId
protected Integer primaryNetworkComponentNetworkVlanId
-
primaryBackendNetworkComponentNetworkVlanId
protected Integer primaryBackendNetworkComponentNetworkVlanId
-
hourlyBillingFlag
protected Boolean hourlyBillingFlag
-
dedicatedAccountHostOnlyFlag
protected Boolean dedicatedAccountHostOnlyFlag
-
privateNetworkOnlyFlag
protected Boolean privateNetworkOnlyFlag
-
postInstallScriptUri
protected String postInstallScriptUri
-
-
Method Detail
-
clone
public SoftLayerTemplateOptions clone()
- Overrides:
clonein classTemplateOptions
-
copyTo
public void copyTo(TemplateOptions to)
- Overrides:
copyToin classTemplateOptions
-
domainName
public SoftLayerTemplateOptions domainName(String domainName)
will replace the default domain used when ordering virtual guests. Note this needs to contain a public suffix!- See Also:
VirtualGuestApi.createVirtualGuest(org.jclouds.softlayer.domain.VirtualGuest),InternetDomainName.hasPublicSuffix()
-
blockDevices
public SoftLayerTemplateOptions blockDevices(Iterable<Integer> capacities)
-
blockDevices
public SoftLayerTemplateOptions blockDevices(Integer... capacities)
-
diskType
public SoftLayerTemplateOptions diskType(@Nullable String diskType)
-
portSpeed
public SoftLayerTemplateOptions portSpeed(@Nullable Integer portSpeed)
-
userData
public SoftLayerTemplateOptions userData(@Nullable String userData)
-
primaryNetworkComponentNetworkVlanId
public SoftLayerTemplateOptions primaryNetworkComponentNetworkVlanId(@Nullable Integer primaryNetworkComponentNetworkVlanId)
-
primaryBackendNetworkComponentNetworkVlanId
public SoftLayerTemplateOptions primaryBackendNetworkComponentNetworkVlanId(@Nullable Integer primaryBackendNetworkComponentNetworkVlanId)
-
hourlyBillingFlag
public SoftLayerTemplateOptions hourlyBillingFlag(@Nullable Boolean hourlyBillingFlag)
-
dedicatedAccountHostOnlyFlag
public SoftLayerTemplateOptions dedicatedAccountHostOnlyFlag(@Nullable Boolean dedicatedAccountHostOnlyFlag)
-
privateNetworkOnlyFlag
public SoftLayerTemplateOptions privateNetworkOnlyFlag(@Nullable Boolean privateNetworkOnlyFlag)
-
postInstallScriptUri
public SoftLayerTemplateOptions postInstallScriptUri(@Nullable String postInstallScriptUri)
-
sshKeys
public SoftLayerTemplateOptions sshKeys(Iterable<Integer> sshKeys)
-
sshKeys
public SoftLayerTemplateOptions sshKeys(Integer... sshKeys)
-
getDomainName
public String getDomainName()
-
getDiskType
public String getDiskType()
-
getPortSpeed
public Integer getPortSpeed()
-
getUserData
public String getUserData()
-
getPrimaryNetworkComponentNetworkVlanId
public Integer getPrimaryNetworkComponentNetworkVlanId()
-
getPrimaryBackendNetworkComponentNetworkVlanId
public Integer getPrimaryBackendNetworkComponentNetworkVlanId()
-
isHourlyBillingFlag
public Boolean isHourlyBillingFlag()
-
isDedicatedAccountHostOnlyFlag
public Boolean isDedicatedAccountHostOnlyFlag()
-
isPrivateNetworkOnlyFlag
public Boolean isPrivateNetworkOnlyFlag()
-
getPostInstallScriptUri
public String getPostInstallScriptUri()
-
blockOnPort
public SoftLayerTemplateOptions blockOnPort(int port, int seconds)
When the node is started, wait until the following port is active- Overrides:
blockOnPortin classTemplateOptions
-
inboundPorts
public SoftLayerTemplateOptions inboundPorts(int... ports)
Opens the set of ports to public access.- Overrides:
inboundPortsin classTemplateOptions
-
authorizePublicKey
public SoftLayerTemplateOptions authorizePublicKey(String publicKey)
authorize an rsa ssh key.- Overrides:
authorizePublicKeyin classTemplateOptions
-
installPrivateKey
public SoftLayerTemplateOptions installPrivateKey(String privateKey)
replaces the rsa ssh key used at login.- Overrides:
installPrivateKeyin classTemplateOptions
-
blockUntilRunning
public SoftLayerTemplateOptions 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:
blockUntilRunningin classTemplateOptions- Parameters:
blockUntilRunning- (default true) whether to block until the nodes in this template are inStatus#RUNNINGstate
-
dontAuthorizePublicKey
public SoftLayerTemplateOptions dontAuthorizePublicKey()
- Overrides:
dontAuthorizePublicKeyin classTemplateOptions
-
nameTask
public SoftLayerTemplateOptions nameTask(String name)
- Overrides:
nameTaskin classTemplateOptions- Returns:
- What to call the task relating to this script; default
jclouds-script-timestampwhere timestamp is millis since epoch
-
runAsRoot
public SoftLayerTemplateOptions runAsRoot(boolean runAsRoot)
- Overrides:
runAsRootin classTemplateOptions
-
runScript
public SoftLayerTemplateOptions 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:
runScriptin classTemplateOptions
-
overrideLoginCredentials
public SoftLayerTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
- Overrides:
overrideLoginCredentialsin classTemplateOptions
-
overrideLoginPassword
public SoftLayerTemplateOptions overrideLoginPassword(String password)
- Overrides:
overrideLoginPasswordin classTemplateOptions
-
overrideLoginPrivateKey
public SoftLayerTemplateOptions overrideLoginPrivateKey(String privateKey)
- Overrides:
overrideLoginPrivateKeyin classTemplateOptions
-
overrideLoginUser
public SoftLayerTemplateOptions overrideLoginUser(String loginUser)
- Overrides:
overrideLoginUserin classTemplateOptions
-
overrideAuthenticateSudo
public SoftLayerTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
- Overrides:
overrideAuthenticateSudoin classTemplateOptions
-
userMetadata
public SoftLayerTemplateOptions userMetadata(Map<String,String> userMetadata)
- Overrides:
userMetadatain classTemplateOptions- Parameters:
userMetadata- user-defined metadata to assign to this server
-
userMetadata
public SoftLayerTemplateOptions userMetadata(String key, String value)
- Overrides:
userMetadatain classTemplateOptions- Parameters:
key- key to place into the metadata mapvalue- value to associate with that key
-
nodeNames
public SoftLayerTemplateOptions 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:
nodeNamesin classTemplateOptions
-
networks
public SoftLayerTemplateOptions networks(Iterable<String> networks)
Assigns the created nodes to these networks- Overrides:
networksin classTemplateOptions
-
-