SCP / FTP / SSH
Browse implementations
Target Authentication
You can either use basic authentication or use a private key and a passphrase.
target example |
---|
| {
"name": "my_target",
"url": "tcp://my.target:4242",
"properties": {
"username": "myUsername", // (1)
"password": "myPassword", // (2)
"privateKey": "/path/to/the/private/key", // (3)
"privateKeyPassphrase": "myPrivateKeyPassphrase" // (4)
}
}
|
- Valid properties are
username
or user
. Set this for basic authentication
- Valid properties are
userPassword
or password
. Set this for basic authentication
- Path to private key file on the machine running Chutney
- Valid properties are
privateKeyPassword
or privateKeyPassphrase
. Set this for basic authentication
SCP
Download
SCP download has no outputs
Example
| ScpDownloadAction(
target = "myTarget",
source = "/absolute/path/to/the/source/file", // (1)
destination = "/absolute/path/to/the/destination/file", // (2)
timeout = "42 ms"
)
|
- The absolute path of the file to download from the target machine
- The absolute path of the destination file on the machine running Chutney
Upload
SCP upload has no outputs
Example
| ScpUploadAction(
target = "myTarget",
source = "/absolute/path/to/the/source/file", // (1)
destination = "/absolute/path/to/the/destination/file", // (2)
timeout = "42 ms"
)
|
- The absolute path of the source file on the machine running Chutney
- The absolute path of the destination file on the target machine
SFTP
Download
SFTP download has no outputs
Example
| SftpDownloadAction(
target = "myTarget",
source = "/absolute/path/to/the/source/file", // (1)
destination = "/absolute/path/to/the/destination/file", // (2)
timeout = "42 ms"
)
|
- The absolute path of the file to download from the target machine
- The absolute path of the destination file on the machine running Chutney
FileInfo
Example
| SftpFileInfoAction(
target = "myTarget",
file = "/path/to/file", // (1)
timeout = "42 ms"
)
|
- The file path on the target machine
ListDir
Example
| SftpListDirAction(
target = "myTarget",
directory = "/path/to/directory", // (1)
timeout = "42 ms"
)
|
- The directory path on the target machine
Upload
SCP upload has no outputs
Example
| SftpUploadAction(
target = "myTarget",
source = "/absolute/path/to/the/source/file", // (1)
destination = "/absolute/path/to/the/destination/file", // (2)
timeout = "42 ms"
)
|
- The absolute path of the source file on the machine running Chutney
- The absolute path of the destination file on the target machine
SSH
Client
Example
| SshClientAction(
target = "myTarget",
commands = listOf("{\"command: \"whoami\", timeout:\"10 s\"\"}"),
channel = SSH_CLIENT_CHANNEL.COMMAND
)
|
- Syntax is either a list of String or a List of Command in JSON (ex. {command: "xxx", timeout:"10 s"})
You can set a timeout for each command, format is a Duration
Default timeout value is 5 seconds
CommandResult
A CommandResult
represents the output of one command.
The following attributes can be used in SpEL :
command
: Get the command (Command)
-> ${#results.get(0).command}
exitCode
: Get the command exit code (int)
-> ${#results.get(0).exitCode}
stdout
: Get the standard output of the command (String)
-> ${#results.get(0).stdout}
stderr
: Get the error output of the command (String)
-> ${#results.get(0).stderr}
Command
The following attributes can be used in SpEL :
command
: Get the actual command (String)
-> ${#command.command}
timeout
: Get the command timeout (Duration)
-> ${#command.timeout}