Initializing help system before first use

Starting an Execution

The REST path to invoke a new execution is /rest/runtime/execution (with method POST)—it optionally takes parameters of two kinds: input data, and Mosel model or MPS/LP problem parameters, depending on how you have configured the web service.

Input data is supplied as a file called input—it should either contain Mosel model input data or, if configured as an MPS/LP problem, the MPS/LP file.

To submit this as an AJAX request, pass a JSON object with any of the following properties:
  • inputText, inputBase64—At most, use one of these properties to pass the input file data as text or as base-64 encoded binary data respectively. Use inputText for text-based MPS/LP problem formats and inputBase64 for non-text formats like LP.GZ and MPS.GZ.
  • parameters—This is the structure providing the names and values of Mosel model or MPS/LP parameters. For example: {"DEBUG": "True", "MAX_EMPLOYEES": "15"}.
Alternatively, use a form to submit an iframe AJAX request. This is useful when passing a file from the local filesystem as input. In this case, the form parameters will be:
  • input—The contents of the input file.
  • param-<parameter-name>—Text fields representing the parameters.
If the request is successful, the response is a JSON status object, otherwise it is an HTTP error code explaining the error. The status object contains various properties but at this stage the most relevant are:
  • id—Signifies the requested model or problem execution.
  • statusPath—Gives the full path to the status object enabling a subsequent request to be made using this path to poll the current status.
If the request was submitted as JSON data, the response is returned directly. If it was submitted via a form, an HTTP 200 OK status code is issued and response data is wrapped in a JSON object with properties:
  • status—This is the underlying status code for the request.
  • entity—Either the JSON status object or the error message as appropriate. You cannot assume that the entity will be valid JSON.