Skip to content
kyrcha edited this page Jun 27, 2012 · 41 revisions

This page specifies the RESTful protocol between the client and server applications of the CASSANDRA platform.

The conventions for writing the protocol will be:

[RESTful route] | [action]

To better present the protocol we have separated it by the entities involved as seen below:

Projects

Scenarios

Installations

Activities

Activity Models

Appliances

Simulation Parameters

Runs

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

READ

/{usrnm}/prj/{prj-id}/runs | GET /{usrnm}/prj/{prj-id}/runs | index

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

Consumes: Route

Produces: JSON

{
  runs: [
    {id=1, status=completed, percentage=100},
    {id=2, status=running, percentage=45},
    {id=3, status=queued, percentage=0}
  ]
}

--

/{usrnm}/prj/{prj-id}/runs/{run-id} | GET /{usrnm}/prj/{prj-id}/runs/{run-id} | show

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

Consumes: Route

Produces: JSON

{
  id:1,
  status=completed, 
  percentage=100
  results {
    ...
  },
  statistics {
    ...
  },
  summary {
    ...
  }
}

CREATE

/{usrnm}/prj/{prj-id}/sims | POST /{usrnm}/prj/{prj-id}/sims | create

Creates a new run by posting the entire scenario.

Consumes: Route, JSON

Produces: Create status

DELETE

/{usrnm}/prj/{prj-id}/sims | DELETE /{usrnm}/prj/{prj-id}/sims/{sim-id} | delete

Deletes the run along with the results.

Consumes: Route

Produces: Delete status

UPDATE

/{usrnm}/prj/{prj-id}/sims/{sim-id} | PUT /{usrnm}/prj/{prj-id}/sims/{sim-id}/{pause|resume} | update status

Based on what is passed in the http request the run can be paused or resumed.

Consumes: Route

Produces: Update status


Library

We assume for now that the libraries are read-only (R ops). There is no functionality in the protocol (yet) to make CUD operations. Also Demographics and CSNs to be added in the library.

READ

/libs | GET /libs | index

Returns a list of libs along with their ids.

--

/libs/{lib-id} | GET /libs/{lib-id} | index

For the given {lib-id} a list of contained entities is returned along with their name, type and id. These entities are structured in a tree according to their type. For now four top level types will be available: Installation, Appliance, Activity and DemandSideManagement.

--

/libs/{lib-id}/inst | GET /libs/{lib-id}/inst | index

Returns a list of Installations available in the library.

--

/libs/{lib-id}/app | GET /libs/{lib-id}/app | index

Returns a list of Appliances available in the library.

--

/libs/{lib-id}/act | GET /libs/{lib-id}/act | index

Returns a list of Activities available in the library.

--

/libs/{lib-id}/dsm | GET /libs/{lib-id}/dsm | index

Returns a list of DemandSideManagement schemes available in the library.

--

/libs/{lib-id}/inst/{inst-id} | GET /libs/{lib-id}/inst/{inst-id} | show

Displays the properties of the Installation with that {inst-id}.

--

/libs/{lib-id}/inst/{inst-id}/app | GET /libs/{lib-id}/inst/{inst-id}/app | index

Displays the Appliances of the Installation with that {inst-id}.

--

/libs/{lib-id}/inst/{inst-id}/app/{app-id} | GET /libs/{lib-id}/inst/{inst-id}/app/{app-id} | show

Displays the properties of the {app-id} Appliance of the Installation with that {inst-id}.

--

/libs/{lib-id}/inst/{inst-id}/app/{app-id}/consmod | GET /libs/{lib-id}/inst/{inst-id}/app/{app-id}/consmod | show

Displays the ConsumptionModel of the {app-id} Appliance of the Installation with that {inst-id}.

--

/libs/{lib-id}/app/{app-id} | GET /libs/{lib-id}/app/{app-id} | show

Displays the properties of the Appliance with that {app-id}.

--

/libs/{lib-id}/app/{app-id}/consmod | GET /libs/{lib-id}/app/{app-id}/consmod | show

Displays the ConsumptionModel of the given Appliance.


TODO

Users

Users should be able to login (MD5 hash and https as minimum security requirements) and after successfully entering their credentials, they should be redirected to /api/prj, where a list of their projects should be displayed.

Demographics

Under development.

Consumer Social Networks

Under development.

Clone this wiki locally