mTango REST API roadmap

Hi,

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?

Thanks
Jerome

Hi Jerome,

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.

Regards,

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}

Greg

Hi Greg,

Currently mTangoREST supports UShort images.

Looks like in your case your want to display float image (TIFF?). I will add corresponding feature request.

Regards,

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.

Regards,

Greg

Hi Greg,

I have created a feature request. If you can invest any resources into it it would be awesome.

Regards,

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?

Hi Jean-Michel,

Same problem as Greg has since current_history is an image :frowning:

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:

"data:/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD...AKKKKACiiigAooooA//"

. Maybe this way is too specific for our needs and must be reconsidered.

Can you use current/history instead for now?

Regards,

Hi All,
At SOLEIL, we LIMA from ESRF for our detectors and the images can be short, ushort, long, ulong, float, ufloat, double, udouble.

I’m thinking about a way to help you Igor in the developpment.

Greg,

this is excellent news!

Andy

Hi Igor,

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)

Any hint?

Thanks
Jerome

https://mstatus.esrf.fr:443/tango/rest/rc3/hosts/acudebian7.esrf.fr/10000/devices/sys/mcs/facade/state
{
“errors”: [
{
“description”: “No filter configured with id ‘json-response-fields-filter’ (type java.lang.String)”,
“origin”: “org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:625)”,
“reason”: “JsonMappingException”,
“severity”: “ERR”
},
{
“description”: “No filter configured with id ‘json-response-fields-filter’ (type java.lang.String)”,
“origin”: “org.codehaus.jackson.map.ser.impl.SimpleFilterProvider.findFilter(SimpleFilterProvider.java:108)”,
“reason”: “IllegalArgumentException”,
“severity”: “ERR”
}
],
“quality”: “FAILURE”,
“timestamp”: 1486133458681
}

Hi Jerome,

Thanks for the report. Looks like a bug to me.

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.

.../facade/attributes/state/value

Cheers,

[quote=“Ingvord”]Hi Greg,

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).

Greg

Hi Greg,

Cool!

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.

Regards,

Hi Jerome,

I have just tried to get state from the facade and it works!


{
       "state":"ON",
       "status":"Init in progress",
       "_links":{
           "_state":"http://mstatus.esrf.fr/tango/rest/rc3/hosts/acudebian7.esrf.fr/10000/devices/sys/mcs/attributes/State",
           "_status":"http://mstatus.esrf.fr/tango/rest/rc3/hosts/acudebian7.esrf.fr/10000/devices/sys/mcs/attributes/Status",
           "_parent":"http://mstatus.esrf.fr/tango/rest/rc3/hosts/acudebian7.esrf.fr/10000/devices/sys/mcs/",
           "_self":"http://mstatus.esrf.fr/tango/rest/rc3/hosts/acudebian7.esrf.fr/10000/devices/sys/mcs/state"}
}

Hi Igor,

Yes indeed, seems it has been fixed, but I don’t know how.

Thanks!
Jerome

Hi all,
It looks like RC4 is now official and Igor has updated mTangoREST.server.

EDIT: mTangoREST.server is now a separate project but has not been updated to RC4.

Greg

Dear Igor, Greg and Jerome,

I see that you are using http and not https. It is perhaps the difference with the test you did sometime ago?

Hello Jean-Michel,

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 ?

Thanks
Jerome

except rebooting the machine on which the servers (rest + facade + HAproxy) are running, nothing has been changed.