picogw-plugin-db
v1.0.3
Published
DB plugin of picogw
Downloads
348
Readme
node-picogw-plugin-db is a mandatory plugin module for PicoGW, a Home Automation and Building Automation devices gateway server, developed by Kanagawa Institute of Technology, Smart House Research Center, released under MIT license. This is automatically installed when you install PicoGW.
Plugin API
Database plugin provides an API for simple key-value database within GW. The (arbitrary ) path becomes the key of the data. Also, the source code of database plugin is a good example of basic plugin implementation. If you want to develop your own plugin, please refer to v1/plugins/db/index.js.
GET /v1/db
List of all stored keys.
GET /v1/db/[PATH_AS_A_KEY]
returns the stored value.
PUT|POST /v1/db/[PATH_AS_A_KEY]
Stores a value (specified in the body). The value should be in JSON format. It is stringified before stored. The written value is published from the specified path using PubSub.
DELETE /v1/db/[PATH_AS_A_KEY]
Deletes the key and the corresponding data. Publishes {}.
DELETE /v1/db
Deletes all data. (/v1/db path remains.)