IBMStreams com.ibm.streamsx.inet Toolkit > com.ibm.streamsx.inet 2.9.6 > com.ibm.streamsx.inet.ftp > FTPCommand
The FTPCommand operator can run an ftp command at a remote host by using the FTP, FTPS, or SFTP protocols. Possible commands are: none, del, rm, rmdir, mkdir, rename, modificationTime, and pwd. The modificationTime is not possible in the SFTP protocol. The command string and the command arguments are received from port 0.
The FTPCommand operator must not be used inside a consistent region!
Required: command, host, path, protocol, username
Optional: connectionCloseMode, connectionTimeout, curlVerbose, filename, filenameTo, password, sendStatisticsOnError, transferTimeout
This input port triggers a ftp command execution. Typically the requested command and parameters are received from stream attributes.
This optional input port may be used to set/change the username and password.
Get the command result string
Get the command success indication.
This function returns a string with the url including schema.
Deprecated: Get the number of executed ftp commands(in case of rename only one is counted). Use function CommandCount() instead.
Get the number of executed ftp commands(in case of rename only one is counted)
Deprecated: Get the number of failed ftp commands. Use function CommandFailureCount() instead.
Get the number of failed ftp commands
Return the argument unchanged.
Deprecated: Get the error number. Use function ErrorCode() instead.
Get the error number
Get the error description
This function returns a string with the url including schema.
Deprecated: Get the number of executed ftp commands(in case of rename only one is counted). Use function CommandCount() instead.
Get the number of executed ftp commands(in case of rename only one is counted)
Deprecated: Get the number of failed ftp commands. Use function CommandFailureCount() instead.
Get the number of failed ftp commands
Return the argument unchanged.
This mandatory port delivers command results and additional statistics information. The GetData output functions must be applied to this port.
This optional port may be used to carry error information and diagnostics. The GetError output functions may be applied to this port. If no output assignment is applied, the output stream must have a single attribute of type rstring.
Required: command, host, path, protocol, username
Optional: connectionCloseMode, connectionTimeout, curlVerbose, filename, filenameTo, password, sendStatisticsOnError, transferTimeout
the command to be executed
This optionally parameter controls when the closing of connection after transfer. The parameter takes one value of type ConnectionCloseMode. Default value is never.
This is the maximum time in seconds that you allow the connection to the server to take. This only limits the connection phase, once it has connected, this option is of no more use. Set to zero to switch to the default built-in connection timeout - 120 seconds. See also the transferTimeout parameter.
Verbose mode for curl lib default is false. The curl information are sent stderr.
The command argument / may be empty for pwd
The to filename for rename - must be non empty for rename command
Hostname or IP address of the remote host in form hostname[:port].
The password for the ftp user. If the operator has two input ports and this parameter is an attribute parameter it must be supplied from the second input port.
The path of the remote directory where the command is executed. The parameter must end with a '/'. The path should begin with '/'. In case of ftp protocols the path is relative to the home directory of the user and may depend on the server configuration. In case of ftp protocol an absolute path must start with '//'. In case of sftp the path is an absolute path. A path relative to users home directory may be entered in the form '~/'.
Protocol and encryption properties of the connection. This parameter takes one value of type Protocol
If set to true, the operator sends out a statistics tuple on port 0 when the operation fails. Default value is true.
This is the maximum time in seconds that you allow the libcurl transfer operation to take. Normally, name lookups can take a considerable time. Default timeout is 0 (zero) which means it never times out.
The ftp username. If the operator has two input ports and this parameter is an attribute parameter it must be supplied from the second input port.
stream<rstring fileName, boolean success> ${ResultStream} as OUT = FTPCommand(${CommandStream} as IN) { param protocol : ftp; host : IN.host; path : IN.path + "/"; filename : IN.fileName; command : "del"; username : "${username}"; password : "${password}"; output OUT : success = Success(); }