I am wondering if there are any updates (or roadmap) planned for the mTango REST API. Currently we have the RC3.0.1 version. Is there a final release planned?
Is there any update in the pipe that would break the compatibility of the API?
Another question about the java client for this REST API:
Could you explain the added value compared to standard client APIs (such as Jersey)? Can I just use Jersey as client API?
Current version seems to be stable so next Tango meeting we will simply rename to it v1.0 and announce as first release of the specification. The roadmap for the specification - is to follow user requests and be consistent with native Tango API (resolve issues).
I do not see anything like this on the horizon.
The goal of the Java client is to provide higher level of abstraction, ideally be the same as TangORB but on top of REST. AFAIK this is not really used so consider it as a proof of the concept. It is not mandatory to use any specific client - you can use whatever you are convenient with if it speaks REST.
Hi Igor,
It looks like only SCALAR and SPECTRUM are implemented in mTango REST API. Do you plan to introduce IMAGE support ?
When I try to read an image from one tango test device, I have the following error:
{"errors":[{"reason":"JsonMappingException","description":"[F cannot be cast to [I (through reference chain: org.tango.rest.[\"value\"])","severity":"ERR","origin":"org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:218)"},{"reason":"ClassCastException","description":"[F cannot be cast to [I","severity":"ERR","origin":"org.tango.web.server.resolvers.JacksonConfiguration$TangoImageSerializer.serialize(JacksonConfiguration.java:258)"}],"quality":"FAILURE","timestamp":1484733868333}
Hi Igor,
I would like to be able to display every image type that you can have on TANGO.
If you can serialize the IMAGE 2D matrix like you do for SPECTRUM, it’s ok for me.
Dear Igor,
We have a problem to access a 2D attribute via RestAPI.
We have setup a rest server which answer to the following url https://mstatus.esrf.fr/tango/rest/rc3/hosts/acudebian7.esrf.fr/10000/devices/sys/mcs/facade/attributes
It works when reading scalar attributes but when I try to read “current_history” which is a 2d table I got the following exception
{
errors: [
{
reason: “JsonMappingException”,
description: “[D cannot be cast to [I (through reference chain: org.tango.rest.[“value”])”,
severity: “ERR”,
origin: “org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:218)”
},
{
reason: “ClassCastException”,
description: “[D cannot be cast to [I”,
severity: “ERR”,
origin: “org.tango.web.server.resolvers.JacksonConfiguration$TangoImageSerializer.serialize(JacksonConfiguration.java:258)”
}
],
quality: “FAILURE”,
timestamp: 1485881922595
}
looks like a casting error…Any idea?
Same problem as Greg has since current_history is an image
mTangoREST tries to cast double array to ushort array and fails, since Java can not do such operation.
Sorry for this. Honestly we never needed any images except what we get from camera, i.e. ushort. So it is implemented in a very restricted manner. Specifically it gets underlaying array from CORBA layer and wraps it into Java’s BufferedImage, hence only ushort images are supported. Plus it converts images into embedded:
Using the Tango Rest API, and trying to get a device state, I get the following result.
The device seems to work fine, and I can get its attributes and their values.
(Note that doing the same request on my local Tango VM, I get the expected state result)
I have created an issue and will try to reproduce and fix it. In the mean time you can work around this by reading state and status via attributes, i.e.
I have created a feature request. If you can invest any resources into it it would be awesome.
Regards,[/quote]
Igor,
I managed to run TangoRestServer from my eclipse \o/.
I found that the issue #121 can be solved by commenting the line 65 in JacksonConfiguration.java. I really think that no one will ask you to generate an image file from a DevDouble/DevShort/… Array. Scientists always wants to see the raw data (the 2D matrix) from their super expensive detector. If the value is a 2D Matrix we can use Plotly heatmap (Heatmaps in JavaScript) to make a viewer (we can work on this @SOLEIL).
I think REST API spec must be altered, I have created an issue: look here. This change will increase the version number to rc-4 as it changes the behavior.
Sounds great to me. It would be nice to have some standalone component that could be easily integrated into 3rd party frameworks. For instance, I use webix for our projects.
I’m not sure Igor used http. Even using https, the links in the REST repsonse are referencing http (which is a (little) issue by the way).
On my side, the https link from my previous post was not working 1 week ago, and is working now.
Did anything changed on the facade server ?