/rest4jmx

A simple service that exposes a Java MBeanServer as a restful API with JSON or JSONP as data protocol.

Primary LanguageJavaScriptOtherNOASSERTION

The rest4jmx is a simple service that exposes a Java MBeanServer as a restful API with JSON or JSONP as data protocol. See index.html for more instructions.

Build with mvn install.

Developing and running

1) jetty:run
cd web
MAVEN_OPTS="-javaagent:$JREBEL_HOME/jrebel.jar -Dmyproject.root=$PWD/../core -Dcom.sun.management.jmxremote=true"

or without jrebel
MAVEN_OPTS="-Dcom.sun.management.jmxremote=true" mvn jetty:run

got to localhost:8080

2) excec:exec
cd core
mvn exec:exec

GET 'http://localhost:9998/rest4jmx/domains'


Get an attribute
GET 'http://localhost:8080/mbeans/java.lang:type=Memory/Verbose'

Put an attribute value
curl -v -i -H "Content-type: text/plain" -X PUT --data-binary "false" 'http://localhost:8080/mbeans/java.lang:type=Memory/Verbose'

Invoke a method, possibly with parameters, here with an example when running mvn exec:exec
curl -v -i -H "Content-type: application/json" -X POST --data-binary "{params: ['1','2']}" 'http://localhost:9998/rest4jmx/testdomain:name=testBean/ops/methodWithParams'