SFTP

Scope of Integration#

Yellow.ai Integration with SFTP allows you to seamlessly connect your remote server with the yellow.ai platform. Using this integration, one can get remote files, make a directory, delete directory, upload files to remote server, check if file exists or not.

Use-cases#

Following are the use-cases which are currently accommodated in the Integration:

1. SFTP File Transfer:-#

From this method you can easily upload files to a remote server.

Node Input Params:-

Field NameSample InputRemarks
fileCdnUrl*https://cdn.pixabay.com/photo/2017/01/03/02/07/vine-1948358__340.pngData source for data to copy to the remote server.
remoteFilePath*/uploads/directoryPath/demo.pngPath to the remote file to be created on the server with file name.
appendTimeInfilePath*True or falseIf true then It will append timestamp in file name otherwise same name from remote file path.
recursivetrue/falseIf the recursive flag is set to true, the method will create any directories in the path which do not already exist. Recursive flag defaults to false

2. SFTP Get File:-#

Retrieve a file from a remote SFTP server

Node Input Params:-

Field NameSample InputRemarks
remoteFilePath*/Directory/filename.extPath to the remote file to download
secureuploadtrue/falseIf true then It will give minio directory path otherwise it will give CDN url of files

3. SFTP Make Directory:-#

Create a new directory. If the recursive flag is set to true, the method will create any directories in the path which do not already exist. Recursive flag defaults to false.

Node Input Params:-

Field NameSample InputRemarks
remoteDirPath*/DirectoryPathPath to directory with new dir name
recursivetrue/falseIf true then the method will create any directories in the path which do not already exist

4. SFTP Delete Directory:-#

Remove a directory. If removing a directory and recursive flag is set to true, the specified directory and all sub-directories and files will be deleted. If set to false and the directory has sub-directories or files, the action will fail.

Node Input Params:-

Field NameSample InputRemarks
remoteDirPath*/DirectoryPathPath to directory
recursivetrue/falserecursive flag is set to true, the specified directory and all sub-directories and files will be deleted.

5. SFTP Delete Files:-#

Delete a file on the remote server.

Node Input Params:-

Field NameSample InputRemarks
remotefilePath*/DirectoryPath/filename.txtstring. Path to remote file to be deleted.
noErrorOk*true/falseboolean. If true, no error is raised when you try to delete a non-existent file. Default is false.

6. SFTP Data Append:-#

Append the input data to an existing remote file. There is no integrity checking performed apart from normal writeStream checks. This function simply opens a writeStream on the remote file in append mode and writes the data passed in to the file.

Node Input Params:-

Field NameSample InputRemarks
fileCdnUrl*https://www.w3.org/TR/PNG/iso_8859-1.txtCDN url for Data to append to remote file
remoteFilePath*/DirectoryPath/filename.txtPath to remote file if files do not exist then It will auto create.

7. SFTP List:-#

Retrieves a directory listing

Node Input Params:-

Field NameSample InputRemarks
remoteDir*/DirectoryPathremote directory path
pattern*{string

8. SFTP Exists:-#

Tests to see if a remote file or directory exists. Returns type of remote object if it exists or false if it does not

9. SFTP Chmod:-#

Change the mode (read, write or execute permissions) of a remote file or directory.

  • remotePath: string. Path to the remote file or directory
  • newmode: octal. New mode to set for the remote file or directory

Configuration#

Configuring the integration with SFTP is straightforward. Follow the steps defined below to start integrating:

To integrate SFTP with your bot on the platform:

  1. Go to Integration section
  2. In Integration click on the connect for the SFTP.
  3. Enter Host, Port, username, Password.

alt_text

  1. Click on Save

  2. Once the integration is done successfully, You can find an Integration option available in addition to the existing nodes.

  3. Store SFTP response in Object type variable in action-node.

Following the above steps will connect your SFTP remote server with the yellow.ai platform.

References:-#

  1. https://www.npmjs.com/package/ssh2-sftp-client
  2. https://www.filestash.app/sftp-browser.html

Sample Experience#

Below is a video that depicts how this integration works.