latestOpenAPI 3.1.0Apache License Version 2.02026-08-17498525913.3 KB

40169ccdec5c

rule-chain-controller

Test Script function

Execute the Script function and return the result. The format of request:

{
  "script": "Your Function as String",
  "scriptType": "One of: update, generate, filter, switch, json, string",
  "argNames": ["msg", "metadata", "type"],
  "msg": "{\"temperature\": 42}", 
  "metadata": {
    "deviceName": "Device A",
    "deviceType": "Thermometer"
  },
  "msgType": "POST_TELEMETRY_REQUEST"
}

Expected result JSON contains "output" and "error".

Available for users with 'TENANT_ADMIN' authority.

post/api/ruleChain/testScript

Query parameters

scriptLang'JS' | 'TBEL'

Script language: JS or TBEL

Request body

{"stackTrail":"components:schemas:JsonNode","oasType":"schema","type":"unknown","description":"A value representing the any type (object or primitive)","example":{}}

Example request

{}

Response

OK

{"stackTrail":"components:schemas:JsonNode","oasType":"schema","type":"unknown","description":"A value representing the any type (object or primitive)","example":{}}

Example response

{}