org.jclouds.softlayer.compute.options
Class SoftLayerTemplateOptions

java.lang.Object
  extended by org.jclouds.compute.options.RunScriptOptions
      extended by org.jclouds.compute.options.TemplateOptions
          extended by org.jclouds.softlayer.compute.options.SoftLayerTemplateOptions
All Implemented Interfaces:
Cloneable

public class SoftLayerTemplateOptions
extends TemplateOptions
implements Cloneable

Contains options supported by the ComputeService.createNodesInGroup(String, int, TemplateOptions) and ComputeService.createNodesInGroup(String, int, TemplateOptions) operations on the gogrid provider.

Usage

The recommended way to instantiate a SoftLayerTemplateOptions object is to statically import SoftLayerTemplateOptions.* 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());
 

Author:
Adrian Cole

Nested Class Summary
static class SoftLayerTemplateOptions.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
protected  String domainName
           
static SoftLayerTemplateOptions NONE
           
 
Fields inherited from class org.jclouds.compute.options.TemplateOptions
blockUntilRunning, inboundPorts, privateKey, publicKey, script, tags, userMetadata
 
Fields inherited from class org.jclouds.compute.options.RunScriptOptions
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
 
Constructor Summary
SoftLayerTemplateOptions()
           
 
Method Summary
 SoftLayerTemplateOptions authorizePublicKey(String publicKey)
          authorize an rsa ssh key.
 SoftLayerTemplateOptions blockOnPort(int port, int seconds)
          When the node is started, wait until the following port is active
 SoftLayerTemplateOptions clone()
           
 void copyTo(TemplateOptions to)
           
 TemplateOptions domainName(String domainName)
          will replace the default domain used when ordering virtual guests.
 String getDomainName()
           
 SoftLayerTemplateOptions inboundPorts(int... ports)
          Opens the set of ports to public access.
 SoftLayerTemplateOptions installPrivateKey(String privateKey)
          replaces the rsa ssh key used at login.
 SoftLayerTemplateOptions runScript(Payload script)
          Deprecated. 
 SoftLayerTemplateOptions userMetadata(Map<String,String> userMetadata)
          
 SoftLayerTemplateOptions userMetadata(String key, String value)
          
 
Methods inherited from class org.jclouds.compute.options.TemplateOptions
as, blockOnComplete, blockUntilRunning, dontAuthorizePublicKey, equals, getInboundPorts, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, hashCode, nameTask, overrideAuthenticateSudo, overrideCredentialsWith, overrideLoginCredentials, overrideLoginCredentialWith, overrideLoginPassword, overrideLoginPrivateKey, overrideLoginUser, overrideLoginUserWith, runAsRoot, runScript, runScript, shouldBlockUntilRunning, tags, toString, wrapInInitScript
 
Methods inherited from class org.jclouds.compute.options.RunScriptOptions
getLoginPassword, getLoginPrivateKey, getLoginUser, getOverridingCredentials, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

domainName

protected String domainName

NONE

public static final SoftLayerTemplateOptions NONE
Constructor Detail

SoftLayerTemplateOptions

public SoftLayerTemplateOptions()
Method Detail

clone

public SoftLayerTemplateOptions clone()
Overrides:
clone in class TemplateOptions

copyTo

public void copyTo(TemplateOptions to)
Overrides:
copyTo in class TemplateOptions

domainName

public TemplateOptions domainName(String domainName)
will replace the default domain used when ordering virtual guests. Note this needs to contain a public suffix!

See Also:
VirtualGuestClient.orderVirtualGuest(org.jclouds.softlayer.domain.ProductOrder), InternetDomainName.hasPublicSuffix()

getDomainName

public String getDomainName()

blockOnPort

public SoftLayerTemplateOptions blockOnPort(int port,
                                            int seconds)
Description copied from class: RunScriptOptions
When the node is started, wait until the following port is active

Overrides:
blockOnPort in class TemplateOptions
See Also:
TemplateOptions.blockOnPort(int, int)

inboundPorts

public SoftLayerTemplateOptions inboundPorts(int... ports)
Description copied from class: TemplateOptions
Opens the set of ports to public access.

Overrides:
inboundPorts in class TemplateOptions
See Also:
TemplateOptions.inboundPorts(int...)

authorizePublicKey

public SoftLayerTemplateOptions authorizePublicKey(String publicKey)
Description copied from class: TemplateOptions
authorize an rsa ssh key.

Overrides:
authorizePublicKey in class TemplateOptions
See Also:
TemplateOptions.authorizePublicKey(String)

installPrivateKey

public SoftLayerTemplateOptions installPrivateKey(String privateKey)
Description copied from class: TemplateOptions
replaces the rsa ssh key used at login.

Overrides:
installPrivateKey in class TemplateOptions
See Also:
TemplateOptions.installPrivateKey(String)

runScript

@Deprecated
public SoftLayerTemplateOptions runScript(Payload script)
Deprecated. 

Description copied from class: TemplateOptions
to be removed in jclouds 1.4.0

Overrides:
runScript in class TemplateOptions
See Also:
TemplateOptions.runScript(Payload)

userMetadata

public SoftLayerTemplateOptions userMetadata(Map<String,String> userMetadata)

Overrides:
userMetadata in class TemplateOptions
Parameters:
userMetadata - user-defined metadata to assign to this server

userMetadata

public SoftLayerTemplateOptions userMetadata(String key,
                                             String value)

Overrides:
userMetadata in class TemplateOptions
Parameters:
key - key to place into the metadata map
value - value to associate with that key


Copyright © 2009-2012 jclouds. All Rights Reserved.