==== TransSECS as a REST Server ====
Deploying TransSECS with a REST interface allows the reading and writing of values over http. The "REST Module" must be installed to do this.
The default port for the server is 7220, so, for example the url may start with http://localhost:7220
All REST requests return a JSON object.
**REST Endpoints**
**///LIST//** - provides a list of known data points. For example:
http://localhost:7220/LIST
{
"ReadOnlyVariables":["gemtool.alids.gasflowproblem.alcd","gemtool.vids.controlstate", ... "gemtool.vids.spoolfulltime","gemtool.vids.spoolstarttime"],
"ReadWriteVariables":["gemtool.alids.gasflowproblem.enable","gemtool.alids.gasflowproblem.set"..."gemtool.vids.timeformat","gemtool.vids.wafercount"]
}
**///VALUES/value1[/value2 etc.]//** - provides the values for the given point(s). For example:
http://localhost:7220/VALUES/gemtool.vids.controlstate
{"gemtool.vids.controlstate":"3","Errors":"NONE"}
==== REST Server in TransSECS ====
It's also possible to deploy a RESTServiceManager inside TransSECS rather than wrapping at deployment. After adding the REST module to TransSECS, edit the ErgoTechConfiguration.properties file. Add this line to the end of the file:
serversdevicemanager.additionalservers=com.ergotech.vib.servers.rest.RESTServiceManager
Then add "UtilityServers" to the deviced node and right-click to add the "RESTServiceManager" from the list. Configure the server and then rebuild the application and go LIVE to test the configuration by going to the URL:
http://localhost:7220/LIST
That should give you a list of all the servers in the "UtilityServers" node.
For broader access, set //Publish// and //All Application//
{{:pasted:20230315-181304.png}}
Now LIST will now give you many additional tags. For example, if you are using the GEMHost sample application, one tag will be "GEMHost.variables". Going to this URL:
http://localhost:7220/VALUES/GEMHost.variables
will give you a list of all the variables in the system. After some events (CEIDs) have been received by your system you will see JSON representations of the messages and reports.
You can also update values and send messages. Here are two curl commands. The first sets the value of the PPIDParamValue in the HostCommandPPSELECT message. The second sends the message. The value of the PPIDParamValue in the message will be "TestRecipe" as set by the first command.
curl -X POST -H "Content-Type: application/json" -d '{"/gemhost/HostCommandPPSELECT>PPIDParamValue":"TestRecipe"}' http://localhost:7220/UPDATE
curl -X POST -H "Content-Type: application/json" -d '{"/gemhost/HostCommandPPSELECT>sendMessage": "1"}' http://localhost:7220/UPDATE