|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jclouds.compute.options.RunScriptOptions org.jclouds.compute.options.TemplateOptions
public class TemplateOptions
Contains options supported in the ComputeService#runNodesWithTag
operation.
import static org.jclouds.compute.options.TemplateOptions.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
TemplateOptions.Builder
static class
TemplateOptions.ImmutableTemplateOptions
Nested classes/interfaces inherited from class org.jclouds.compute.options.RunScriptOptions
RunScriptOptions.ImmutableRunScriptOptions
Field Summary
protected boolean
blockUntilRunning
protected int[]
inboundPorts
static TemplateOptions
NONE
protected String
privateKey
protected String
publicKey
protected Statement
script
protected Set<String>
tags
protected Map<String,String>
userMetadata
Fields inherited from class org.jclouds.compute.options.RunScriptOptions
blockOnComplete, overridingCredentials, port, runAsRoot, seconds, taskName, wrapInInitScript
Constructor Summary
TemplateOptions()
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
NONE
public static final TemplateOptions NONE
inboundPorts
protected int[] inboundPorts
script
protected Statement script
tags
protected Set<String> tags
privateKey
protected String privateKey
publicKey
protected String publicKey
blockUntilRunning
protected boolean blockUntilRunning
userMetadata
protected Map<String,String> userMetadata
Constructor Detail
TemplateOptions
public TemplateOptions()
Method Detail
clone
public TemplateOptions clone()
- Overrides:
clone
in class Object
copyTo
public void copyTo(TemplateOptions to)
getInboundPorts
public int[] getInboundPorts()
getRunScript
public Statement getRunScript()
getTags
public Set<String> getTags()
getPrivateKey
public String getPrivateKey()
getPublicKey
public String getPublicKey()
shouldBlockUntilRunning
public boolean shouldBlockUntilRunning()
- See Also:
TemplateOptions.ImmutableTemplateOptions.blockUntilRunning(boolean)
as
public <T extends TemplateOptions> T as(Class<T> clazz)
runScript
@Deprecated
public TemplateOptions runScript(byte[] script)
- Deprecated.
-
please use alternative that uses the
Statement
object
- See Also:
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
,
Payloads
runScript
public TemplateOptions runScript(Payload script)
- See Also:
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
,
Payloads
runScript
public TemplateOptions 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
installPrivateKey
public TemplateOptions installPrivateKey(String privateKey)
- replaces the rsa ssh key used at login.
installPrivateKey
@Deprecated
public TemplateOptions installPrivateKey(Payload privateKey)
- Deprecated.
- replaces the rsa ssh key used at login.
please use alternative that uses
String
- See Also:
Payloads
dontAuthorizePublicKey
public TemplateOptions dontAuthorizePublicKey()
authorizePublicKey
public TemplateOptions authorizePublicKey(String publicKey)
- authorize an rsa ssh key.
authorizePublicKey
@Deprecated
public TemplateOptions authorizePublicKey(Payload publicKey)
- Deprecated.
- authorize an rsa ssh key.
please use alternative that uses
String
- See Also:
Payloads
tags
public TemplateOptions tags(Iterable<String> tags)
- assigns tags to the created nodes
inboundPorts
public TemplateOptions inboundPorts(int... ports)
- Opens the set of ports to public access.
toString
public String toString()
- Overrides:
toString
in class RunScriptOptions
blockUntilRunning
public TemplateOptions blockUntilRunning(boolean blockUntilRunning)
Note
As of version 1.1.0, this option is incompatible with
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
and
RunScriptOptions.blockOnComplete(boolean)
, as all current
implementations utilize ssh in order to execute scripts.
- Parameters:
blockUntilRunning
- (default true) whether to block until the nodes in this template
are in NodeState.RUNNING
state
userMetadata
public TemplateOptions userMetadata(Map<String,String> userMetadata)
- Parameters:
userMetadata
- user-defined metadata to assign to this server
userMetadata
public TemplateOptions userMetadata(String key,
String value)
- Parameters:
key
- key to place into the metadata mapvalue
- value to associate with that key
getUserMetadata
public Map<String,String> getUserMetadata()
- See Also:
userMetadata(Map)
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
blockOnPort
public TemplateOptions 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 RunScriptOptions
nameTask
public TemplateOptions nameTask(String name)
- Overrides:
nameTask
in class RunScriptOptions
- Returns:
- What to call the task relating to this script; default
jclouds-script-timestamp
where timestamp is millis since epoch
runAsRoot
public TemplateOptions runAsRoot(boolean runAsRoot)
- Overrides:
runAsRoot
in class RunScriptOptions
overrideCredentialsWith
public TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
- Overrides:
overrideCredentialsWith
in class RunScriptOptions
overrideLoginUserWith
public TemplateOptions overrideLoginUserWith(String loginUser)
- Overrides:
overrideLoginUserWith
in class RunScriptOptions
overrideLoginCredentialWith
public TemplateOptions overrideLoginCredentialWith(String loginCredential)
- Overrides:
overrideLoginCredentialWith
in class RunScriptOptions
wrapInInitScript
public TemplateOptions wrapInInitScript(boolean wrapInInitScript)
- Description copied from class:
RunScriptOptions
- default true
- Overrides:
wrapInInitScript
in class RunScriptOptions
- Parameters:
wrapInInitScript
- if the command is long-running, use this option to ensure it is wrapInInitScripted
properly. (ex. have jclouds wrap it an init script, nohup, etc)
- Returns:
blockOnComplete
public TemplateOptions blockOnComplete(boolean blockOnComplete)
- Description copied from class:
RunScriptOptions
- As of version 1.1.0, we cannot kick off a script unless a node is in
RUNNING state.
- Overrides:
blockOnComplete
in class RunScriptOptions
- Parameters:
blockOnComplete
- (default true)
false means kick off the script in the background, but don't
wait for it to finish. (as of version 1.1.0, implemented as
nohup)
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2009-2011 jclouds. All Rights Reserved.