"describeTransforms"
(jsonAction)
JSON transform "describeTransform"
action returns all available information about each specified transform in FairCom MQ and FairCom Edge
The "describeTransforms"
action returns all available information about each specified transform.
Request examples
Minimal
{ "api": "transform", "apiVersion": "1.0", "requestId": "00000014", "action": "describeTransforms", "params": { "transformNames": [ "SensorsTransform1" ] }, "authToken": "replaceWithAuthTokenFromCreateSession" }
{ "result": { "data": [ { "transformName": "SensorsTransform1", "apiVersion": 1, "transformActions": [ { "transformStepMethod": "jsonToTableFields", "transformParams": { "targetTableName": "sensors", "targetDatabaseName": "ctreeSql", "targetOwnerName": "admin", "defaultDateFormat": "iso8601", "defaultTimeFormat": "iso8601", "defaultJsonBinaryFormat": "base64", "mapOfPropertiesToFields": [ { "propertyPath": "gas_resistance_Ohms", "name": "quality", "type": "DOUBLE", "length": 8, "nullable": true }, { "propertyPath": "humidity", "name": "humidity", "type": "DOUBLE", "length": 8, "nullable": true }, { "propertyPath": "pressure_hPa", "name": "pressure", "type": "DOUBLE", "length": 8, "nullable": true }, { "propertyPath": "sensor", "name": "sensor", "type": "VARCHAR", "length": 300, "nullable": true }, { "propertyPath": "temperature_F", "name": "temperature", "type": "DOUBLE", "length": 8, "nullable": true } ], "extractorLibraryName": "ctmqttjson", "retentionPolicy": "autoPurge", "retentionUnit": "day", "retentionPeriod": 30 }, "inputFields": [ "source_payload" ] } ] } ] }, "requestId": "00000014", "errorCode": 0, "errorMessage": "" }
Use the describeTransforms JSON API action to return all available information about each specified transform
The "params"
property is an object that contains an action's parameters. Each action defines its own required and optional properties. See System limits for a comprehensive look at property requirements and limitations.
"params"
property summariesProperty | Description | Default | Type | Limits (inclusive) |
---|---|---|---|---|
transformNames | (optional) specifies |
| array |
"result"
property summariesProperty | Description | Type | Limits (inclusive) | |||||||
---|---|---|---|---|---|---|---|---|---|---|
data | (optional) specifies an array or object that the server returns, such as records returned by a query. It is always included in a response but contains an empty array when no results are available. | array | Its contents are determined by the action | |||||||
| (optional) specifies the name of the transform service | string |
| |||||||
| specifies the name of the transform action | string |
| |||||||
| (optional) allows the user to assign a name to each transform step | string | 0 to 250 bytes |
The "transformService"
property is an optional string that specifies the name of the transform service.
Note
If the "transformStepMethod"
property is set to "javascript"
, the "transformService"
property must be set to "v8TransformService"
.
The "transformStepMethod"
property is a required string that specifies the type of transform, such as the "javascript"
transform method that runs JavaScript to change the table's data or the "jsonToTableFields"
transform method that extracts values from properties in a JSON field and stores them in other fields.
Note
The "transformStepMethod"
property replaces the deprecated "transformActionName"
property.
The value of the "transformStepMethod"
affects the value of the "transformService"
property. The following table defines the possible values of the "transformService"
property when combined with the "transformStepMethod"
. Notice that some transform step methods are built into the server and do not require you to specify the "transformService"
.
|
| Definition |
---|---|---|
|
| |
|
| |
|
| |
|
| The |
|
|
Note
If the "transformStepMethod"
property is set to "javascript"
, the "transformService"
property must be set to "v8TransformService"
.
The "transformStepName"
property is an optional string that allows the user to assign a name to each transform step.