Package org.jclouds.compute.options
Class RunScriptOptions
java.lang.Object
org.jclouds.compute.options.RunScriptOptions
- Direct Known Subclasses:
RunScriptOptions.ImmutableRunScriptOptions
,TemplateOptions
Enables additional options for running a script.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Boolean
protected boolean
protected com.google.common.base.Optional
<String> protected com.google.common.base.Optional
<String> protected String
static final RunScriptOptions
Default options.protected int
protected boolean
protected int
protected String
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblockOnComplete
(boolean blockOnComplete) As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.blockOnPort
(int port, int seconds) When the node is started, wait until the following port is activevoid
boolean
int
getPort()
int
int
hashCode()
boolean
boolean
boolean
boolean
overrideAuthenticateSudo
(boolean authenticateSudo) overrideLoginCredentials
(LoginCredentials overridingCredentials) overrideLoginPassword
(com.google.common.base.Optional<String> password) overrideLoginPassword
(String password) overrideLoginPrivateKey
(com.google.common.base.Optional<String> privateKey) overrideLoginPrivateKey
(String privateKey) overrideLoginUser
(String loginUser) runAsRoot
(boolean runAsRoot) boolean
boolean
Whether to run the script as root (or run with current privileges).boolean
Whether to wait until the script has completed.protected com.google.common.base.MoreObjects.ToStringHelper
string()
toString()
wrapInInitScript
(boolean wrapInInitScript) default true
-
Field Details
-
NONE
Default options. The default settings are:- override the credentials with ones supplied in call to
ComputeService.runScriptOnNodesMatching(com.google.common.base.Predicate<? super org.jclouds.compute.domain.NodeMetadata>, java.lang.String)
- run the script as root (versus running with current privileges)
- override the credentials with ones supplied in call to
-
port
protected int port -
seconds
protected int seconds -
taskName
-
runAsRoot
protected boolean runAsRoot -
blockOnComplete
protected boolean blockOnComplete -
wrapInInitScript
protected boolean wrapInInitScript -
loginUser
-
authenticateSudo
-
loginPassword
-
loginPrivateKey
-
-
Constructor Details
-
RunScriptOptions
public RunScriptOptions()
-
-
Method Details
-
copyTo
-
overrideLoginCredentials
-
overrideLoginUser
-
overrideLoginPassword
-
overrideLoginPrivateKey
-
overrideLoginPassword
-
overrideLoginPrivateKey
-
overrideAuthenticateSudo
-
nameTask
- Returns:
- What to call the task relating to this script; default
jclouds-script-timestamp
where timestamp is millis since epoch
-
runAsRoot
-
wrapInInitScript
default true- 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
As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.- 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)
-
blockOnPort
When the node is started, wait until the following port is active -
getTaskName
-
getPort
public int getPort() -
getSeconds
public int getSeconds() -
getLoginUser
- Returns:
- the login user for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
shouldAuthenticateSudo
- Returns:
- Whether the login user should authenticate sudo during
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
hasLoginPasswordOption
public boolean hasLoginPasswordOption()- Returns:
- true if the login password has been configured
-
hasLoginPassword
public boolean hasLoginPassword()- Returns:
- true if the login password is set
-
getLoginPassword
- Returns:
- the login password for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
hasLoginPrivateKeyOption
public boolean hasLoginPrivateKeyOption()- Returns:
- true if the login ssh key has been configured
-
hasLoginPrivateKey
public boolean hasLoginPrivateKey()- Returns:
- true if the login ssh key is set
-
getLoginPrivateKey
- Returns:
- the login ssh key for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
shouldRunAsRoot
public boolean shouldRunAsRoot()Whether to run the script as root (or run with current privileges). By default, true.- Returns:
- value
-
shouldBlockOnComplete
public boolean shouldBlockOnComplete()- See Also:
-
shouldWrapInInitScript
public boolean shouldWrapInInitScript()Whether to wait until the script has completed. By default, true.- Returns:
- value
-
equals
-
hashCode
public int hashCode() -
toString
-
string
protected com.google.common.base.MoreObjects.ToStringHelper string()
-