public class RunScriptOptions extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RunScriptOptions.Builder |
static class |
RunScriptOptions.ImmutableRunScriptOptions |
Modifier and Type | Field and Description |
---|---|
protected Boolean |
authenticateSudo |
protected boolean |
blockOnComplete |
protected com.google.common.base.Optional<String> |
loginPassword |
protected com.google.common.base.Optional<String> |
loginPrivateKey |
protected String |
loginUser |
static RunScriptOptions |
NONE
Default options.
|
protected int |
port |
protected boolean |
runAsRoot |
protected int |
seconds |
protected String |
taskName |
protected boolean |
wrapInInitScript |
Constructor and Description |
---|
RunScriptOptions() |
Modifier and Type | Method and 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 active
|
void |
copyTo(RunScriptOptions to) |
boolean |
equals(Object o) |
String |
getLoginPassword() |
String |
getLoginPrivateKey() |
String |
getLoginUser() |
int |
getPort() |
int |
getSeconds() |
String |
getTaskName() |
int |
hashCode() |
boolean |
hasLoginPassword() |
boolean |
hasLoginPasswordOption() |
boolean |
hasLoginPrivateKey() |
boolean |
hasLoginPrivateKeyOption() |
RunScriptOptions |
nameTask(String name) |
RunScriptOptions |
overrideAuthenticateSudo(boolean authenticateSudo) |
RunScriptOptions |
overrideLoginCredentials(LoginCredentials overridingCredentials) |
RunScriptOptions |
overrideLoginPassword(com.google.common.base.Optional<String> password) |
RunScriptOptions |
overrideLoginPassword(String password) |
RunScriptOptions |
overrideLoginPrivateKey(com.google.common.base.Optional<String> privateKey) |
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.
|
protected com.google.common.base.Objects.ToStringHelper |
string() |
String |
toString() |
RunScriptOptions |
wrapInInitScript(boolean wrapInInitScript)
default true
|
public static final RunScriptOptions NONE
ComputeService.runScriptOnNodesMatching(com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata>, java.lang.String)
protected int port
protected int seconds
protected String taskName
protected boolean runAsRoot
protected boolean blockOnComplete
protected boolean wrapInInitScript
protected String loginUser
protected Boolean authenticateSudo
protected com.google.common.base.Optional<String> loginPassword
protected com.google.common.base.Optional<String> loginPrivateKey
public void copyTo(RunScriptOptions to)
public RunScriptOptions overrideLoginCredentials(LoginCredentials overridingCredentials)
public RunScriptOptions overrideLoginUser(String loginUser)
public RunScriptOptions overrideLoginPassword(String password)
public RunScriptOptions overrideLoginPrivateKey(String privateKey)
public RunScriptOptions overrideLoginPassword(com.google.common.base.Optional<String> password)
public RunScriptOptions overrideLoginPrivateKey(com.google.common.base.Optional<String> privateKey)
public RunScriptOptions overrideAuthenticateSudo(boolean authenticateSudo)
public RunScriptOptions nameTask(String name)
jclouds-script-timestamp
where timestamp is millis since
epochpublic RunScriptOptions runAsRoot(boolean runAsRoot)
public RunScriptOptions wrapInInitScript(boolean wrapInInitScript)
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)public RunScriptOptions blockOnComplete(boolean blockOnComplete)
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)public RunScriptOptions blockOnPort(int port, int seconds)
public String getTaskName()
public int getPort()
public int getSeconds()
@Nullable public String getLoginUser()
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By
default, null.@Nullable public Boolean shouldAuthenticateSudo()
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By
default, null.public boolean hasLoginPasswordOption()
public boolean hasLoginPassword()
@Nullable public String getLoginPassword()
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By
default, null.public boolean hasLoginPrivateKeyOption()
public boolean hasLoginPrivateKey()
@Nullable public String getLoginPrivateKey()
ComputeService.runScriptOnNode(java.lang.String, org.jclouds.scriptbuilder.domain.Statement, org.jclouds.compute.options.RunScriptOptions)
. By
default, null.public boolean shouldRunAsRoot()
public boolean shouldBlockOnComplete()
blockOnComplete(boolean)
public boolean shouldWrapInInitScript()
protected com.google.common.base.Objects.ToStringHelper string()
Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.