Tango Feature Request 4: Defining a standard Tango REST API

Hi Greg,

Yes, you are right - by default mtango uses "sys/database/2". You can alter it providing "TANGO_DB" system property to your tomcat instance, e.g. -DTANGO_DB=sys/database/dbds1 in tomcat's configuration file.

Hope this helps.

Regards,
Thanks for the property. It's OK now.

Now Tomcat starts without error messages. But when I request something like /mtango/rest/devices/tango/tangotest/titan/double_scalar/value I have this error:

INFO 10-05-2016 13:05:18 [http-nio-8844-exec-9 - o.t.w.s.f.TimeWatcher] Serving request. Stopwatch is active.
DEBUG 10-05-2016 13:05:18 [http-nio-8844-exec-9 - o.j.r.l.i.Slf4jLogger] PathInfo: /devices/tango/tangotest/titan/double_scalar/value
ERROR 10-05-2016 13:05:18 [http-nio-8844-exec-9 - o.j.r.l.i.Slf4jLogger] failed to execute
javax.ws.rs.NotFoundException: Could not find resource for full path: http://dev-el6-1.ica.synchrotron-soleil.fr:8844/mtango/rest/devices/tango/tangotest/titan/double_scalar/value
        at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:112) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:43) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:444) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:234) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:171) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) [resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.7.Final.jar:na]
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.7.Final.jar:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]

Do you have an idea about this error ?

Greg
Edited 7 years ago
Hi Greg,

Rest API version is missing in your URL. It must be:

/mtango/rest/rc2/devices/tango/tangotest/titan/double_scalar/value

Please note "rc2".

Regards,

Edited 7 years ago
Hi,

A new version of Tango REST API Specification has been released – RC3.

Most notable changes:
  • tango db is now a resource:
  • /tango/rest/rc3/hosts
    – lists all known tango db hosts (initially only one, e.g. localhost:10000, filled in later when users access different tango hosts)
    /tango/rest/rc3/hosts/{host}/{port}/devices
    – lists all devices defined in tango://{host}:{port}/sys/database/2
  • multiple attributes access: read, write, info
  • commands arguments must be provided via PUT body

Please note that project has been moved to Tango Controls Collaboration team


Corresponding implementation has been release as well.

Download:
single executable jar

zipped war

Unfortunately this version is not backward compatible. One can use mtango.server-rc2-0.4 (download here) till new client libraries version will be released.
Edited 7 years ago
 
Register or login to create to post a reply.