Package com.amalgamasimulation.studies.remote
To start an application, create an instance of the `HeadlessApplication` class.
Application supports HTTP-based communication - an embedded HTTP server is launched when the application is started. The HTTP port number used by the application is passed to the `HeadlessApplication` class constructor.
The HTTP API is as follows:
1. Submit a new simulation task
Request endpoint:POST /run/id/(place Run ID here)/seed/(place seed here)
Request body:
pass the scenario file as `multipart/form-data` with a single part with
arbitrary string as key name (e.g., 'filedata') and the scenario file
contents as value.
Run ID should look like: `ABC-123-DEF` (3 letters, 3 digits, 3 letters). Seed
is an integer number. See ShortId class for details.
2. Stop a task
Request endpoint:POST /stop/(place Run ID here)
The task is stopped gracefully.
3. Get status of all tasks
Request endpoint:GET /progress
This endpoint returns information for all known tasks. A task is known as soon as it is submitted and until it is removed from the application.
4. Get simulation results
Request endpoint:GET /result/(place Run ID here)
5. Remove a task from the application
A task that has completed can be removed using this endpoint:DELETE /(place Run ID here)
6. Shutdown the application
Use this endpoint to shutdown the application:POST /shutdown
-
ClassDescriptionA singleton object to communicate with the Amalgama Cloud Server.HeadlessApplication<S extends org.eclipse.emf.ecore.EObject,
M extends Model> An application that accepts tasks (e.g.HTTP response codes.RemoteRun<S extends org.eclipse.emf.ecore.EObject>A proxy to the experiment performed on the Amalgama Cloud Server.RemoteRunHelper<S extends org.eclipse.emf.ecore.EObject>This implementation ofIRemoteRunHelperenables server-side execution.