public class SSHLauncher
extends hudson.slaves.ComputerLauncher
| Modifier and Type | Class and Description |
|---|---|
static class |
SSHLauncher.DescriptorImpl |
| Modifier and Type | Field and Description |
|---|---|
static String |
AGENT_JAR |
static Integer |
DEFAULT_LAUNCH_TIMEOUT_SECONDS |
static Integer |
DEFAULT_MAX_NUM_RETRIES |
static Integer |
DEFAULT_RETRY_WAIT_TIME |
static int |
DEFAULT_SSH_PORT |
static String |
JAR_CACHE_DIR |
static String |
JAR_CACHE_PARAM |
String |
javaPath
Field javaPath.
|
Integer |
launchTimeoutSeconds
Field launchTimeoutSeconds.
|
Integer |
maxNumRetries
Field maxNumRetries.
|
String |
prefixStartSlaveCmd
Field prefixStartSlaveCmd.
|
Integer |
retryWaitTime
Field retryWaitTime (seconds).
|
static String |
SLASH_AGENT_JAR |
static com.cloudbees.plugins.credentials.domains.SchemeRequirement |
SSH_SCHEME
The scheme requirement.
|
String |
suffixStartSlaveCmd
Field suffixStartSlaveCmd.
|
static String |
WORK_DIR_PARAM |
| Constructor and Description |
|---|
SSHLauncher(String host,
int port,
String credentialsId)
Constructor SSHLauncher creates a new SSHLauncher instance.
|
SSHLauncher(String host,
int port,
String credentialsId,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds,
Integer maxNumRetries,
Integer retryWaitTime,
SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
Constructor SSHLauncher creates a new SSHLauncher instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterDisconnect(hudson.slaves.SlaveComputer slaveComputer,
hudson.model.TaskListener listener) |
com.trilead.ssh2.Connection |
getConnection() |
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials |
getCredentials() |
String |
getCredentialsId() |
String |
getHost()
Getter for property 'host'.
|
String |
getJavaPath()
Deprecated.
|
String |
getJvmOptions()
Gets the optional JVM Options used to launch the agent JVM.
|
Integer |
getLaunchTimeoutSeconds()
Getter for property 'launchTimeoutSeconds'
|
Integer |
getMaxNumRetries()
Getter for property 'maxNumRetries'
|
int |
getPort()
Getter for property 'port'.
|
String |
getPrefixStartSlaveCmd() |
Integer |
getRetryWaitTime()
Getter for property 'retryWaitTime'
|
SshHostKeyVerificationStrategy |
getSshHostKeyVerificationStrategy() |
String |
getSuffixStartSlaveCmd() |
boolean |
getTcpNoDelay() |
static String |
getTimestamp()
Gets the formatted current time stamp.
|
boolean |
getTrackCredentials()
Enable/Disable the credential tracking, this tracking store information about where it is used a credential,
in this case in a node.
|
String |
getWorkDir() |
String |
getWorkDirParam(String workingDirectory) |
static String |
getWorkingDirectory(hudson.slaves.SlaveComputer computer)
Returns the remote root workspace (without trailing slash).
|
boolean |
isLaunchSupported() |
void |
launch(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener) |
String |
logConfiguration() |
static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials |
lookupSystemCredentials(String credentialsId) |
protected void |
openConnection(hudson.model.TaskListener listener,
hudson.slaves.SlaveComputer computer) |
Object |
readResolve() |
protected void |
reportEnvironment(hudson.model.TaskListener listener) |
void |
setHost(String value) |
void |
setJavaPath(String value) |
void |
setJvmOptions(String value) |
void |
setLaunchTimeoutSeconds(Integer value) |
void |
setMaxNumRetries(Integer value) |
void |
setPort(int value) |
void |
setPrefixStartSlaveCmd(String value) |
void |
setRetryWaitTime(Integer value) |
void |
setSshHostKeyVerificationStrategy(SshHostKeyVerificationStrategy value) |
void |
setSuffixStartSlaveCmd(String value) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
void |
setWorkDir(String workDir) |
public static final com.cloudbees.plugins.credentials.domains.SchemeRequirement SSH_SCHEME
public static final Integer DEFAULT_MAX_NUM_RETRIES
public static final Integer DEFAULT_RETRY_WAIT_TIME
public static final Integer DEFAULT_LAUNCH_TIMEOUT_SECONDS
public static final String AGENT_JAR
public static final String SLASH_AGENT_JAR
public static final String WORK_DIR_PARAM
public static final String JAR_CACHE_PARAM
public static final String JAR_CACHE_DIR
public static final int DEFAULT_SSH_PORT
public String javaPath
public String prefixStartSlaveCmd
public String suffixStartSlaveCmd
public Integer launchTimeoutSeconds
public Integer maxNumRetries
public Integer retryWaitTime
public SSHLauncher(@NonNull
String host,
int port,
String credentialsId,
String jvmOptions,
String javaPath,
String prefixStartSlaveCmd,
String suffixStartSlaveCmd,
Integer launchTimeoutSeconds,
Integer maxNumRetries,
Integer retryWaitTime,
SshHostKeyVerificationStrategy sshHostKeyVerificationStrategy)
host - The host to connect to.port - The port to connect on.credentialsId - The credentials id to connect as.jvmOptions - Options passed to the java vm.javaPath - Path to the host jdk installation. If null the jdk will be auto detected.prefixStartSlaveCmd - This will prefix the start agent command. For instance if you want to execute the command with a different shell.suffixStartSlaveCmd - This will suffix the start agent command.launchTimeoutSeconds - Launch timeout in secondsmaxNumRetries - The number of times to retry connection if the SSH connection is refused during initial connectretryWaitTime - The number of seconds to wait between retriessshHostKeyVerificationStrategy - Host key verification method selected.public static com.cloudbees.plugins.credentials.common.StandardUsernameCredentials lookupSystemCredentials(String credentialsId)
public Object readResolve()
public com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentials()
public boolean isLaunchSupported()
isLaunchSupported in class hudson.slaves.ComputerLauncherpublic String getJvmOptions()
@Deprecated public String getJavaPath()
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static String getTimestamp()
@CheckForNull public static String getWorkingDirectory(hudson.slaves.SlaveComputer computer)
computer - The computer to get the root workspace of.public void launch(hudson.slaves.SlaveComputer computer,
hudson.model.TaskListener listener)
throws InterruptedException
launch in class hudson.slaves.ComputerLauncherInterruptedExceptionprotected void reportEnvironment(hudson.model.TaskListener listener)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionprotected void openConnection(hudson.model.TaskListener listener,
hudson.slaves.SlaveComputer computer)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void afterDisconnect(hudson.slaves.SlaveComputer slaveComputer,
hudson.model.TaskListener listener)
afterDisconnect in class hudson.slaves.ComputerLauncherpublic String getCredentialsId()
@CheckForNull public SshHostKeyVerificationStrategy getSshHostKeyVerificationStrategy()
@DataBoundSetter public void setSshHostKeyVerificationStrategy(SshHostKeyVerificationStrategy value)
@DataBoundSetter public void setJvmOptions(String value)
@DataBoundSetter public void setJavaPath(String value)
@DataBoundSetter public void setPrefixStartSlaveCmd(String value)
@DataBoundSetter public void setSuffixStartSlaveCmd(String value)
@DataBoundSetter public void setMaxNumRetries(Integer value)
@DataBoundSetter public void setLaunchTimeoutSeconds(Integer value)
@DataBoundSetter public void setRetryWaitTime(Integer value)
public void setPort(int value)
public void setHost(String value)
public String getHost()
public int getPort()
public com.trilead.ssh2.Connection getConnection()
@NonNull public String getPrefixStartSlaveCmd()
@NonNull public String getSuffixStartSlaveCmd()
@NonNull public Integer getLaunchTimeoutSeconds()
@NonNull public Integer getMaxNumRetries()
@NonNull public Integer getRetryWaitTime()
public boolean getTcpNoDelay()
@DataBoundSetter public void setTcpNoDelay(boolean tcpNoDelay)
public boolean getTrackCredentials()
public String getWorkDir()
@DataBoundSetter public void setWorkDir(String workDir)
@NonNull @Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getWorkDirParam(@NonNull String workingDirectory)
workingDirectory - The Working directory set on the configuration of the node.public String logConfiguration()
Copyright © 2016–2020. All rights reserved.