SFTP: Client
Summary
This module contains actions for listing directories on & uploading/downloading files to/from an SFTP server.
Actions
sftp.client.
delete_file
Delete a file on an SFTP server.
Input
-
sftp_server: an SFTPServer dictionary
-
name: the name of the directory item to delete
-
working_directory: optional remote directory from which to run the command (defaults to the login directory)
Output
Nothing is outputted by this action.
Example
1 2 3 4 |
|
sftp.client.
delete_files
Delete multiple files on an SFTP server.
Input
-
sftp_server: an SFTPServer dictionary
-
names: a list containing the name of each directory item to delete
-
working_directory: optional remote directory from which to run the command (defaults to the login directory)
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 6 |
|
sftp.client.
download_file
Download a file from an SFTP server.
Input
-
sftp_server: an SFTPServer dictionary
-
source: the remote path of the file to download
-
destination: the name of the local file to create
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 |
|
sftp.client.
list_directory
List items in a directory
Input
-
sftp_server: an SFTPServer dictionary
-
path: optional path to list items from (defaults to current working directory
.
) -
working_directory: optional remote directory from which to run the command (defaults to the login directory)
Output
A list of DirectoryItem dictionaries.
Example
1 2 3 4 |
|
sftp.client.
output_directory_table
Display directory items in a table.
The table will have the following columns:
- Name
- Is Directory
- Size (bytes)
- Last Modified
Input
- directory_items: a single or list of DirectoryItem dictionaries to display in a table
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 6 7 8 9 10 |
|
sftp.client.
search_directory
Search a directory for items using a regular expression.
Input
-
sftp_server: an SFTPServer dictionary
-
expression: regular expression to use in the search
-
path: optional path to list files in (defaults to current working directory
.
) -
working_directory: optional remote directory from which to run the command (defaults to the login directory)
Output
A list of DirectoryItem dictionaries.
Example
1 2 3 4 5 |
|
sftp.client.
upload_file
Upload a file to the SFTP server.
Input
-
sftp_server: an SFTPServer dictionary
-
source: the name of the local file to upload
-
destination: the destination path on the SFTP server (including the file name)
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 |
|