Skip to content

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)
    }
}
  1. Valid properties are username or user. Set this for basic authentication
  2. Valid properties are userPassword or password. Set this for basic authentication
  3. Path to private key file on the machine running Chutney
  4. Valid properties are privateKeyPassword or privateKeyPassphrase. Set this for basic authentication

SCP🔗

Download🔗

Required Name Type Default
* target String
* source String
* destination String
timeout String (Duration) 5 sec

SCP download has no outputs

Example🔗

1
2
3
4
5
6
ScpDownloadAction(
    target = "myTarget",
    source = "/absolute/path/to/the/source/file", // (1)
    destination = "/absolute/path/to/the/destination/file", // (2)
    timeout = "42 ms"
)
  1. The absolute path of the file to download from the target machine
  2. The absolute path of the destination file on the machine running Chutney

Upload🔗

Required Name Type Default
* target String
* source String
* destination String
timeout String (Duration) 5 sec

SCP upload has no outputs

Example🔗

1
2
3
4
5
6
ScpUploadAction(
    target = "myTarget",
    source = "/absolute/path/to/the/source/file", // (1)
    destination = "/absolute/path/to/the/destination/file", // (2)
    timeout = "42 ms"
)
  1. The absolute path of the source file on the machine running Chutney
  2. The absolute path of the destination file on the target machine

SFTP🔗

Download🔗

Required Name Type Default
* target String
* source String
* destination String
timeout String (Duration) 5 sec

SFTP download has no outputs

Example🔗

1
2
3
4
5
6
SftpDownloadAction(
    target = "myTarget",
    source = "/absolute/path/to/the/source/file", // (1)
    destination = "/absolute/path/to/the/destination/file", // (2)
    timeout = "42 ms"
)
  1. The absolute path of the file to download from the target machine
  2. The absolute path of the destination file on the machine running Chutney

FileInfo🔗

Required Name Type Default
* target String
* file String
timeout String (Duration) 5 sec
Name Type
CreationDate LocalDateTime
lastAccess LocalDateTime
lastModification LocalDateTime
type String
owner:group String

Example🔗

1
2
3
4
5
SftpFileInfoAction(
    target = "myTarget",
    file = "/path/to/file", // (1)
    timeout = "42 ms"
)
  1. The file path on the target machine

ListDir🔗

Required Name Type Default
* target String
* directory String
timeout String (Duration) 5 sec
Name Type
files List<String>

Example🔗

1
2
3
4
5
SftpListDirAction(
    target = "myTarget",
    directory = "/path/to/directory", // (1)
    timeout = "42 ms"
)
  1. The directory path on the target machine

Upload🔗

Required Name Type Default
* target String
* source String
* destination String
timeout String (Duration) 5 sec

SCP upload has no outputs

Example🔗

1
2
3
4
5
6
SftpUploadAction(
    target = "myTarget",
    source = "/absolute/path/to/the/source/file", // (1)
    destination = "/absolute/path/to/the/destination/file", // (2)
    timeout = "42 ms"
)
  1. The absolute path of the source file on the machine running Chutney
  2. The absolute path of the destination file on the target machine

SSH🔗

Client🔗

Required Name Type Default Values
* target String
* commands String
channel String COMMAND COMMAND or SHELL
Name Type
results List<CommandResult>

Example🔗

1
2
3
4
5
SshClientAction(
    target = "myTarget",
    commands = listOf("{\"command: \"whoami\", timeout:\"10 s\"\"}"),
    channel = SSH_CLIENT_CHANNEL.COMMAND
)
  1. 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}