rest_client
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| rest_client [2021/09/29 14:28] – created wikiadmin | rest_client [2021/09/29 15:32] (current) – wikiadmin | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| then browse to the file. TransSECS will install the module. | then browse to the file. TransSECS will install the module. | ||
| + | |||
| + | You need to be running the " | ||
| + | |||
| + | {{: | ||
| ===== Adding REST servers ===== | ===== Adding REST servers ===== | ||
| Line 38: | Line 42: | ||
| ===== Populate the Recipe from a REST Services ===== | ===== Populate the Recipe from a REST Services ===== | ||
| - | When the " | + | When the " |
| The format of the URL we are calling is: | The format of the URL we are calling is: | ||
| Line 53: | Line 57: | ||
| Change this to match your service URL. In this case, the return is a JSON map. The script then parses the returned JSON and uses the recipe to populate the PP-SELECT remote host command. | Change this to match your service URL. In this case, the return is a JSON map. The script then parses the returned JSON and uses the recipe to populate the PP-SELECT remote host command. | ||
| + | |||
| + | The REST call is on this line: | ||
| + | |||
| + | < | ||
| + | resultJSON = / | ||
| + | </ | ||
| + | |||
| + | GetRecipe is the name of the REST server defined in the Devices/ | ||
| + | |||
| + | {{: | ||
| + | |||
| + | < | ||
| + | |||
| < | < | ||
| Line 104: | Line 121: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ===== Saving Data to a REST Services ===== | ||
| + | |||
| + | When the " | ||
| + | |||
| + | Similar to the recipe request, the, REST call is on this line: | ||
| + | |||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | StoreData is the name of the REST server defined in the Devices/ | ||
| + | |||
| + | {{: | ||
| + | |||
| + | The first and second arguments to < | ||
| + | |||
| + | |||
| + | < | ||
| + | // whenever this report is received, get the lotid, use the REST Service to read the recipe and then set it to the PP-SELECT S2F41 message and send it to the tool | ||
| + | var TransSecsController = Java.type(" | ||
| + | toolName = " | ||
| + | |||
| + | print ("Lot Completed Event" | ||
| + | |||
| + | try{ | ||
| + | host=TransSecsController.findController(toolName); | ||
| + | |||
| + | waferCount = incomingValue.getProperty(" | ||
| + | // demo URL http:// | ||
| + | // the body is a JSON-encoded string | ||
| + | jsonString = ' | ||
| + | url = " | ||
| + | print (" | ||
| + | / | ||
| + | |||
| + | } catch (e) { | ||
| + | print(" | ||
| + | print(e); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Testing ===== | ||
| + | |||
| + | You can test the sample REST project with the StandAloneGEMTool application that is part of TransSECS, or with the TransSECS [[runningthegeneratedequipmentsimulator|Equipment Simulator]] created from your host project. | ||
| + | |||
| + | For testing, you can use the [[https:// | ||
| + | |||
| + | < | ||
| + | docker run -p 7000:7000 --name restdemo | ||
| + | </ | ||
| + | |||
| + | Using the " | ||
| + | |||
| + | < | ||
| + | curl -X PUT -H " | ||
| + | </ | ||
| + | |||
| + | With the StandAloneGEMTool you can make the connection from your TransSECS host as normal. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Once you're connected set the Lot ID field to " | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Select the " | ||
| + | |||
| + | {{: | ||
| + | |||
| + | You will see the event sent to the host, with the recipe " | ||
| + | |||
| + | Choose the " | ||
| + | |||
| + | < | ||
| + | curl -X GET -w " | ||
| + | </ | ||
| + | |||
| + | (If you want to change the value in the REST server to be sure that it's actually chaning on the COMPLETED event, this command will set it to 22: | ||
| + | |||
| + | < | ||
| + | curl -X PUT -H " | ||
| + | </ | ||
| + | ) | ||
rest_client.1632940112.txt.gz · Last modified: by wikiadmin
