REST API Reference > Data Ingestion and Replication REST API > File Ingestion and Replication REST API
  

File Ingestion and Replication REST API

Use the file ingestion and replication resources to run and monitor file ingestion and replication tasks.
When you use file ingestion and replication resources, note the following rules:
Note: If you use a tool such as Postman that automatically includes the HTTP version, do not enter the HTTP version in the URL. If the HTTP version appears twice in the URL, the request fails.

Jobs

Use the job resource to start a file ingestion and replication job. You can also use the job resource to retrieve job status or job logs for a file ingestion and replication task. Use the file ingestion and replication REST API version 1 task resource to retrieve the ID and name of the task.

Run Request

To start a file ingestion and replication task job, use the following URI:
mftsaas/api/v1/job
Include the following information in the request:
Field
Type
Required
Description
taskId
String
Yes
File ingestion and replication ID.
taskName
String
-
File ingestion and replication name.
Use the following source directory and target directory keys for the specified connectors when you start a file ingestion and replication job:
Connector
srcDir
tgtDir
local
sourceDirectory
targetDirectory
ftp,ftps,sftp
sourceDirectory
targetDirectory
gcs
sourceDirectory
gcsTargetLocation
hdfs
sourceDirectory
hdfsTargetLocation
adlsgen2
sourceDirectory
adlsGen2TargetLocation
s3
s3SourceLocation
s3TargetLocation
blob
blobSourceLocation
blobContainer
You can overwrite the following parameters using the job resource REST API:
Category
Parameter
ID
General
Source Connection
sourceConnection
General
Target Connection
targetConnection
General
Parallel Batch Log Level
parallelBatch
General
Log Level
logLevel
Source
Source Directory
sourceDirectory
Source
File Pattern
filePattern
Source
Batch Size
batchSize
Source
Include files from sub-folders
includeSubfolder
Source
Skip Duplicate files
checkDuplicate
Source
Check File Stability
fileStability
Source
Stability Check Interval
stabilityCheckInterval
Target
Target Directory
targetDirectory
Note: You must pass the connection ID to overwrite the source and target connection parameters.
Use the following sample as a reference to start a file ingestion and replication task job:
{
"taskId": "k1YHA1blhcBjbJvCIRQX2s",
"taskName": "localtolocal_param2"
}
Use the following sample to overwrite the source option values that were passed in the user interface:
"variables": [{
"variable": "<string>",
"value": "<string>"
}]
In the following example, the parameter value that were passed in the user interface is overwritten to corresponding values provided in JSON POST while using the job resource REST API:
POST <serverUrl>/mftsaas/api/v1/job HTTP/<HTTP version>
Content-Type: application/json
Accept: application/json
IDS-SESSION-ID: <SessionId>

{
"taskId": "0efdVUEZeV2cB0quomeksd",
"taskName": "localtolocal_param2",
"parameters": {
"category": [{

"id": "General",

"parameter": [

{

"id":"sourceConnection",

"value":"AdvancedSFTPV2"

},

{

"id":"targetConnection",

"value":"AdvancedSFTPV2"

},

{

"id":"parallelBatch",

"value":"10"

},

{

"id":"logLevel",

"value":"DEBUG"

}

]

},{

"id": "Source",

"parameter": [{

"id": "sourceDirectory",

"value": "/root/test1"

},

{

"id":"filePatternType",

"value":"reg"

},

{

"id": "filePattern",

"value": "*.txt"

},

{

"id": "batchSize",

"value": "5"

},

{

"id":"includeSubfolder",

"value":"true"

},

{

"id":"checkDuplicate",

"value":"true"

},

{

"id":"fileStability",

"value":"true"

},

{

"id":"stabilityCheckInterval",

"value":"30"

}

]

},

{

"id": "Target",

"parameter": [{

"id": "targetDirectory",

"value": "/root/test2"

}]

}

]

}

}
The following example shows to override a file ingestion and replication task with filename as a variable:
POST <serverUrl>/mftsaas/api/v1/job HTTP/<HTTP version>
Content-Type: application/json
Accept: application/json
IDS-SESSION-ID: <SessionId>

{
"taskId": "4m24k3UFWMkkqd55YDefIB",
"taskName": "R41_Local_Local",
"parameters": {
"category": [
{
"id": "Source",
"parameter": [
{
"id": "sourceDirectory",
"value": "/${Parentfolder}"
},
{
"id": "filePickupFilePath",
"value": "${filename}"
},
{
"id": "batchSize",
"value": "5"
}
]
},
{
"id": "Target",
"parameter": [
{
"id": "targetDirectory",
"value": "/${Parentfolder}/Target"
}
]
}
]
},
"variables": [
{
"variable": "Parentfolder",
"value": "root/Arun"
},
{
"variable": "filename",
"value": "filepath.txt"
}
]
}
The following exampleshows to override a file ingestion and replication task with filelist as a variable:
POST <serverUrl>/mftsaas/api/v1/job HTTP/<HTTP version>
Content-Type: application/json
Accept: application/json
IDS-SESSION-ID: <SessionId>

{
"taskId": "4m24k3UFWMkkqd55YDefIB",
"taskName": "R41_Local_Local",
"parameters": {
"category": [
{
"id": "Source",
"parameter": [
{
"id": "sourceDirectory",
"value": "/${Parentfolder}"
},
{
"id": "filePickupFileList",
"value": "${filelist}"
},
{
"id": "batchSize",
"value": "5"
}
]
},
{
"id": "Target",
"parameter": [
{
"id": "targetDirectory",
"value": "/${Parentfolder}/Target"
}
]
}
]
},
"variables": [
{
"variable": "Parentfolder",
"value": "root/Arun"
},
{
"variable": "filelist",
"value": "File1.txt,File2.txt,File3.txt,File4.txt"
}
]
}

Run Response

If successful, file ingestion and replication returns the run ID for the job. Use the run ID to monitor the job status and request log files for the job.
If unsuccessful, the response includes a reason for the failure.

GET Status Request

To retrieve the status of a specific file ingestion and replication task job, use the following URI:
mftsaas/api/v1/job/<runId>/status

GET Status Response

If successful, file ingestion and replication returns the job status and the job details, which includes a list of files and the details and status of each file.
If unsuccessful, the response includes a reason for the failure.

GET Job Logs Request

To retrieve the log files for a specific file ingestion and replication task job, use the following URI:
mftsaas/api/v1/job/<runId>/logs

GET Job Logs Response

If successful, file ingestion and replication returns the log files for the job.
If unsuccessful, the response includes a reason for the failure.

Activity logs

Use the activityLog resource to retrieve details for a completed job using the task ID, run ID, or both.

REST API version 1 resource

Use the file ingestion and replication task REST API version 1 resource to retrieve details for a completed job using the task ID, run ID, or both.

GET Request

To request the details for a completed job using the task ID, use the following URI:
mftsaas/api/v1/mitasks/activityLog?taskId=<taskId>
To request the details for active or a completed job using the run ID, use the following URI:
mftsaas/api/v1/mitasks/activityLog?runId=<runId>
To specify the number of rows to skip, use the following URI:
mftsaas/api/v1/mitasks/activityLog?taskId={{taskID}}&<offset>
To specify a row limit, use the following URI:
mftsaas/api/v1/mitasks/activityLog?taskId={{taskID}}&<rowLimit>
You can use a combination of these options. For example, you can use the following URI:
mftsaas/api/v1/mitasks/activityLog?runId=<runId>&taskId=<taskId>&rowLimit=<rowLimit>&offset=<offset>
You can use the following attributes in the activityLog GET URI:
Field
Description
taskId
File ingestion and replication task ID.
runId
File ingestion and replication run ID.
offset
The number of rows to skip. For example, you might want to skip the first three rows.
rowLimit
The maximum number of rows to return. The maximum number you can specify is 100. Default is 25.
Note: You must specify either the taskId or the runId attribute in the GET URI.

GET Response

The activityLog object returns the following attributes:
Field
Description
id
File ingestion and replication job ID.
totaljobCount
Total number of jobs.
taskId
File ingestion and replication task ID.
runId
File ingestion and replication run ID.
startedBy
Name of the user who created the file ingestion and replication task.
startTime
Start time for the job. Uses Coordinated Universal Time (UTC).
endTime
End time for the job. Uses Coordinated Universal Time (UTC).
status
Whether the job completed successfully.
messageText
Error message associated with the job.
successFiles
The number of files that are successfully transferred from source to target.
failedFiles
The number of files that were not transferred from source to target.

GET Example

The following example shows a response to get details for a file ingestion and replication job using task ID:
{
"totalJobCount": 7,
"jobActivityLog": [
{
"id": 1000000200272,
"taskId": 89882,
"runId": 137205,
"startedBy": "b2b_pod1",
"startTime": "2021-09-13T09:55:13Z",
"endTime": "2021-09-13T09:55:15Z",
"status": "FAILED"
},
{
"id": 1000000200270,
"taskId": 89882,
"runId": 137204,
"startedBy": "b2b_pod1",
"startTime": "2021-09-13T09:52:44Z",
"endTime": "2021-09-13T09:53:02Z",
"status": "SUCCESS"
},
{
"id": 1000000200268,
"taskId": 89882,
"runId": 137202,
"startedBy": "b2b_pod1",
"startTime": "2021-09-13T09:49:55Z",
"endTime": "2021-09-13T09:50:12Z",
"status": "SUCCESS"
},
{
"id": 1000000200264,
"taskId": 89882,
"runId": 137199,
"startedBy": "b2b_pod1",
"startTime": "2021-09-13T09:43:27Z",
"endTime": "2021-09-13T09:43:42Z",
"status": "SUCCESS"
},
{
"id": 1000000200262,
"taskId": 89882,
"runId": 137198,
"startedBy": "b2b_pod1",
"startTime": "2021-09-13T09:13:58Z",
"endTime": "2021-09-13T09:14:04Z",
"status": "FAILED"
},
{
"id": 1000000200261,
"taskId": 89882,
"runId": 137197,
"startedBy": "b2b_pod1",
"startTime": "2021-09-13T09:13:09Z",
"endTime": "2021-09-13T09:13:28Z",
"status": "SUCCESS"
},
{
"id": 1000000200260,
"taskId": 89882,
"runId": 137196,
"startedBy": "b2b_pod1",
"startTime": "2021-09-13T09:12:21Z",
"endTime": "2021-09-13T09:12:35Z",
"status": "SUCCESS"
}
]
}
The following example shows a response to get details for a file ingestion and replication job using run ID:
{
"jobActivityLog": [
{
"jobStatusResponse": {
"jobStatus": "FAILED",
"errorMessage": "[8008 - Create File List] Directory '/root/testnot' not found ",
"jobDetails": {
"jobNumber": 1000000200262,
"status": "Failed",
"startTime": "2021-09-13T09:13:58Z",
"endTime": "2021-09-13T09:14:04Z",
"messageText": "[8008 - Create File List] Directory '/root/testnot' not found ",
"successFiles": 0,
"failedFiles": 0,
"fileDetails": []
}
}
}
]
}


{
"jobActivityLog": [
{
"jobStatusResponse": {
"jobStatus": "FAILED",
"errorMessage": "[8008 - Create File List] Directory '/root/testnot' not found ",
"jobDetails": {
"jobNumber": 1000000200262,
"status": "Failed",
"startTime": "2021-09-13T09:13:58Z",
"endTime": "2021-09-13T09:14:04Z",
"messageText": "[8008 - Create File List] Directory '/root/testnot' not found ",
"successFiles": 0,
"failedFiles": 0,
"fileDetails": []
}
}
}
]
}

REST API version 2 resource

Use the file ingestion and replication task REST API version 2 resource to retrieve details for a given job type using the task ID, run ID, both, or neither.

GET Request

To request details for all jobs in a file ingestion and replication task, use the following URI:
mftsaas/api/v2/mitasks/activityLog
To request the details for all jobs using the task ID, use the following URI:
mftsaas/api/v2/mitasks/activityLog?taskId=<taskId>
To request the details for all jobs using the run ID, use the following URI:
mftsaas/api/v2/mitasks/activityLog?runId=<runId>
To specify the number of rows to skip, use the following URI:
mftsaas/api/v2/mitasks/activityLog?taskId=<taskId>&offset=<offset>
To specify a row limit, use the following URI:
mftsaas/api/v2/mitasks/activityLog?taskId=<taskId>&rowLimit<rowLimit>
To specify a job type, use the following URI:
mftsaas/api/v2/mitasks/activityLog?jobType=<jobType>
To specify the number of file events to display and include the file event limit, use the following URI:
mftsaas/api/v2/mitasks/activityLog?runId={{runID}}&fetchFileEvents=true&fileEventsLimit=10
You can use a combination of these options. For example, you can use the following URI:
mftsaas/api/v2/mitasks/activityLog?runId=<runId>&taskId=<taskId>&rowLimit=<rowLimit>&offset=<offset>
You can use the following attributes in the activityLog GET URI:
Field
Description
taskId
File ingestion and replication task ID.
runId
File ingestion and replication run ID.
offset
The number of rows to skip. For example, you might want to skip the first three rows.
rowLimit
The maximum number of rows to return. The maximum number you can specify is 100. Default is 25.
jobType
Types of jobs to include in the response. You can use one of the following options:
  • - all
  • - completed
  • - active
Default is all.
fetchFileEvents
Determines if you want to display the file events. Set to one of the following values:
  • - true. The file ingestion and replication task displays the job file events.
  • - false. The file ingestion and replication task does not display the job file events.
Default is false.
fileEventsLimit
The number of file events to return. Applies when fetchFileEvents is set to true. The maximum number you can specify is 1000. Default is 100.

GET Response

The activityLog object returns the following attributes:
Field
Description
totaljobCount
Total number of jobs.
taskId
File ingestion and replication task ID.
runId
File ingestion and replication run ID.
startedBy
Name of the user who created the file ingestion and replication task.
startTime
Start time of the job. Uses Coordinated Universal Time (UTC).
endTime
End time of the job. Uses Coordinated Universal Time (UTC).
status
Whether the job completed successfully.
logLocation
The location of the session log.
messageText
Remarks associated with the job status.
successFiles
The number of files that are successfully transferred from source to target.
failedFiles
The number of files that were not transferred from source to target.

GET Example

The following example shows a response to a request to get details for a file ingestion and replication job using task ID:
{
"totalJobCount": 1,
"jobActivityLog": [
{
"taskId": "gS7ivoMYoOli6v7TR7MIIe",
"jobs": [
{
"runId": 490176,
"startedBy": "b2b_pod1",
"startTime": "2023-05-08T00:20:14Z",
"endTime": "2023-05-08T00:20:19Z",
"status": "SUCCESS"
"logLocation": "data/taskLogs/2023-05-08/1000000916286.log"
"messageText": "Job completed",
"successFiles": 8,
"failedFiles": 0

}
}
]
}
The following example shows a response to a request to get details for a file ingestion and replication job with fetchFileEvents set to true:
{
"totalJobCount": 1,
"jobActivityLog": [
{
"taskId": "34owubT0kvFe18LdELjXop",
"jobs": [
{
"runId": 496420,
"startedBy": "atl",
"startTime": "2023-05-08T07:25:25Z",
"endTime": "2023-05-08T07:25:54Z",
"status": "SUCCESS",
"logLocation": "data/taskLogs/2023-05-08/1000000855619.log",
"messageText": "Job completed normally",
"successFiles": 1003,
"failedFiles": 0,
"fileDetails": [
{
"path": "/root/Arun/May/Target/File_5.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 1,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_12.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 0,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_2.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 0,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_8.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 0,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_10.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 1,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_14.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 1,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_16.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 0,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_18.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 0,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_6.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 0,
"transferDirection": "UPLOAD"
},
{
"path": "/root/Arun/May/Target/File_13.txt",
"size": 12,
"lastModified": "2023-05-04T09:00:30Z",
"startTime": "2023-05-08T07:25:12Z",
"status": "SUCCESS",
"duration": 0,
"transferDirection": "UPLOAD"
}
]
}
]
}
]
}

Tasks

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:

View file ingestion and replication tasks

Use the GET request to view file ingestion and replication tasks.

GET request

To view the details of a particular file ingestion and replication task, include the file ingestion and replication in the following URI:
mftsaas/api/v1/mitasks/{{TASK-ID}}
To view the details for all file ingestion and replication tasks in the organization, omit the file ingestion and replication ID.
mftsaas/api/v1/mitasks
For example, use the following request:
GET https://na1.dm-us.informaticacloud.com/mftsaas/api/v1/mitasks HTTP/<HTTP version>
Content-Type: application/json
Accept: application/json
IDS-SESSION-ID: <SessionId>

GET response

Returns the task object if successful or an error object if errors occur.
The task object includes the following information about each of the file ingestion and replication tasks in the organization:
Field
Type
Description
taskId
String
ID number associated with the task.
taskName
String
Name of the task.
description
String
Description of the task.
location
String
Project and folder path where the task exists.
createTime
Date/time
Time when the task was created.
updateTime
Date/time
Time when the task was last updated.
Note: The create and update time in the response are in UTC time.

GET response example to view all file ingestion and replication tasks

The following sample response shows that there are three file ingestion and replication tasks in the organization:

{
"mitasks": [
{
"id": "1ONE5Vewzztl0tuKR0EDum",
"name": "A01_UMAR_MITASK2318",
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "",
"name": "",
"type": "local"
},
"targetConnection": {
"id": "0100000B000000000002",
"name": "ftps",
"type": "Advanced FTPS"
},
"agentGroupId": "01000025000000000002",
"updatedTime": "2019-01-30T11:17:49Z"
},
{
"id": "9D1tGkAxopJeFmUWoG4s48",
"name": "A01_UMAR_MITASK3354",
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "0100000B00000000000M",
"name": "AzureBlob",
"type": "Azure Blob"
},
"targetConnection": {
"id": "0100000B00000000000L",
"name": "SFTP_Conn",
"type": "Advanced SFTP"
},
"agentGroupId": "01000025000000000002",
"updatedTime": "2019-01-30T06:42:19Z"
},
{
"id": "4hcTFqKVOQrl1z4d6pGUMP",
"name": "A01_UMAR_MITASK5124",
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "0100000B0000000004IO",
"name": "S3",
"type": "AmazonS3"
},
"targetConnection": {
"id": "",
"name": "",
"type": "local"
},
"agentGroupId": "01000025000000000002",
"updatedTime": "2019-01-30T06:35:01Z"
}]
}

Get response example showing a file ingestion and replication task with file pattern as the file pickup option

The following sample response shows details of a file ingestion and replication task.
IDS-SESSION-ID:{{IDS-SESSION-ID}}
Accept:application/json
{
"id": "j9OLB12nqYObykdFSUMpO2",
"name": "FTPSrcTarget",
"location": {
"projectId": "dNC6zbp2lI8ghrKPo6hpwn",
"projectName": "Hardening"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "0100000B00000000028M",
"name": "CCI_FTPS",
"type": "Advanced FTPS V2"
},
"targetConnection": {
"id": "0100000B0000000001JR",
"name": "CCI_FTP_Lin",
"type": "Advanced FTP V2"
},
"sourceParameters": {
"filePattern": "*.txt",
"sourceTransferMode": "AUTO",
"filePatternType": "WILDCARD",
"includeSubfolder": "false",
"sourceDirectory": "/root/suraj/qa/test/automation/RSFiles",
"checkDuplicate": "false",
"fileStability": "true",
"stabilityCheckInterval": "60",
"postPickupAction": "KEEP"
},
"targetParameters": {
"fileExistsAction": "APPEND_TIMESTAMP",
"targetDirectory": "/",
"targetTransferMode": "AUTO"
},
"agentGroupId": "01000025000000000003",
"createdTime": "2019-02-04T10:34:08Z",
"updatedTime": "2019-02-04T11:04:02Z",
"filePickupOption": "PATTERN"
}

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.

{
"id": "aFHWKrr1RwycuBRBLTtt2t",
"name": "FilePath_CheckStability",
"location": {
"projectId": "0ggRhrI8ZziguyBxHBzuG0",
"projectName": "Default"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "",
"name": "",
"type": "local"
},
"targetConnection": {
"id": "",
"name": "",
"type": "local"
},
"sourceParameters": {
"filePickupFilePath": "test.txt",
"sourceDirectory": "/root/test",
"checkDuplicate": "false",
"stabilityCheckInterval": "60",
"postPickupAction": "KEEP",
"filepickupByName": "FILEPATH",
"batchSize": "5",
"fileStability": "true",
"stabilityCheckInterval": "60"
},
"targetParameters": {
"fileExistsAction": "OVERWRITE",
"targetDirectory": "/root/testCheckStability"
},
"agentGroupId": "01001D25000000000002",
"createdTime": "2021-08-13T09:38:03Z",
"updatedTime": "2021-08-13T09:39:02Z",
"logLevel": "NORMAL",
"filePickupOption": "FILELIST"
}

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.

{
"id": "2bTlAolXbAGlE7I5qauSAW",
"name": "DedupFilelist_pushdown",
"location": {
"projectId": "0ggRhrI8ZziguyBxHBzuG0",
"projectName": "Default"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "01001D0B0000000005PP",
"name": "ADLSGen2",
"type": "Azure Data Lake Gen2"
},
"targetConnection": {
"id": "01001D0B0000000005PU",
"name": "AzureDW_Gen2",
"type": "Azure DW"
},
"sourceParameters": {
"sourceDirectory": "/B2B/MI",
"checkDuplicate": "true",
"postPickupAction": "KEEP",
"filepickupByName": "LISTOFFILES",
"blockSize": "8388608",
"filePickupFileList": "File1.txt,File2.txt",
"batchSize": "5",
"timeoutInterval": "60",
"fileStability": "true",
"stabilityCheckInterval": "60"
},
"targetParameters": {
"commandType": "auto",
"targetTableName": "test1234",
"isPushdown": "true",
"ingestionMethod": "polybase",
"targetSchemaName": "testing",
"isTruncateTarget": "true"
},
"agentGroupId": "01001D25000000000002",
"createdTime": "2021-04-29T08:47:57Z",
"updatedTime": "2021-04-29T08:47:57Z",
"logLevel": "NORMAL",
"filePickupOption": "FILELIST"
}

Create a file ingestion and replication task

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
POST <serverURL>/public/core/v1/mitasks
Content-Type: application/json
Accept:application/json
Content-Type:application/json
IDS-SESSION-ID:{{IDS-SESSION-ID}}
{
"name": "Green Green v2",
"location": {
"projectId": "9JDNOBX9M31e2AD1dIUv6M",
"projectName": "Default"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "",
"name": "",
"type": "local"
},
"sourceParameters": {
"filePattern": "*.txt",
"filePatternType": "WILDCARD",
"includeSubfolder": "false",
"sourceDirectory": "C:\\Monitor",
"checkDuplicate": "false",
"fileStability": "true",
"stabilityCheckInterval": "60",
"postPickupAction": "KEEP"

},
"targetConnection": {
"id": "0100000B000000000002",
"name": "ADLS",
"type": "Azure Data Lake"
},
"targetParameters": {
"adlsTargetLocation": "/satyen/green"

},
"agentGroupId": "01000025000000000002",
"filePickupOption": "PATTERN",
"logLevel": "NORMAL",
"allowConcurrency": "true",
taskActions":[
{
"action": "Compression",
"actionType": "Zip",
"properties": {}
}
]
}
Use this sample as a reference to create a file ingestion and replication task with file path as the file pickup option.
POST <serverURL>/public/core/v1/mitasks
Content-Type: application/json
Accept:application/json
Content-Type:application/json
IDS-SESSION-ID:{{IDS-SESSION-ID}}
{
"name": "FilePath_RestAPI1",
"location": {
"projectId": "0ggRhrI8ZziguyBxHBzuG0",
"projectName": "Default"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "",
"name": "",
"type": "local"
},
"targetConnection": {
"id": "",
"name": "",
"type": "local"
},
"sourceParameters": {
"filePickupFilePath": "test.txt",
"sourceDirectory": "/root/test",
"checkDuplicate": "false",
"fileStability": "true",
"stabilityCheckInterval": "60",
"postPickupAction": "KEEP",
"filepickupByName": "FILEPATH",
"batchSize": "5"

},
"targetParameters": {
"fileExistsAction": "OVERWRITE",
"targetDirectory": "/root/testCheckStability"
},
"agentGroupId": "01001D25000000000002",
"logLevel": "NORMAL",
"filePickupOption": "FILELIST",
"allowConcurrency": "true"
}
Use this sample as a reference to create a file ingestion and replication task with file list as the file pickup option.
POST <serverURL>/public/core/v1/mitasks
Content-Type: application/json
Accept:application/json
Content-Type:application/json
IDS-SESSION-ID:{{IDS-SESSION-ID}}
{

"name": "DedupFilelist_RestAPI",
"location": {
"projectId": "0ggRhrI8ZziguyBxHBzuG0",
"projectName": "Default"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "01001D0B0000000005PP",
"name": "ADLSGen2",
"type": "Azure Data Lake Gen2"
},
"targetConnection": {
"id": "01001D0B0000000005PU",
"name": "AzureDW_Gen2",
"type": "Azure DW"
},
"sourceParameters": {
"sourceDirectory": "/B2B/MI",
"checkDuplicate": "true",
"postPickupAction": "KEEP",
"filepickupByName": "LISTOFFILES",
"blockSize": "8388608",
"filePickupFileList": "File1.txt,File2.txt",
"batchSize": "5",
"timeoutInterval": "60",
"fileStability": "true",
"stabilityCheckInterval": "60"

},
"targetParameters": {
"commandType": "auto",
"targetTableName": "test1234",
"isPushdown": "true",
"ingestionMethod": "polybase",
"targetSchemaName": "testing",
"isTruncateTarget": "true"
},
"agentGroupId": "01001D25000000000002",
"logLevel": "NORMAL",
"filePickupOption": "FILELIST",
"allowConcurrency": "true"
}

POST response example

If the request is successful, you might receive a response similar to the following example:

{
"id": "cEMWKpibm44bNf5aMjbJ4U",
"name": "Green Green v2",
"location": {
"projectId": "9JDNOBX9M31e2AD1dIUv6M",
"projectName": "Default"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "",
"name": "",
"type": "local"
},
"sourceParameters": {
"filePattern": "*.txt",
"filePatternType": "WILDCARD",
"includeSubfolder": "false",
"sourceDirectory": "C:\\Monitor",
"checkDuplicate": "false",
"fileStability": "true",
"stabilityCheckInterval": "60",
"postPickupAction": "KEEP"

},
"targetConnection": {
"id": "0100000B000000000002",
"name": "ADLS",
"type": "Azure Data Lake"
},
"targetParameters": {
"adlsTargetLocation": "/satyen/green"

},
"agentGroupId": "01000025000000000002",
"createdTime": "2018-08-27T07:03:32Z",
"updatedTime": "2018-08-29T12:14:58Z""
taskActions":[
{
"action": "Compression",
"actionType": "Zip",
"properties": {}
}
]
}
}
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.
PUT <serverUrl>/public/core/v1/mitasks
Content-Type: application/json
Accept:application/json
Content-Type:application/json
IDS-SESSION-ID:{{IDS-SESSION-ID}}
{
"id": "cEMWKpibm44bNf5aMjbJ4U",
"name": "Green Green v2",
"description": "Green Green v2 Description",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "",
"name": "",
"type": "local"
},
"sourceParameters": {
"filePattern": "*.txt",
"filePatternType": "WILDCARD",
"includeSubfolder": "false",
"sourceDirectory": "C:\\Monitor",
"checkDuplicate": "false",
"fileStability": "true",
"stabilityCheckInterval": "60",
"postPickupAction": "KEEP"

},
"targetConnection": {
"id": "0100000B000000000002",
"name": "ADLS",
"type": "Azure Data Lake"
},
"targetParameters": {
"adlsTargetLocation": "/satyen/green"
},
"agentGroupId": "01000025000000000002
}

PUT response example

If the request is successful, you might receive a response similar to the following example:
{
"id": "cEMWKpibm44bNf5aMjbJ4U",
"name": "Green Green v2",
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "",
"name": "",
"type": "local"
},
"sourceParameters": {
"filePattern": "*.txt",
"filePatternType": "WILDCARD",
"includeSubfolder": "false",
"sourceDirectory": "C:\\Monitor",
"checkDuplicate": "false",
"fileStability": "true",
"stabilityCheckInterval": "60",
"postPickupAction": "KEEP"

},
"targetConnection": {
"id": "0100000B000000000002",
"name": "ADLS",
"type": "Azure Data Lake"
},
"targetParameters": {
"adlsTargetLocation": "/satyen/green"

},
"agentGroupId": "01000025000000000002",
"createdTime": "2018-08-27T07:03:32Z",
"updatedTime": "2018-08-29T12:14:58Z"
}

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:
{
"miTasks": [
{
"id": "1ONE5Vewzztl0tuKR0EDum",
"name": "A01_UMAR_MITASK2318",
"location": {
"folderId": "digFZU6HMo4gCKYghtQvgD",
"folderName": "A_01_UMAR",
"projectId": "503RTpKDSSLlwmkwTXL0Qx",
"projectName": "Default"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "",
"name": "",
"type": "local"
},
"targetConnection": {
"id": "0100000B000000000002",
"name": "ftps",
"type": "Advanced FTPS"
},
"agentGroupId": "01000025000000000002",
"createdTime": "2019-01-28T09:54:53Z",
"updatedTime": "2019-01-30T11:17:49Z"
},
{
"id": "9D1tGkAxopJeFmUWoG4s48",
"name": "A01_UMAR_MITASK3354",
"location": {
"folderId": "digFZU6HMo4gCKYghtQvgD",
"folderName": "A_01_UMAR",
"projectId": "503RTpKDSSLlwmkwTXL0Qx",
"projectName": "Default"
},
"description": "",
"sourceType": "CONNECTION",
"sourceConnection": {
"id": "0100000B00000000000M",
"name": "AzureBlob",
"type": "Azure Blob"
},
"targetConnection": {
"id": "0100000B00000000000L",
"name": "SFTP_Conn",
"type": "Advanced SFTP"
},
"agentGroupId": "01000025000000000002",
"createdTime": "2019-01-30T06:36:28Z",
"updatedTime": "2019-01-30T06:42:20Z"
}
]
}

Delete a file ingestion and replication task

Use the DELETE request to delete a file ingestion and replication task.

DELETE request

To delete a file ingestion and replication include the task ID of the task through the API, in the following URI:
mftsaas/api/v1/mitasks/<taskID>