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

RESTful protocol for Installations.

The following Foreign Key apply:

installations.scenario_id : Foreign Key to Scenarios

installations.belongsToInstallation : Foreign Key to Installations

READ Installations

GET /api/inst?scn_id={scn_id} |  index

Retrieves the installations in the scenario (names, ids).

Consumes: Route, Parameter

Produces: JSON

{ "success": true, "message": "Installations retrieved successfully", "size": 2, "data": [ { "_id": { "$oid": "4ff5bca7e4b0082c63d08df6" }, "name": "Installation 1", "type": "Installation Type", "description": "Installation description", "scenario_id": "4ff5bca7e4b0082c63d08df3" }, { "_id": { "$oid": "4ff5bca7e4b0082c63d08df7" }, "name": "Installation 2", "description": "Installation description 2", "scenario_id": "4ff5bca7e4b0082c63d08df3", "belongsToInstallation": "4ff5bca7e4b0082c63d08df6" } ] }

READ Installation

GET /api/inst/{inst_id} | show

Fetches the properties of the Installation and other included entities (names, ids) such as Appliances that are included in the Installation.

Consumes: Route

Produces: JSON

CREATE Installation

POST /api/inst | create

Creates a new Installation based on the things added in the form.

Consumes: Route, JSON

{ name: "Installation 1", type : "Installation Type", description : "Installation description", scenario_id: "4ff5bca7e4b0082c63d08df3", belongsToInstallation : "4ff5bca7e4b0082c63d08df6" location : "Description of location", x : 234.232, y : 12.12 }

Produces: JSON

{ "success": true, "message": "Installation created successfully", "objectCreated": { name: "Installation 1", type : "Installation Type", description : "Installation description", scenario_id: "4ff5bca7e4b0082c63d08df3", belongsToInstallation : "4ff5bca7e4b0082c63d08df6" location : "Description of location", x : 234.232, y : 12.12, "_id": { "$oid": "4ff5c327e4b0082c63d08e01" } } }

UPDATE Installation

PUT /api/inst/{inst_id} | update

Updates the properties of the Installation after editing.

Consumes: Route, JSON

Produces: JSON

Send back the full JSON defining the Installation with the updated fields.

DELETE Installation

DELETE /api/inst/{inst-id} | delete

Deletes the existing Installation. The Appliances are not deleted if they are referenced in other Installations.

Consumes: Route

Produces: Delete status

Clone this wiki locally