Configuring a Secure FTP File Operations Service

How to:

Reference:

The Secure FTP (SFTP) File Operations service is used to perform simple SFTP file operations.

To configure a SFTP File Operations service:

  1. Perform the steps as described in Configuring Services.
  2. Ensure that you select SFTP File Ops Agent {com.ibi.agents.XDSFTPFileOpsAgent} as the service type you are configuring.

    For a complete description of the configuration parameters that are available for the SFTP File Operations service, see SFTP File Operations Service Parameters.

    For a complete description of the edges that are returned by the SFTP File Operations service, see SFTP File Operations Service Edges.


Top of page

x
Reference: SFTP File Operations Service Parameters

The following table lists and describes parameters for the SFTP File Operations service.

Parameter

Description

Operation

Operation to perform on the file hosted by the SFTP Server. Operations supported by this service are as follows:

  • copy. Copies the data from the file addressed by the File (from) parameter to the file named in the File (to) parameter.
  • move. Moves the data from the file addressed by the File (from) parameter to the file named in the File (to) parameter. When successfully completed the file addressed by the File (from) parameter is deleted.
  • rename. Renames the file addressed by the File (from) parameter to the file named in the File (to) parameter. When successfully completed the file addressed by the File (from) no longer exists.
  • prepend. Copies the data from the file addressed by the File (from) parameter to the beginning of the file named in the File (to) parameter.

Operation (continued)

  • append. Copies the data from the file addressed by the File (from) parameter to the end of the file named in the File (to) parameter.
  • delete. Deletes the file addressed by the File (from) parameter from the host.
  • size. Gets the size of the file addressed by the File (from) parameter from the host. The return is places in the Special Register named in the Remote Size parameter.
  • exist. Verifies that the file addressed by the File (from) parameter exists on the host.

File (from)

Name of the source file. This field may be a relative or absolute file paths, a SREG or XPath expression. This is a required field.

File (to)

The name of the destination file. Wild cards are accepted. This is a required field except when operation is delete, size or exist.

Host Name

DNS name (or IP address) of the host SFTP server to connect to. This is a required field.

User Name

The name (or user ID) of the user to use to log onto the SFTP host with. This is a required field.

Password

Password for the user on the SFTP host.

Remote Port

Port number to connect to on the SFTP host site, blank for default port 22.

Remote Size

Name of the Special Register designated to hold size. This field is required when operation is size.

Out Document

Document returned by operation (bad input defaults to result).

result. The results of the requested operation. In the case of copy, move, rename, delete, size, and exist, the status document containing the status of the function is returned.

The functions prepend and append result in the file data being returned. This data will be the same as the data found in the file addressed by the File (to) parameter.



x
Reference: SFTP File Operations Service Edges

The following table lists and describes the edges that are returned by the SFTP File Operations service.

Edge

Description

success

Operation completed successfully.

fail_parse

Failed to properly parse the input parameters of the service.

fail_connect

Failed to connect to SFTP host for any one of the following reasons:

  • The host name (IP) is invalid.
  • The User ID is invalid.
  • The password of the user is invalid.
  • The connection failed.

fail_operation

Invalid parms or other error.

fail_notfound

The file name in the File Name Tag parameter does not exist on the SFTP host.



x
Procedure: How to Test the SFTP Ops Service for a Copy Operation
  1. Create a process flow and add a service object for the SFTP File Operations service (com.ibi.agents.XDSFTPOpsAgent), as shown in the following image.

  2. Set the Service object class name to com.ibi.agents.XDSFTPOpsAgent.
  3. Set the properties as shown in the following image.

    The From file test.txt is:

    This is an SFTPServer test

    The to file out6.txt is:

    <parent><test1>Soumya</test1></parent>
  4. Test run the process flow SFTPOps.

    The to file out6.txt content is modified as:

    This is an SFTPServer test

Top of page

x
Procedure: How to Test the SFTP Ops Service for a Move Operation
  1. Create a process flow and add a service object for the SFTP File Operations service (com.ibi.agents.XDSFTPOpsAgent), as shown in the following image.

  2. Set the Service object class name to com.ibi.agents.XDSFTPOpsAgent.

    Set the properties as shown in the following image.

  3. The From file /users/edasxr/testdir/test.txt is
    This is an SFTPServer test
  4. Test run the process flow SFTPOps.

    The From File test.txt is renamed to testmove.txt.


Top of page

x
Procedure: How to Test the SFTP Ops Service for a Prepend Operation
  1. Create a process flow and add a service object for the SFTP File Operations service (com.ibi.agents.XDSFTPOpsAgent), as shown in the following image.

  2. Set the Service object class name to com.ibi.agents.XDSFTPOpsAgent.

    Set the properties as shown in the following image.

    The From file /users/edasxr/testdir/out6.txt is:

    this is a test

    The to file /users/edasxr/testdir/testmove.txt is:

    for sftpops agent
  3. Test run the process flow SFTPOps.

    The to file testmove.txt content is modified as:

    this is a test for sftpops agent

Top of page

x
Procedure: How to Test the SFTP Ops Service for an Append Operation
  1. Create a process flow and add a service object for the SFTP File Operations service (com.ibi.agents.XDSFTPOpsAgent), as shown in the following image.

  2. Set the Service object class name to com.ibi.agents.XDSFTPOpsAgent.

    Set the properties as shown in the following image.

    The From file /users/edasxr/testdir/out6.txt is:

    this is a test

    The to file /users/edasxr/testdir/testmove.txt is:

    for sftpops agent
  3. Test run the process flow SFTPOps.

    The to file testmove.txt content is modified as:

    this is a test for sftpops agent

Top of page

x
Procedure: How to Test the SFTP Ops Service for a Delete Operation
  1. Create a process flow and add a service object for the SFTP File Operations service (com.ibi.agents.XDSFTPOpsAgent), as shown in the following image.

  2. Set the Service object class name to com.ibi.agents.XDSFTPOpsAgent.

    Set the properties as shown in the following image.

  3. Test run the process flow SFTPOps.

    The From file /users/edasxr/testdir/out6.txt is deleted.


Top of page

x
Procedure: How to Test the SFTP Ops Service for a Rename Operation
  1. Create a process flow and add a service object for the SFTP File Operations service (com.ibi.agents.XDSFTPOpsAgent), as shown in the following image.

  2. Set the Service object class name to com.ibi.agents.XDSFTPOpsAgent.

    Set the properties as shown in the following image.

  3. The From file /users/edasxr/testdir/test.txt is
    This is an SFTPServer test
  4. Test run the process flow SFTPOps.

    The From File test.txt is renamed to testmove.txt.


Top of page

x
Procedure: How to Test the SFTP Ops Service for a Size Operation
  1. Create a process flow and add a service object for the SFTP File Operations service (com.ibi.agents.XDSFTPOpsAgent), as shown in the following image.

  2. Set the Service object class name to com.ibi.agents.XDSFTPOpsAgent.

    Set the properties as shown in the following image.


Top of page

x
Procedure: How to Test the SFTP Ops Service for an Exist Operation
  1. Create a process flow and add a service object for the SFTP File Operations service (com.ibi.agents.XDSFTPOpsAgent), as shown in the following image.

  2. Set the Service object class name to com.ibi.agents.XDSFTPOpsAgent.

    Set the properties as shown in the following image.


iWay Software