meta data for this page
Client - Get Awaiting Jobs
When the exploration process of a project is running, JEA will generate a set of candidate solutions during each iteration (“generation”). The client program is responsible for evaluating the solutions, usually by applying the parameter values to simulation cases and running the simulations, and submitting the results back to JEA. This process involves two operations: getting the cases (“jobs”) that are awaiting evaluation, and submitting the results once simulations are done.
The Get Awaiting Jobs operation retrieves the pending cases from JEA. A valid JWT token must be included in the header, or the transaction will be rejected with an HTTP 401 Unauthorized error code.
Synopsis
- Method: GET
- Target: https://api.ensims.com/jea_web/api/jobs/<project ID>
- Header: Authorization “Bearer <existing JWT>”
- Body: none
- Success: Simulation Jobs object
- Error: HTTP 401 - Unauthorized
Simulation Jobs
An example of the simulation jobs object is shown below. It has an eventType
field with the value Request
. The projectName
field is used to identify the project of which the simulation cases belong. This is useful for multiple on-going optimisation projects. The name
field is for identify this particular submission (batch) within the project. It is important to keep the same project ID and the batch name in the corresponding Submit Results object.
The jobSet
entry is a map between the case IDs and the variable-value maps.
{ "eventType": "Request", "name": "Gen-11", "projectName": "circle", "jobSet": { "C-26_27": { "x": 2.6, "y": 2.7 }, "C-3_5": { "x": 0.3, "y": 0.5 }, "C-16_17": { "x": 1.6, "y": 1.7 }, "C-31_0": { "x": 3.1, "y": 0 } } }
Example using curl://
To send the Project Data command using curl:
curl -b cookies https://api.ensims.com/jea_web/api/jobs/circle
On successful operation, a Simulation Jobs object is returned. If the existing JWT is invalid, an HTTP 401 Unauthorized code will be returned.
Example using Python Requests
Make sure Requests is correctly installed in your Python environment, and run the following the lines:
import requests # Make a request with the stored cookies from the log on transaction # Get the awaiting cases of the 'circle' project r = requests.get('https://api.ensims.com/jea_web/api/jobs/circle', cookies=cookies) r.json()