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 Transformations

Create Transformations

Use the POST method to create a transformation in EDS.

POST Request in JSON Format

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

POST Body in JSON Format

{ "name": "TestInsertTransform", "pluginId": "_VDS_TRX_INSERT_STR", "runMode": "WITH_PREVIOUS", "config": { "stringExpression": "#HOSTNAME#DATA" }, "stats": [ {"name": "Events Received", "value": 10301, "type": 102}, {"name": "Bytes Received", "value": 10300, "type": 102 }, {"name": "Events Generated", "value": 10303, "type": 102 }, {"name": "Bytes Sent", "value": 10302, "type": 102 }, {"name": "Time Taken for Transformation (Milli Sec)", "value": 10304, "type": 102} ] }

POST Response in JSON Format

The following is a sample response for the 201 Created code:
{ "id": {transform-entity-id}, "name": "TestInsertTransform", "type": "TRANSFORM", "pluginId": "_VDS_TRX_INSERT_STR", "runMode": "WITH_PREVIOUS", "self": { "rel": "self", "href": "api/dataflows/{dataflow-id}/transforms/{transform-entity-id}", "title": "TestInsertTransform", "id": {transform-entity-id} }, "dataflow": { "rel": "dataflow", "href": "api/dataflows/{dataflow-id}", "title": "TestDataflow", "id": {dataflow-id} }, "success": true, "valid": true, "createDate": "2015-07-07T15:38:48+05:30", "createdBy": "Administrator", "predefined": false, "deployable": true, "deploymentState": "DRAFT", "force": false, "schedulable": false, "config": { "stringExpression": "#HOSTNAME#DATA" }, "stats": [ {"name": "Events Received", "value": 10301, "type": 102}, {"name": "Bytes Received", "value": 10300, "type": 102 }, {"name": "Events Generated", "value": 10303, "type": 102 }, {"name": "Bytes Sent", "value": 10302, "type": 102 }, {"name": "Time Taken for Transformation (Milli Sec)", "value": 10304, "type": 102} ] }
The following is a sample responses 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 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 500 Internal Server Error code:
{ "success": false, "errors": [ { "code": INTERNAL_SERVER_ERROR, "parameters": [{error-message}], "errorMessage": "Failed to create transform. Exception: {error-message}" } ] }

0 COMMENTS

We’d like to hear from you!