The GroLink API can be used to manage multiple files and is started without a specific project. To do so a main workbench is used which can be addressed using the reference (ref) “app” in the HTTP request. This main workbench can create new workbenches, load provided projects or run embedded examples. The main workbench is also able to list all currently opened workbenches.
In any cases it returns a workbench id that can then be used to address the new workbench with the ref wb/<id>. A request send to the sever will be forwarded directly to the referenced workbench, where it is either executed or if the workbench is busy wait. After the completion of the command from the request the request response to the client. In this way the API server has never to wait for any execution to be completed and can run non blocking.
There are two different ways to open a project,either the absolute path on the file system is provided and the server can reach this file or the content of the file (this only works with gsz) is decoded and added to the body of the request. The second way has the advantage that it works without a shared file system, for instance on docker, kubernetes or a remote sever.
After transferring the file both commands work similarly, they open a workbench the same way as in the GUI or the CLI and then return a workbench ID. ( command description)
Creating a new workbench will end in the same result as clicking file > new in the GUI. By default the new workbench will be using the new RGG template, yet it is possible to provide the name of another template that should be used. The templates can be listed with a specific command.
Listing and loading examples works similar to creating a workbench.
Saving the project is a workbench command that has to be addressed to the workbench that is suppose to be saved. If a path is provided the project will be saved at that location, otherwise if no path is provided the decoded gsz file will be returned to the client. This allows to save project that where executed on other file systems. ( command description)