kennychou0529 / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

FILE REST API #390

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Feature Description

Expose the file system to the REST API, so UI's can access files on file system.

2. Example Use Case

List directory "configurations" in openHAB root
GET: http://localhost:8080/rest/files/configurations

Read file "configurations/items/my.items"
GET: http://localhost:8080/rest/files/configurations/items/my.items

Write file "configurations/items/my.items"
POST: http://localhost:8080/rest/files/configurations/items/my.items

Delete file "configurations/items/my.items"
DELETE: http://localhost:8080/rest/files/configurations/items/my.items

Original issue reported on code.google.com by mishoboss on 29 Jul 2013 at 12:13

GoogleCodeExporter commented 9 years ago
It could probably make sense to expose these files via WebDAV. This way it even 
be mounted as a file system.
Also it could probably be possible to alter the Designer so that it can 
discover openHAB instances via mDNS and then mount the configuration directory 
via WebDAV. This would make configuration even easier. The user wouldn't need 
to setup Samba or Dropbox.

Original comment by till.klo...@gmail.com on 15 Aug 2013 at 6:51

GoogleCodeExporter commented 9 years ago
Seems like a good idea to me. But I think these are two separate issues.

Original comment by mishoboss on 15 Aug 2013 at 6:53

GoogleCodeExporter commented 9 years ago
We had this discussion already two years ago: 
https://groups.google.com/d/msg/openhab/hNeuEmlUti0/FjJZrmFoBRoJ
Just as Till suggests, my point was also to use WebDAV for this.

Original comment by kai.openhab on 15 Aug 2013 at 7:05

GoogleCodeExporter commented 9 years ago
I tend to agree. I think we should look at the actual need - I don't think the 
need is really to be able to store file. The need is to be able to remotely 
configure the system. (although maybe I'm wrong?)

In my mind, the REST interface needs to be extended to allow the user to set 
item (and possibly other) attributes. e.g -:

/rest/items/<<itemname>>/configure?attribute=itemname&value=temperature

This then needs to be coupled with a item provider that can serialise the data 
to disk (eg store the item files into a computer readable format (XML/JSON/???) 
or a database.

Original comment by ch...@cd-jackson.com on 15 Aug 2013 at 2:18

GoogleCodeExporter commented 9 years ago
I reject this issue as I think the better approach is issue 420

Original comment by kai.openhab on 3 Sep 2013 at 5:21