Skip to content
kyrcha edited this page Dec 3, 2012 · 11 revisions

A run is created when a user decides to execute a scenario given some simulation parameters. Currently still under development.

READ Runs

GET /api/runs?prj_id={prj_id} | index

Displays a list with all the runs (queued, completed, running) under the given project.

Consumes: Route

Produces: JSON

{
  "success": true,
  "message": "Runs retrieved successfully",
  "size": 3,
  "data": [
    {id:1, status:completed, percentage:100},
    {id:2, status:running, percentage:45},
    {id:3, status:queued, percentage:0}
  ]
}

READ Run

GET /api/runs/{run-id} | show

Displays the status and/or the results of the given run.

Consumes: Route

Produces: JSON

{
  "success": true,
  "message": "Run retrieved successfully",
  "size": 1,
  "data": [
    {id:1, status:completed, percentage:100}
  ]
}

CREATE Run

POST /api/runs | create

Creates a new run by posting the smp_id parameter.

Consumes: Route, JSON

Produces: JSON

If simulation created successfully:

{
  "success": true,
  "message": "Sim creation successful",
  "run_id": "123abc"
}

If the simulation had a problem starting:

{
  "success": false,
  "message": "Sim creation failed due to: ...",
}

DELETE Run

DELETE /api/runs/{run-id} |  delete

Deletes the run along with the results.

Consumes: Route

Produces: Delete status

UPDATE Run

Cancels a thread that is running.

PUT /api/runs/{run-id} | cancel

Consumes: Route

Produces: Update status