Skip to content
kvavliak edited this page Jul 9, 2012 · 3 revisions

Each Distribution belongs to ActivityModels (one for startTime, one for duration, and one repeatsNrOfTimes).

The following Foreign Key apply:

distributions.actmod_id : Foreign Key to Activity Models

READ Distribution

 GET /api/distr/{distr_id} | show

Fetches the properties of an Distribution . Consumes: Route

Produces: JSON

{ "success": true, "message": "Distribution retrieved successfully", "size": 1, "data": [ { "_id": { "$oid": "4ffafb1ae4b0540961e1f71c" }, "name": "Distribution 2", "type": "Normal Distribution", "description": "lala2", "distrType": "distribution type", "values": [ "3", "4" ], "actmod_id": "4ff5c44ee4b0d4da260a9a97", "parameters": [ { "w": 33, "mean": 33.3, "std": 33.4 }, { "w": 33, "mean": 33.3, "std": 33.4 } ] } ] }

READ Distributions of an Activity Model

 GET /api/distr?actmod_id=actmod_id | show

Fetches the properties of Distributions that belong to an Activity Model . Consumes: Route

Produces: JSON

CREATE Distributions

POST /api/distr | create

Creates a new Distribution for the given Activity Model, based on the properties filled up by the user.

Consumes: Route, JSON

{ name : "Distribution 1", type : "Normal Distribution", description : "lala2", distrType : "distribution type", values : ["3","4"], actmod_id : "4ff5c44ee4b0d4da260a9a97", parameters : [ { w : 23, mean : 23.3, std : 44.4 }, { w : 23, mean : 23.3, std : 44.4 } ] }

Produces: JSON with creation status

UPDATE Distributions

PUT /api/distr/{distr_id} | update

Updates the properties of the Distribution after editing.

Consumes: Route, JSON: like the one in show action

Produces: JSON with update status

DELETE Distribution

DELETE /api/distr/{distr_id} | delete

Deletes the existing Distribution.

Consumes: Route

Produces: Delete status