Package org.jclouds.compute.options
Class RunScriptOptions.ImmutableRunScriptOptions
- java.lang.Object
-
- org.jclouds.compute.options.RunScriptOptions
-
- org.jclouds.compute.options.RunScriptOptions.ImmutableRunScriptOptions
-
- Enclosing class:
- RunScriptOptions
public static class RunScriptOptions.ImmutableRunScriptOptions extends RunScriptOptions
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jclouds.compute.options.RunScriptOptions
RunScriptOptions.Builder, RunScriptOptions.ImmutableRunScriptOptions
-
-
Field Summary
-
Fields inherited from class org.jclouds.compute.options.RunScriptOptions
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, NONE, port, runAsRoot, seconds, taskName, wrapInInitScript
-
-
Constructor Summary
Constructors Constructor Description ImmutableRunScriptOptions(RunScriptOptions delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RunScriptOptions
blockOnComplete(boolean blockOnComplete)
As of version 1.1.0, we cannot kick off a script unless a node is in RUNNING state.RunScriptOptions
blockOnPort(int port, int seconds)
When the node is started, wait until the following port is activeString
getLoginPassword()
String
getLoginPrivateKey()
String
getLoginUser()
int
getPort()
int
getSeconds()
String
getTaskName()
RunScriptOptions
nameTask(String name)
RunScriptOptions
overrideAuthenticateSudo(boolean authenticateSudo)
RunScriptOptions
overrideLoginCredentials(LoginCredentials overridingCredentials)
RunScriptOptions
overrideLoginPassword(String password)
RunScriptOptions
overrideLoginPrivateKey(String privateKey)
RunScriptOptions
overrideLoginUser(String loginUser)
RunScriptOptions
runAsRoot(boolean runAsRoot)
Boolean
shouldAuthenticateSudo()
boolean
shouldBlockOnComplete()
boolean
shouldRunAsRoot()
Whether to run the script as root (or run with current privileges).boolean
shouldWrapInInitScript()
Whether to wait until the script has completed.String
toString()
RunScriptOptions
wrapInInitScript(boolean wrapInInitScript)
default true-
Methods inherited from class org.jclouds.compute.options.RunScriptOptions
copyTo, equals, hashCode, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, overrideLoginPassword, overrideLoginPrivateKey, string
-
-
-
-
Constructor Detail
-
ImmutableRunScriptOptions
public ImmutableRunScriptOptions(RunScriptOptions delegate)
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toString
in classRunScriptOptions
-
shouldRunAsRoot
public boolean shouldRunAsRoot()
Description copied from class:RunScriptOptions
Whether to run the script as root (or run with current privileges). By default, true.- Overrides:
shouldRunAsRoot
in classRunScriptOptions
- Returns:
- value
-
runAsRoot
public RunScriptOptions runAsRoot(boolean runAsRoot)
- Overrides:
runAsRoot
in classRunScriptOptions
-
shouldBlockOnComplete
public boolean shouldBlockOnComplete()
- Overrides:
shouldBlockOnComplete
in classRunScriptOptions
- See Also:
RunScriptOptions.blockOnComplete(boolean)
-
blockOnComplete
public RunScriptOptions 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 classRunScriptOptions
- 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)
-
overrideLoginCredentials
public RunScriptOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
- Overrides:
overrideLoginCredentials
in classRunScriptOptions
-
overrideLoginPassword
public RunScriptOptions overrideLoginPassword(String password)
- Overrides:
overrideLoginPassword
in classRunScriptOptions
-
overrideLoginPrivateKey
public RunScriptOptions overrideLoginPrivateKey(String privateKey)
- Overrides:
overrideLoginPrivateKey
in classRunScriptOptions
-
overrideAuthenticateSudo
public RunScriptOptions overrideAuthenticateSudo(boolean authenticateSudo)
- Overrides:
overrideAuthenticateSudo
in classRunScriptOptions
-
getLoginUser
public String getLoginUser()
- Overrides:
getLoginUser
in classRunScriptOptions
- Returns:
- the login user for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
shouldAuthenticateSudo
public Boolean shouldAuthenticateSudo()
- Overrides:
shouldAuthenticateSudo
in classRunScriptOptions
- 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.
-
getLoginPassword
public String getLoginPassword()
- Overrides:
getLoginPassword
in classRunScriptOptions
- Returns:
- the login password for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
getLoginPrivateKey
public String getLoginPrivateKey()
- Overrides:
getLoginPrivateKey
in classRunScriptOptions
- Returns:
- the login ssh key for
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By default, null.
-
shouldWrapInInitScript
public boolean shouldWrapInInitScript()
Description copied from class:RunScriptOptions
Whether to wait until the script has completed. By default, true.- Overrides:
shouldWrapInInitScript
in classRunScriptOptions
- Returns:
- value
-
overrideLoginUser
public RunScriptOptions overrideLoginUser(String loginUser)
- Overrides:
overrideLoginUser
in classRunScriptOptions
-
wrapInInitScript
public RunScriptOptions wrapInInitScript(boolean wrapInInitScript)
Description copied from class:RunScriptOptions
default true- Overrides:
wrapInInitScript
in classRunScriptOptions
- 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:
-
getTaskName
public String getTaskName()
- Overrides:
getTaskName
in classRunScriptOptions
-
nameTask
public RunScriptOptions nameTask(String name)
- Overrides:
nameTask
in classRunScriptOptions
- Returns:
- What to call the task relating to this script; default
jclouds-script-timestamp
where timestamp is millis since epoch
-
blockOnPort
public RunScriptOptions 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 classRunScriptOptions
-
getPort
public int getPort()
- Overrides:
getPort
in classRunScriptOptions
-
getSeconds
public int getSeconds()
- Overrides:
getSeconds
in classRunScriptOptions
-
-