Creating a streaming ingestion and replication task
Use a POST request to create a streaming ingestion and replication task.
POST request
To create a streaming ingestion and replication task, use the following URL:
<server URI>/sisvc/restapi/v1/CreateEntity/Documents
Include the following fields in the request:
POST request example
Use this sample as a reference to create a streaming ingestion and replication task:
{
"name": "FileToFile17",
"description": "FileToFile_V2",
"runtimeId": "01000025000000000003",
"locationId": "8ubL3nIupMqk6bJC2mYtkh",
"currentVersion": "2",
"messageFormat": "binary",
"documentState": "VALID",
"parentInfo": [
{
"parentId": "8ubL3nIupMqk6bJC2mYtkh",
"parentName": "ng",
"parentType": "Project"
}
],
"nodes": [
{
"name": "FileToFile_source",
"type": "source",
"connectionId": "0100000B000000000002",
"transformationType": "",
"config": [
{
"key": "File",
"value": "siagent.log"
},
{
"key": "initialPosition",
"value": "Current Time"
},
{
"key": "rolloverPattern",
"value": ""
},
{
"key": "tailingMode",
"value": "Single file"
}
]
},
{
"name":"Filter",
"serviceType":"transformation",
"type":"filter",
"metaMetadata":"",
"config": [{
"key":"messageFormat",
"value":"binary"
}, {
"key":"transformationName",
"value":"Filter"
}, {
"key":"filterType",
"value":"regEx"
}, {
"key":"expression",
"value":"*"
}, {
"key":"name",
"value":"filter"
}
]
},
{
"name": "FileToFile_target",
"type": "target",
"connectionId": "0100000B000000000002",
"transformationType": "",
"config": [
{
"key": "File Name",
"value": "testing.log"
},
{
"key": "interimDirectory",
"value": "/home/agent/infa/test_file_target"
},
{
"key": "rolloverSize",
"value": 100
},
{
"key": "rolloverEvents",
"value": 100
},
{
"key": "rolloverTime",
"value": 100
}
]
}
],
"edges": [
{
"from": "FileToFile_source",
"to": "Filter"
},
{
"from": "Filter",
"to": "FileToFile_target"
}
],
"runtimeOptions": {
"maxLogSize": {
"value": 10,
"unit": "MB"
},
"logLevel": "INFO"
}
}
To create a streaming ingestion and replication task, you might send a request similar to the following example:
POST <server URI>/sisvc/restapi/v1/CreateEntity/Documents
Content-Type: application/json
Accept:application/json
IDS-SESSION-ID:2l0oeVx22Rujiej7yTokmT
POST response example
If the request is successful, you might receive a response similar to the following example: