Tango Feature Request 4: Defining a standard Tango REST API
|
|
---|---|
Hi all, I'm looking at the proposal for REST API posted by Ingvord. First of all, nice work, overall it looks great! I have a few comments off the top of my head.
I'm playing around with a simple python implementation, with the intention to see if I run into any corner cases or other questions. I'll be back in that case :) |
|
|
---|---|
Hi Johfor, Thank you very much for the input! johfor I tend to move this to a particular client implementation, i.e. Feature Request #6 - Tango Web Application (aka Jive in browser via REST API). As you correctly mentioned it does not give a lot to the end users, but increases API and implementations significantly. BTW what do mean under `full database configuration abilities`? From my vision one has them just operating on the databaseds, am I wrong? For instance,
Anyway, we can add it later. johfor Agree with value. What for do you need w_value? In my philosophy GET or PUT to device's attribute must always return the latest actual value of the attribute (PUT sometimes may return different value from what user has sent if there is a race). johfor This is awesome. In the best case we can announce at least two implementations on the next Tango meeting. Keep me informed. |
|
|
---|---|
Hi All, Here is a new version of Tango REST API specification - Release Candidate 1 aka RC1. There will be some minor changes but as for now I want to freeze the specification to start implement it. Hopefully this one will make it to Executive Committee next Tango meeting, i.e. no major issues will occur. |
|
|
---|---|
Hi, I agree the w_value will be useful to have. Because the set+read values are closely related. Otherwise you have to cache the write value but you might have concurrency problems ensuring they refer to the same value in time. Is there a way the w_value can be supported? You are right about the database being a device which can use the same api. The same is true for the admin device in each server. Good news that coding on the first implementation is soon going to start. Kind regards Andy |
|
|
---|---|
I do not know about set+read values. While dig in into it, could you please give me an example how it is used? |
|
|
---|---|
Regarding DB operations: I guess you are right, all operations are available through the database device commands. But this is sometimes pretty cumbersome, in part due to the limitations in the TANGO command arguments (expressing everything through lists of strings). So a more "friendly" API would probably be useful, e.g. where you can put many properties in one call, etc, but it can certainly wait. Perhaps it'd make sense to call the API under discussion the "client" API, and later perhaps define a "database" API? This split would be in line with the PyTango API at least. Regarding read/write values: For example, since a TANGO device is (usually) backed by some hardware which may have any kind of behaviour, such as being slow to react to changes, it can be useful to be able to tell if the last written value differs from the read value from the hardware. Also, if the set value is changed by someone else, it's good to be able to tell that it's not just the read value that is changing, which could be the case if the hardware is overloaded, etc. Anyway, would there be an issue with just adding a "w_value" field to the results for writeable attributes? I'm looking at the proposed RC1 API and I think it looks pretty complete, awesome job! I'll be back if/when I have some concrete comments. |
|
|
---|---|
All in all it looks great, but I haven't gotten to trying to implement it yet. |
|
|
---|---|
johfor _meta refers to the implementation related stuff. Eventually it contains only links at present. So, yes, maybe we can rename it to _links. Prefix is to stress the fact that these info is not related to Tango. johfor Yes, it is implementation's choice to put links relative to the entry point as well as to put an absolute path. Client should work fine in both cases. johfor Ok. johfor Yes. Filter scans the whole response and keeps (or removes) specified fields only. |
|
|
---|---|
Just my two cents: In the restfull API, I have noticed the followed missing features compared to the C++ API. This does not mean that they have to be implemented but in case you did not know they exist:
For my understanding, if I want to read several attributes in one call, what do I have to give to the GET verb? Regards Emmanuel |
|
|
---|---|
REST becomes popular :) Good…ManuIn case a device is not there client will get standard failure response. If ping does what I think, i.e. checks that Tango server is alive – you simply do not need it. ManuCould you please provide a usage scenario for this? ManuI think is must be configured on the Web server side via special admin interface. As 99,9% of applications will just get the values and display them this should be fine?! ManuThis I do not know – what are the usage scenarios? ManuWrite_read = write + read, i.e. finish write then read? Well any PUT request to an attribute(s) is write_read, i.e. synchronous, unless client specifies async=true ManuWell, yes… I took Tango 8 when started to work on this spec. ManuThis is a tricky question. It is not intended to read multiple attributes at once. This is due to built-in HTTP cache. Reading only one value allows setting Last-Modified and Expires response headers. And I think this is more important than multiply reading in this case. Web server still can multiplex several requests into one and send read_attributes to a remote Tango server. |