Table of Contents

Search

  1. Preface
  2. Introduction to Edge Data Streaming Custom Entity Types
  3. Managing Custom Entity Types
  4. Custom Entities from Maven Archetypes
  5. REST APIs
  6. HTTP Request and Response Parameters
  7. Sample JSON Requests and Responses
  8. Glossary

Developer Guide

Developer Guide

Create Sources

Create Sources

Use the POST method to create a source in EDS.

POST Request in JSON Format

Generate a POST request. For example, the following POST request creates a source:
POST /api/dataflows/{dataflow-id}/sources Content-Type: application/json Accept: application/json

POST Body in JSON Format

{ "name":"TestSysLogTCP", "pluginId":"_VDS_SRC_SYSLOG_TCP", "config": { "portTCP":"7896","delimiter":"LF","eventSize":"8192","persistEvents":"false", "persistOptions":"# --\n# The interval in milliseconds after which the writes \n# are flushed to disk.\n# --\n#flushInterval=5000\n\n# --\n# The maximum number of db files to keep\n# --\n#maxDataFiles=10\n\n# --\n# Size of individual db file in bytes after which the files are rolled over\n# --\n#maxDataFileSize=1073741824\n\n# --\n# The max size of unsent data in bytes. If 0, it is unbounded\n# --\n#maxQueueSizeInBytes=0\n\n# --\n# The batch size in bytes up to which the data is buffered before writing to the disk.\n# --\n#batchSizeInBytes=262144" }, "stats": [ {"name": "Bytes Sent","value": 10001,"type": 101}, {"name": "Events Sent","value": 10003,"type": 101}, {"name": "Events to be Sent","value": 10006,"type": 101}, {"name": "Events not Delivered","value": 10002,"type": 101}, {"name": "Send Rate(Per Sec)","value": 10005,"type": 101}, {"name":"Events Dropped","value":1,"type":103}, {"name":"Concurrent Connections","value":2,"type":103}, {"name":"Maximum Concurrent Clients","value":3,"type":103} ] }

POST Response in JSON Format

The following is a sample response for the 201 Created code:
{ "id": {source-entity-id}, "name": "TestSysLogTCP", "type": "SOURCE", "self": { "rel": "self", "href": "api/dataflows/{dataflow-id}/sources/{source-entity-id}", "title": "TestSysLogTCP", "id": {source-entity-id} }, "dataflow": { "rel": "dataflow", "href": "api/dataflows/{dataflow-id}", "title": "TestDataflow", "id": {dataflow-id} }, "success": true, "valid": true, "createDate": "2015-07-06T12:49:47+05:30", "createdBy": "Administrator", "predefined": false, "deployable": true, "deploymentState": "DRAFT", "force": false, "pluginId": "_VDS_SRC_SYSLOG_TCP", "schedulable": false, "config": { "portTCP": "7896", "delimiter":"0", "eventSize": "8192", "persistEvents": "false", "persistOptions":"# --\n# The interval in milliseconds after which the writes \n# are flushed to disk.\n# --\n#flushInterval=5000\n\n# --\n# The maximum number of db files to keep\n# --\n#maxDataFiles=10\n\n# --\n# Size of individual db file in bytes after which the files are rolled over\n# --\n#maxDataFileSize=1073741824\n\n# --\n# The max size of unsent data in bytes. If 0, it is unbounded\n# --\n#maxQueueSizeInBytes=0\n\n# --\n# The batch size in bytes up to which the data is buffered before writing to the disk.\n# --\n#batchSizeInBytes=262144" }, "stats": [ {"name": "Bytes Sent","value": 10001,"type": 101}, {"name": "Events Sent","value": 10003,"type": 101}, {"name": "Events to be Sent","value": 10006,"type": 101}, {"name": "Events not Delivered","value": 10002,"type": 101}, {"name": "Send Rate(Per Sec)","value": 10005,"type": 101}, {"name":"Events Dropped","value":1,"type":103}, {"name":"Concurrent Connections","value":2,"type":103}, {"name":"Maximum Concurrent Clients","value":3,"type":103} ] }
The following is a sample response for the 404 Not Found code:
{ "success": false, "errors": [ { "code": DATAFLOW_NOT_FOUND, "parameters": [{dataflow-id}], "errorMessage": "Dataflow with Id: {dataflow-id} not found" } ] }
The following is a sample response for the 400 Bad Request code:
{ "success": false, "errors": [ { "code": NAME_FIELD_MISSING, "parameters": null, "errorMessage": "'name' field is missing in request" } ] }
The following is a sample response for the 500 Internal Server Error code:
{ "success": false, "errors": [ { "code": INTERNAL_SERVER_ERROR, "parameters": [{error-message}], "errorMessage": "Failed to create source. Exception: {error-message}" } ] }

0 COMMENTS

We’d like to hear from you!