-
Notifications
You must be signed in to change notification settings - Fork 0
Consumption models
RESTful protocol for for Consumption Models.
The following Foreign Key apply:
cons_models.app_id : Foreign Key to Appliances
GET /api/consmod?app_id={app_id} | index
Fetches the ids and names of all the Consumption Models in the appliance defined using the query parameter app_id
.
Consumes: Route, Parameter
Produces: JSON
{
"success": true,
"message": "Consumption Models retrieved successfully",
"size": 1,
"data": [
{
"_id": { "$oid": "4ffd693ee4b06b7b2983ed4a" },
"name": "Consumption Model 1",
"description": "I am a Consumption Model ",
"app_id": "4ff5bca7e4b0082c63d08df9",
"model": {
"n": 2,
"params": {
"n": 3,
"values": [
{
"p": 100,
"d": 10,
"s": 0
},
{
"p": 120,
"d": 5,
"s": 0
}
]
}
}
}
]
}
GET /api/consmod/{consmod_id} | show
Fetches all the the names, types and ids of the Consumption Models included in the given Appliance.
Consumes: Route
Produces: JSON
PUT /api/consmod/{consmod-id} | update
Updates the properties of the Consumption Model after editing.
Consumes: Route, JSON
Produces: JSON
DELETE /api/consmod/{consmod-id} | delete
Deletes the Consumption Model with the given id.
Consumes: Route
Produces: JSON with delete status
POST /api/consmod | create
Consumes: Route, JSON
{ name: "Consumption Model 1", description: "I am a Consumption Model ", app_id : "4ff5bca7e4b0082c63d08df9", model : { n : 222, params : { n : 3, values : [ {p : 100, d : 10, s: 0}, {p : 120, d : 5, s: 0 } ] } }
}