scp

D.device. Namespace

scp

Description:
  • The Device SCP library. Allows drivers to execute SCP commands towards the device.
Example
D.device.scp
See SCP Driver Examples

Methods

(static) download(options, callback)

Description:
  • Retrieves a file content from a remote server using SCP.
Example
D.device.scp.download(options, callback)
Parameters:
Name Type Description
options scpDownloadOptions The SCP download execution options
Properties
Name Type Attributes Default Description
filePath string The source file path on the device. It defines the location of the file to be downloaded.
port string <optional>
22 The SCP port
timeout int <optional>
The time to wait for the scp download command execution
username string <optional>
The device username. If not set the custom driver management purpose one is used
password string <optional>
The device password. If not set the custom driver management purpose one is used
callback callback The SCP upload execution callback
Properties
Name Type Attributes Description
output object The stdout from the scp upload command execution
Properties
Name Type Attributes Description
content string <optional>
The content of file downloaded from the device, if the execution did not result in an error
stdout string The stdout from the scp download command execution
error ErrorResult <optional>
Will be present if the execution resulted in an error

(static) upload(options, callback)

Description:
  • Transfers a file content to a remote server using SCP.
Example
D.device.scp.upload(options, callback)
Parameters:
Name Type Description
options object The SCP upload execution options
Properties
Name Type Attributes Default Description
filePath string The destination file path on the device. It defines where the content will be stored
content string The content of the file to be stored on the device
port string <optional>
22 The SCP port
timeout int <optional>
The time to wait for the scp upload command execution
username string <optional>
The device username. If not set the custom driver management purpose one is used
password string <optional>
The device password. If not set the custom driver management purpose one is used
callback callback The SCP upload execution callback
Properties
Name Type Attributes Description
output string The stdout from the scp upload command execution
error ErrorResult <optional>
Will be present if the execution resulted in an error