|
||||||||||
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#createNodesInGroup
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.createNodesInGroup(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
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
Constructor Summary
TemplateOptions()
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
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(Payload script)
- Deprecated.
- to be removed in jclouds 1.4.0
- See Also:
TemplateOptions.ImmutableTemplateOptions.runScript(Statement)
,
Payloads
runScript
public TemplateOptions runScript(String 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
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.
dontAuthorizePublicKey
public TemplateOptions dontAuthorizePublicKey()
authorizePublicKey
public TemplateOptions authorizePublicKey(String publicKey)
- authorize an rsa ssh key.
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 RunScriptOptions
equals
public boolean equals(Object obj)
- Overrides:
equals
in class RunScriptOptions
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
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)
overrideCredentialsWith
@Deprecated
public TemplateOptions overrideCredentialsWith(Credentials overridingCredentials)
- Deprecated.
- Description copied from class:
RunScriptOptions
- to be removed in jclouds 1.4.0
- Overrides:
overrideCredentialsWith
in class RunScriptOptions
- See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
overrideLoginUserWith
@Deprecated
public TemplateOptions overrideLoginUserWith(String loginUser)
- Deprecated.
- Description copied from class:
RunScriptOptions
- to be removed in jclouds 1.4.0
- Overrides:
overrideLoginUserWith
in class RunScriptOptions
- See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
overrideLoginCredentialWith
@Deprecated
public TemplateOptions overrideLoginCredentialWith(String loginCredential)
- Deprecated.
- Description copied from class:
RunScriptOptions
- to be removed in jclouds 1.4.0
- Overrides:
overrideLoginCredentialWith
in class RunScriptOptions
- See Also:
RunScriptOptions.overrideLoginCredentials(org.jclouds.domain.LoginCredentials)
overrideLoginCredentials
public TemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
- Overrides:
overrideLoginCredentials
in class RunScriptOptions
overrideLoginPassword
public TemplateOptions overrideLoginPassword(String password)
- Overrides:
overrideLoginPassword
in class RunScriptOptions
overrideLoginPrivateKey
public TemplateOptions overrideLoginPrivateKey(String privateKey)
- Overrides:
overrideLoginPrivateKey
in class RunScriptOptions
overrideLoginUser
public TemplateOptions overrideLoginUser(String loginUser)
- Overrides:
overrideLoginUser
in class RunScriptOptions
overrideAuthenticateSudo
public TemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
- Overrides:
overrideAuthenticateSudo
in class RunScriptOptions
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-2012 jclouds. All Rights Reserved.