Learn R Programming

resourcer (version 1.0.0)

SshResourceClient: SSH resource client

Description

SSH resource client

SSH resource client

Arguments

Format

A R6 object of class SshResourceClient

Super classes

resourcer::ResourceClient -> resourcer::CommandResourceClient -> SshResourceClient

Methods

Public methods

Method new()

Create a SshResourceClient instance. This client will interact wtih a computation resource using ssh commands.

Usage

SshResourceClient$new(resource)

Arguments

resource

The computation resource.

Returns

The SshResourceClient object.

Method getConnection()

Get or create the SSH connection object, for raw interaction.

Usage

SshResourceClient$getConnection()

Returns

The SSH connection object.

Method downloadFile()

Download one or more files (wilcard * is supported in the file name (which can be a directory))

Usage

SshResourceClient$downloadFile(file, to = ".", verbose = FALSE)

Arguments

file

The file to download.

to

The download destination.

verbose

If TRUE, details the file operations on the console output.

Returns

The paths of the files having been downloaded.

Method exec()

Executes a ssh command.

Usage

SshResourceClient$exec(command, params = NULL, test = FALSE)

Arguments

command

The command name.

params

A named list of parameters.

test

If TRUE, the command is printed but not executed (for debugging).

Returns

The command execution result object.

Method close()

Close the SSH connection.

Usage

SshResourceClient$close()

Method clone()

The objects of this class are cloneable with this method.

Usage

SshResourceClient$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Connects to a SSH server.