Solutions
Oracle DB API Wrapper
8min
overview note this solution supports select functions as well as insert, update, delete functions requirements a litmus edge is setup an oracle db is accessible through the network how to use the solution using docker after checkout, a tar gz file is expected to be downloaded log in to your litmusedge, navigate to applications > images click on (\[27 icon icon="fa fa plus"]) upload image and upload the tar file there once uploaded successfully, navigate to applications > containers and enter the docker run command here is an example to run oracle db api wrapper with docker docker run dt name oracle gateway p \<host port> 3000 \\ e log level='\<log level>' \\ e log max size='\<log max size>' \\ e log max files='\<log max files>' \\ \ restart=always \\ oracle gateway\ latest configuration options ⚠️ when using docker, the following environment variables must be set before running the container key description dt run the containers in detached mode and with terminal name oracle gateway assign a name to the container (optional) p \<host port> 3000 map a host port to port 3000 of the container (required) e log level='\<log level>' set the log level for the application (optional, defaults to 'info') e log max size='\<log max size>' set the maximum size for log files (optional, defaults to '20m') e log max files='\<log max files>' set the maximum number of files for log rotation (optional, defaults to '14d') restart=always automatically restart the container if it exits unexpectedly oracle gateway\ latest docker image tag and version example request body used in flows { "querystr" "select 1 from dual", "user" "sys", "password" "litmus\@1", "mode" "thn", "privilege" true, "connstring" "(description=(address=(protocol=tcp)(host='\<server>')(port='1521'))(connect data=(server='\<server>')(service name='xe')))", "server" "\<server>", "port" 1521, "hostname" "\<server>", "sid" "xe", "servicename" "xe"} method url description extras post /api/data parameters in body mode one of the following ("cns","srn","sid","thk","thn") > cns connection string (default) parameters user, password, connstring, querystr > srn service name parameters user, password, hostname, port, servicename, querystr > sid session id parameters user, password, hostname, port, sid, querystr > thk thick mode using oracle client connection parameters user, password, connstring, querystr > thn thin mode using oracle client connection parameters user, password, connstring, querystr example le flow template \[{"id" "97267f2fe9d4fbff","type" "tab","label" "flow 1","disabled"\ false,"info" "","env" \[]},{"id" "a38cf2acef421496","type" "inject","z" "97267f2fe9d4fbff","name" "","props" \[{"p" "payload"},{"p" "topic","vt" "str"}],"repeat" "","crontab" "","once"\ false,"oncedelay" 0 1,"topic" "","payload" "","payloadtype" "date","x" 220,"y" 100,"wires" \[\["78413ace9929c3c1"]]},{"id" "14ea163dcb02d5dc","type" "debug","z" "97267f2fe9d4fbff","name" "","active"\ true,"tosidebar"\ true,"console"\ false,"tostatus"\ false,"complete" "true","targettype" "full","statusval" "","statustype" "auto","x" 1010,"y" 220,"wires" \[]},{"id" "d90a39d5f7159c9d","type" "http request","z" "97267f2fe9d4fbff","name" "","method" "use","ret" "txt","paytoqs" "ignore","url" "","tls" "","persist"\ false,"proxy" "","insecurehttpparser"\ false,"authtype" "","senderr"\ false,"headers" \[],"x" 690,"y" 160,"wires" \[\["f598318fe565075f"]]},{"id" "78413ace9929c3c1","type" "function","z" "97267f2fe9d4fbff","name" "set connection parameters","func" "const ip = '\<ip container> \<maped port>';\n\nmsg method ='post';\nmsg url = http //${ip}/api/data ;\nmsg headers={\n 'content type' 'application/json'\n}\n\n//mode (cns,srn,sid,thk,thn)\n\nmsg payload = { \n querystr "", \n user "", \n password "", \n mode "", \n privilege true, \n connstring (description=(address=(protocol=tcp)(host='\<server>')(port='1521'))(connect data=(server='\<server>')(service name='\<service name>'))) , \n server "", \n port 1521, \n hostname "", \n sid "", \n servicename "\<service name>"}\n\nmsg redirect= "follow"\n\nreturn msg;\n","outputs" 1,"timeout" "","noerr" 0,"initialize" "","finalize" "","libs" \[],"x" 440,"y" 160,"wires" \[\["d90a39d5f7159c9d"]]},{"id" "f598318fe565075f","type" "json","z" "97267f2fe9d4fbff","name" "","property" "payload","action" "","pretty"\ false,"x" 850,"y" 220,"wires" \[\["14ea163dcb02d5dc"]]}] example le flow \[ { "id" "01740c8932692cc4", "type" "tab", "label" "flow 1", "disabled" false, "info" "", "env" \[] }, { "id" "e6cf2c52c4ec85dd", "type" "inject", "z" "01740c8932692cc4", "name" "", "props" \[{ "p" "payload" }, { "p" "topic", "vt" "str" }], "repeat" "", "crontab" "", "once" false, "oncedelay" 0 1, "topic" "", "payload" "", "payloadtype" "date", "x" 220, "y" 100, "wires" \[\["57137f9e ce895"]] }, { "id" "94b070f38334a607", "type" "debug", "z" "01740c8932692cc4", "name" "", "active" true, "tosidebar" true, "console" false, "tostatus" false, "complete" "true", "targettype" "full", "statusval" "", "statustype" "auto", "x" 1010, "y" 220, "wires" \[] }, { "id" "3eb9c0257dda01e3", "type" "http request", "z" "01740c8932692cc4", "name" "", "method" "use", "ret" "txt", "paytoqs" "ignore", "url" "", "tls" "", "persist" false, "proxy" "", "insecurehttpparser" false, "authtype" "", "senderr" false, "x" 690, "y" 160, "wires" \[\["1ef3217515dd667e"]] }, { "id" "57137f9e ce895", "type" "function", "z" "01740c8932692cc4", "name" "set connection parameters", "func" "const ip = '10 30 50 3 3000';\n\nmsg method ='post';\nmsg url = `http //${ip}/api/data`;\nmsg headers={\n 'content type' 'application/json'\n}\n\nmsg payload = {\n querystr \\"select 1 from dual\\",\n user \\"sys\\",\n password \\"litmus\@1\\",\n mode \\"thn\\",\n privilege true,\n connstring `(description=(address=(protocol=tcp)(host='${ip}')(port='1521'))(connect data=(server='${ip}')(service name='xe')))`,\n}\n\nmsg redirect= \\"follow\\"\n\nreturn msg;", "outputs" 1, "noerr" 0, "initialize" "", "finalize" "", "libs" \[], "x" 440, "y" 160, "wires" \[\["3eb9c0257dda01e3"]] }, { "id" "1ef3217515dd667e", "type" "json", "z" "01740c8932692cc4", "name" "", "property" "payload", "action" "", "pretty" false, "x" 850, "y" 220, "wires" \[\["94b070f38334a607"]] }]