14 | | Cloud Native Renew offers the following features. |
15 | | It is assumed, that the system is up and running, to do so on your own, follow the [#install installation instructions] further down the page. |
| 14 | Cloud Native Renew offers the following features.\\ |
| 15 | It is assumed, that the system is up and running, to do so on your own, [#download download] Cloud Native Renew and follow the [#install installation instructions] further down the page. |
| 16 | |
| 17 | For all examples it is assumed, that the service is running on localhost on port 8085. If you set it up otherwise than suggested in the [#install installation instructions], please use the corresponding URL you've set up instead.\\ |
| 18 | It is also assumed, that you have a web browser and the command line tool `curl` installed. |
| 19 | |
| 20 | For a quick overview over the available (non-health related) endpoints navigate to `http://localhost:8085/swagger-ui.html`. |
| 21 | |
| 22 | |
| 23 | === Examine Logs from the simulator via Web === |
| 24 | To access all system log data from when the cloud native plugin was loaded onwards, open up the URL:\\ |
| 25 | `http://localhost:8085/logs` |
| 26 | |
| 27 | === Upload nets and start a simulation === #upload |
| 28 | It is possible to use the Cloud Native Renew Plugin to upload net definitions to an HTTP endpoint. |
| 29 | Renew uses so called shadow net systems to simulate reference nets. |
| 30 | A shadow net system contains just the bare minimum to run a (non-visual) headless simulation. |
| 31 | To create a shadow net from a regular Renew .rnw net definition file, you can use Renew user interface. |
| 32 | To just try functionality you can also just use the supplied `example.sns` file.\\ |
| 33 | To upload a shadow net system and start a simulation follow these steps:\\ |
| 34 | * Create a shadow net system by doing either of these steps: |
| 35 | * You either can use the supplied `example.sns` file or |
| 36 | * You can also create a shadow net system yourself: Open up a Renew instance (or use the one spawned by the startup earlier), draw a reference net (or multiple), save all of your nets with a specific name each (File -> Save Drawing As...), and hit File -> Export -> Export all drawings (merged file) -> !ShadowNetSystem |
| 37 | Close the net drawing(s), but not Renew itself. |
| 38 | * Assume the shadow net system file is namend `example.sns`: Upload the net using:\\ `curl -F 'snsZipFile=@example.sns' localhost:8085/upload/sns?fileName=example.sns` |
| 39 | * After uploading you can start a simulation. Assume you named the main net within `example.sns` also `example`. |
| 40 | * Use this command: `curl -X POST 'localhost:8085/simulation/start?mainNet=example&sns=example.sns'` \\ |
| 41 | Note, that shadow net systems do not hold graphical information, therefore you will not be able to see the simulation within the spawned Renew instance, but you should be able to observe the console output generated by the running simulation. |
| 42 | Within the intended deployment, that was shown in the figure above, Renew instances are headless anyways and do not have any graphical output. |
| 43 | |
| 44 | === Control a running simulation === |
| 45 | It is possible to control a running simulation over HTTP. |
| 46 | To do you, you need to set up a simulation first. |
| 47 | The most simple way to do so is to draw (or load) a net, like the supplied `example.rnw` file and start a simulation from within the Renew GUI: `Simulation -> Start Simulation`\\ |
| 48 | You can alternatively use the method described [#upload above] to upload a shadow net system and start a simulation with it remotely. |
| 49 | As noted earlier, this method will not show graphical feedback, while starting through Renew directly does. |
| 50 | |
| 51 | * The simulation can now be controlled by using the following command:\\ |
| 52 | `curl -X POST 'localhost:8085/simulation/control?command=step'`\\ |
| 53 | You can use these keywords instead of `step`: |
| 54 | * `run` (To run simulations, that have been paused or only initialized) |
| 55 | * `step` (To execute a single step in the simulation) |
| 56 | * `stop` or `halt` (To suspend the simulation but do not terminate it) |
| 57 | * `term` (To terminate a simulation irreversibly. Subsequent control commands will have no effects until a new simulation is started.) |
| 58 | |
38 | | * You can for example upload an existing shadown net system .sns. |
39 | | * You either can use the supplied `example.sns` file or |
40 | | * You can also create a shadow net system yourself: Open up a Renew instance (or use the one spawned by the startup earlier), draw a reference net, save it with a specific name (File -> Save Drawing As...), and hit File -> Export -> Export all drawings (merged file) -> !ShadowNetSystem |
41 | | * If you created the net within the here supplied Renew instance with the cloud native plugin, close the net drawing, but not Renew itself. |
42 | | * Assume the shadow net system file is namend `example.sns`: Upload the net using: `curl -F 'snsZipFile=@example.sns' localhost:8085/upload/sns?fileName=example.sns` |
43 | | * After uploading you can start a simulation. Assume you named the net within `example.sns` also `example`. |
44 | | * Use this command: `curl -X POST 'localhost:8085/simulation/start?mainNet=example&sns=example.sns'` |
45 | | * The simulation can now be controlled by the endpoint: `curl -X POST 'localhost:8085/simulation/control?command=step'` Use the keywords: |
46 | | * `run` (To run simulations, that have been paused or only initialized) |
47 | | * `step` (To execute a single step in the simulation) |
48 | | * `stop` or `halt` (To suspend the simulation but do not terminate it) |
49 | | * `term` (To terminate a simulation irreversibly. Subsequent control commands will have no effects until a new simulation is started.) |
| 81 | |
| 82 | |