Use the tasks resource to create, update, delete, and view file ingestion and replication tasks.
Running and monitoring file ingestion and replication tasks involves a series of requests and responses. Use the followings methods to perform file ingestion and replication tasks:
GET response example showing a file ingestion and replication task with file list (file path) as the file pickup option
The following sample response shows a file ingestion and replication task with filePickupOption type as FILELIST and a filePickupFilePath in its sourceParameters, indicating that this task reads the designated pickup file to identify which files need to be processed.
GET response example showing a file ingestion and replication tasks with file list as the file pickup option
The following sample response shows a file ingestion and replication task with filePickupOption type as FILELIST, filepickupByName as LISTOFFILES, and a filePickupFileList in its sourceParameters, indicating that this task reads and identifies the designated pickup files to be processed.
Use a POST request to create a file ingestion and replication task.
POST request
To create a file ingestion and replication task through the API, use the following URI:
mftsaas/api/v1/mitasks
Include the following fields in the request:
Field
Type
Required
Description
name
String
Yes
Name of the task.
location
String
-
Location of the project.
projectId
String
-
ID number associated with the project.
projectName
String
-
Name of the project.
description
String
-
Description of the task.
sourceConnection
String
-
Directory from where files are transferred.
sourceType
String
Yes
Determines the type where files are transferred. Enter one of the following options:
- CONNECTION. Use connection as a source.
- FILELISTENER. Use file listener as a source.
includesubfolder
String
-
Determines whether to include the files in sub-folders in the transfer. Set the value to true to transfer files from all sub-folders under the defined source directory. Values are true or false.
checkDuplicate
String
-
Determines whether to check for duplicate files. Values are true or false. Set the value to true to check duplicate files and deny file transfer. If the value is set to false all files are transferred.
filePickupOption
String
Yes
Determines the file pickup method. Enter one of the following options:
- FILELIST. The file ingestion and replication task picks up files based on a file list.
- PATTERN. The file ingestion and replication task picks up files by pattern.
allowConcurrency
String
-
Determines whether to run multiple jobs concurrently. Set the value to true to run multiple jobs concurrently, else set the value to false.
Warning: Running concurrent jobs might cause unexpected results if the targets include duplicate files.
filePatternType
String
Yes
This applies when filePickupOption is PATTERN. File pattern type used to select files to transfer. Enter one of the following options:
- wildcard
- regex
filePattern
String
Yes
Enter file pattern types, depending on the file pattern that you have selected.
- wildcard. You can use the following wildcard character filters:
- An asterisk (*) matches any number of characters.
- A question mark (?) matches a single character.
- regex. Use regular expression to match the file pattern. Consider the following examples:
- Use the following syntax to listen to all files except for files with a name that contains out, foo, and baz: ^(?!.*(?:out|baz|foo)).*$ all except
- Use the following syntax to listen to all files with doc, docx, and pdf extensions: ([a-zA-Z0-9\s_\\.\-\(\):])+(.doc|.docx|.pdf)$
filepickupByName
String
Yes
This applies when filePickupOption is FILELIST. Enter one of the following options:
- filepath. Provide the path that contains the list of files to pick up and enter the file path.
- listoffiles. Provide the list of files to pick up and enter a comma-separated list of file names. Ensure there is no space before or after specifying the file name.
fileStability
Boolean
-
Determines if the task verifies whether the file is stable before picking it up. Enter one of the following values.
- true. The file ingestion and replication task verifies whether the file is stable before picking it up.
- false. The file ingestion and replication task does not verify whether the file is stable before picking it up.
Default is false.
stabilityCheckInterval
Int
-
Time in seconds that a file ingestion and replication task waits to check the file stability.
You can specify a value in the stabilityCheckInterval field only if the fileStability option is set to true.
The stability check interval ranges between 10 seconds to 300 seconds.
postPickupAction
String
-
Determines what to do with source files after the transfer of files. The following options are available:
- KEEP. Keep the files in the source directory.
- DELETE. Delete the files from the source directory.
- RENAME. Rename the files in the source directory. You must specify a file name suffix that File ingestion and replication adds to the file name when renaming the files.
- ARCHIVE. Archive the files to a different location. You must specify an archive directory.
targetConnection
String
Yes
Directory details to which files are transferred.
taskActions
String
-
Actions to process files in the file ingestion and replication task. If you add multiple actions, file ingestion and replication processes files in a sequence.
actions
File processing action.
Enter the following file processing actions:
- To compress files, enter Compression.
- To decompress files, enter Decompression.
- To encrypt files, enter Encryption.
- To dencrypt files, enter Decryption.
- To move files from multiple folders to a single folder and to rename file in the target directory, enter File Operations.
- To scan files for viruses by using the ICAP protocol, enter Virus Scan.
action type
Enter the action type depending on the action that you add.
To compress files use one of the following methods.
- Zip
- Tar
- Gzip
- Bzip2
To decompress files use one of the following methods.
- Unzip
- Untar
- Gunzip
- Bunzip2
To encrypt files add PGP. Enter the key ID in the properties.
Note: The file ingestion and replication task uses the PGP method to encrypt files. Generate a key ring using the CLI. Enter the key ring in the Key ID. For more information about the keyring CLIs, refer to key ring command reference in Tasks.
To decrypt files, add PGP. Enter the key passphrase in the properties.
Note: The file ingestion and replication task uses the PGP method to encrypt files. Generate the key passphrase using the CLI. Enter the key passphrase in the Key Passphrase. For more information about the keyring CLIs, refer to key ring command reference in Tasks.
POST request example
Use this sample as a reference to create a file ingestion and replication task with file pattern as the file pickup option
Note: The created and updated time in the response is displayed in the UTC time.
Update a file ingestion and replication task
Use a PUT request to update a file ingestion and replication task.
PUT request
To update a file ingestion and replication task, use the following URI:
mftsaas/api/v1/mitasks/<taskID>
Include the following fields in the PUT request:
Field
Type
Required
Description
id
String
-
ID number of the task.
name
String
Yes
Name of the task.
description
String
-
Description of the task.
sourceType
String
Yes
Determines the type where files are transferred. Enter one of the following options:
- CONNECTION. Use connection as a source.
- FILELISTENER. Use file listener as a source.
sourceConnection
String
-
Directory from where files are transferred.
includeSubfolder
String
-
Values are true or false. Set the value to true to transfer files from all sub-folders under the defined source directory.
checkDuplicate
String
-
Values are true or false. Set the value to true to check duplicate files and deny file transfer. If the value is set to false all files are transferred.
filePatternType
String
Yes
File name pattern used to select the files to transfer. Enter one of the following options:
- Wildcard
- Regex
filePattern
String
Yes
Enter pattern types, depending on the file pattern that you have selected.
- wildcard. You can use the following wildcard character filters:
- An asterisk (*) matches any number of characters.
- A question mark (?) matches a single character.
- Regex. Use regular expression to match the file pattern. Consider the following examples:
- Use the following syntax to listen to all files except for files with a name that contains out, foo, and baz: ^(?!.*(?:out|baz|foo)).*$ à all except
- Use the following syntax to listen to all files with doc and docx, pdf extensions: ([a-zA-Z0-9\s_\\.\-\(\):])+(.doc|.docx|.pdf)$ à
fileStability
Boolean
-
Determines if the task verifies whether the file is stable before picking it up. Enter one of the following values.
- true. The file ingestion and replication task verifies whether the file is stable before picking it up.
- false. The file ingestion and replication task does not verify whether the file is stable before picking it up.
Default is false.
stabilityCheckInterval
Int
-
Time in seconds that a file ingestion and replication task waits to check the file stability.
You can specify a value in the stabilityCheckInterval field only if the fileStability option is set to true.
The stability check interval ranges between 10 seconds to 300 seconds.
postPickupAction
String
-
Determines what to do with source files after the files transfer. The following options are available:
- KEEP. Keep the files in the source directory.
- DELETE. Delete the files from the source directory.
- RENAME. Rename the files in the source directory. You must specify a file name suffix that file ingestion and replication adds to the file name when renaming the files.
- ARCHIVE. Archive the files to a different location. You must specify an archive directory.
targetConnection
String
Yes
Directory details to which files are transferred.
PUT request example
Use this sample as a reference to update a file ingestion and replication task.
Note: The created and updated time in the response is displayed in the UTC time.
View the location of a file ingestion and replication task
Use the GET request to view the location of a file ingestion and replication task.
GET request
Use the following URI to get the location of a file ingestion and replication task.
/api/v1/mitasks?resolveLocation=true
GET response example
If the request to get the file location of a file ingestion and replication task is successful, you might receive a response similar to the following example: