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.runNodesWithTag(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.runNodesWithTag(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
blockOnComplete, overridingCredentials, port, runAsRoot, seconds, taskName, wrapInInitScript
 
Constructor Summary
SoftLayerTemplateOptions()
           
 
Method Summary
 SoftLayerTemplateOptions authorizePublicKey(Payload publicKey)
          Deprecated. 
 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(Payload privateKey)
          Deprecated. 
 SoftLayerTemplateOptions installPrivateKey(String privateKey)
          replaces the rsa ssh key used at login.
 SoftLayerTemplateOptions runScript(byte[] script)
          Deprecated. 
 SoftLayerTemplateOptions runScript(Payload script)
           
 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, overrideCredentialsWith, overrideLoginCredentialWith, overrideLoginUserWith, runAsRoot, runScript, shouldBlockUntilRunning, tags, toString, wrapInInitScript
 
Methods inherited from class org.jclouds.compute.options.RunScriptOptions
getOverridingCredentials, getPort, getSeconds, getTaskName, 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)

authorizePublicKey

@Deprecated
public SoftLayerTemplateOptions authorizePublicKey(Payload publicKey)
Deprecated. 

Description copied from class: TemplateOptions
authorize an rsa ssh key.

please use alternative that uses String

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

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)

installPrivateKey

@Deprecated
public SoftLayerTemplateOptions installPrivateKey(Payload privateKey)
Deprecated. 

Description copied from class: TemplateOptions
replaces the rsa ssh key used at login.

please use alternative that uses String

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

runScript

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

runScript

@Deprecated
public SoftLayerTemplateOptions runScript(byte[] script)
Deprecated. 

Description copied from class: TemplateOptions

please use alternative that uses the Statement object

Overrides:
runScript in class TemplateOptions
See Also:
TemplateOptions.runScript(byte[])

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-2011 jclouds. All Rights Reserved.