In this article
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Field Name | Field Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Label* | String | Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline. | ||||||||
Directory Default Value: N/A
| String/Expression | Specify the URL path to the directory where files will be searched in the following format: The supported file protocols are:
| ||||||||
File filter*
| String/Expression | Specify a GLOB pattern to be applied to select one or more files in the directory. The File filter property can be a JavaScript expression which will be evaluated with values from the input view document. [None]
| ||||||||
Polling interval in seconds*
| Integer | Specify the time gap between each poll request (in seconds). | ||||||||
Polling timeout* Default value: 30 | Integer | Specify a period of time after which file polling must end. If the Polling timeout is set to:
| ||||||||
Polling-timeout unit
| Dropdown list | Specify a value for polling timeout. | ||||||||
Only Output on Change | Checkbox | Select this check box to instruct the Snap to provide an output only when there is a change in the contents of the polled directory. When selected, the Snap provides an output during its initial run if it finds matching documents. However, it provides polling results in the next run only if the polled directory has newer files that match the pattern specified. Default value: Selected | ||||||||
Number of retries Minimum value: 0 | Integer | Specify the maximum number of retry attempts that the Snap must make in case there is a network failure, and the Snap is unable to read the target file. If the value is larger than 0, the Snap first downloads the target file into a temporary local file. If any error occurs during the download, the Snap waits for the time specified in the Retry interval and attempts to download the file again from the beginning. When the download is successful, the Snap streams the data from the temporary file to the downstream Pipeline. All temporary local files are deleted when they are no longer needed. Ensure that the local drive has sufficient free disk space to store the temporary local file. | ||||||||
Retry interval (seconds) Minimum value: 1 Default value: 1 | Integer | Specify the minimum number of seconds for which the Snap must wait before attempting recovery from a network failure. | ||||||||
Advanced properties | Use this field set to define specific settings for polling files. | |||||||||
Properties | Dropdown list | Choose either of the following options:
| ||||||||
Values | String/Expression |
| ||||||||
Snap execution Default Value: Validate & Execute | Dropdown list | Select one of the following three modes in which the Snap executes:
|
...
Error | Reason | Resolution |
---|---|---|
| The library that we use for SFTP connections no longer supports deprecated signature protocols by default. (This changed with the 4.33 GA release. | Add the algorithm to the serverProposal in the global.properties file.
Learn more: Configuration Options |
| If you have set the Polling Timeout value to a few seconds, it results in the S3 request getting canceled. | Increase the value of Polling Timeout (in seconds) for the Snap to work successfully. We recommend that you set the Polling Timeout value to the default value of 30 minutes or more to fetch all the S3 data. |
Examples
...
Write a List of Files in a Specific Directory
...
Expand | ||
---|---|---|
| ||
To make this example work, you must perform the following tasks:
Create the File Poller Pipeline You design a pipeline containing the following Snaps:
You will note that the File Poller has open input and output views. This is because it receives data from the Trigger Task associated with it and returns processed data back to the same Trigger Task. CSV ParserYou use the CSV Parser Snap with the default settings: MapperYou configure the Mapper Snap to receive the parsed CSV data and map the message in the CSV document to the $msg variable: File PollerYou configure the File Poller Snap to poll the /QA/Documentation/File Poller/ directory for all files that match the pattern contained in the $msg variable, which you use as a file filter parameter: CreatingCreate a Trigger Task for the File Poller Pipeline You save the pipeline, click the (Create Task) button, and configure the Trigger Task: You click Update to complete setting up the task; then navigate to the Manager to view the Trigger Task's properties: You copy the Cloud URL and authorization bearer token, and navigate to ServiceNow to set up the API call. Create a REST call in ServiceNow Create a REST Call in ServiceNow by appending the authorization token to the Cloud URL that you copied in the previous step:
For details on how to set up REST calls using ServiceNow, see ServiceNow documentation. While configuring the REST call, ensure that:
You click Test to check the REST call. For a successful execution, the pipeline returns a list of files whose extension matches the value in the Content field: Download this pipeline. |
...