Tango rest API installation for webapp

Hi everyone.

I'm currently trying to use webapp, and it requires to use mTangoRest.server. So, I installed Apache Tomcat 8 and tried to install mTango following the tutorial on https://bitbucket.org/hzgwpn/mtangorest.server/wiki/Home:

- Downloaded the the zip containing the war file, put it in {CATALINA_HOME}/webapps and added a tomcat user with mtango-user role.

Then I restarted the server, and tried to test the installation entering "http://localhost:8080/tango/rest" on my web browser (firefox), where I get error 404 - Not found.

On the folder {CATALINA_HOME}/webapps/tango, I remarked that rest is not present. I just have lib;meta-inf;web-inf folders and groovy.vm file.

For information, my tangohost is set as a environment variable. I tested mtangorest.server-rc4-2.2 and mtangorest.server-rc3-0.1.

Did I miss a step on the installation ? Thanks for your help.

Regards smile

Florian Pourchayre
Thales Group
Hi Florian


In the case of running the rest server

mtangorest.server-rc3-0.1.jar

which must be downloaded along with the corresponding .zip file you can move it to tango server libraries

mv mtangorest.server-rc3-0.1.jar /usr/lib/tango/server/

then create an executable script 'TangoRestServer' where

$ cat TangoRestServer
#!/bin/bash

echo "Using TANGO_HOST=$TANGO_HOST"

INSTANCE_NAME=$1
echo "Using INSTANCE_NAME=$INSTANCE_NAME"

/usr/bin/java -jar -DTANGO_HOST=$TANGO_HOST /usr/lib/tango/server/mtango.server-rc3-0.1.jar $INSTANCE_NAME &


then run it as

TangoRestServer test

And if everything starts up successfully, the tomcat port to access is 8844, provided it was registered with the following device properties.



In your web browser enter http://localhost:8844/tango/rest and use tango-cs/tango as username/password when prompted.

Hope it works for you.

Regards smile
Athanaseus Javas
SKA SA
Edited 6 years ago
Hi Athanaseus,

Thank you for your answer. With this way, I succeed to install it!

Regards smile

Florian Pourchayre,
Thales Group
Hi again,

Just for information,

To get an attribute value, I used the URL :

http://localhost:8844/tango/rest/rc3/hosts/$TANGO_IP/$TANGO_PORT/devices/$DEVICE_INSTANCE_NAME/attributes/$ATTRIBUTE/value


Maybe it could help,

Regards smile

Florian Pourchayre,
Thales Group
 
Register or login to create to post a reply.