Kabir Khan [
http://community.jboss.org/people/kabirkhan] modified the document:
"HTTP (JSON-like) API"
To view the document, visit:
http://community.jboss.org/docs/DOC-17344
--------------------------------------------------------------
This is a digest of
http://lists.jboss.org/pipermail/jboss-as7-dev/2011-February/000491.html
http://lists.jboss.org/pipermail/jboss-as7-dev/2011-February/000491.html for easier
finding.
In a nutshell this is another view on the management API available over the http connector
installed in standalone.xml/host.xml, normally on port 9990.
<management>
<security-realms>
<security-realm name=+"ManagementRealm"+>
<authentication>
<properties path=+"mgmt-users.properties"+
relative-to=+"jboss.server.config.dir"+ plain-text=+"true"+/>
</authentication>
</security-realm>
</security-realms>
<management-interfaces>
<native-interface interface=+"management"+
port=+"9999"+/>
* <http-interface interface=+"management"+
port=+"9990"+/>*
</management-interfaces>
</management>
*GET requests*
The GET URL form is a mapping of operation addresses, with a few
supported read operations, and support for mapping top level values via
query parameters. The default operation is read-resource. So in
otherwords you can dump the whole management tree like so:
http://localhost:9990/management?recursive http://localhost:9990/management?recursive
To make the output of any GET operation easier to read you can append the
"json.pretty" parameter to the end, e.g.:
http://localhost:9990/management?operation=resource&recursive&jso...
The lack of additional /'s defaults to the root node.
The lack of an "operation" defaults to the read-resource operation.
The "recursive" is mapped to the recursive as a boolean, a lack of an
assignment defaults to "true"
The attributes of the http web connector can be restrieved with:
http://localhost:9990/management/subsystem/web/connector/http
http://localhost:9990/management/subsystem/web/connector/http
A single attribute can be retrieved by specifying the attribute
operation and the attribute name:
http://localhost:9990/management/subsystem/logging/console-handler/CONSOL...
http://localhost:9990/management/subsystem/logging/console-handler/CONSOL...
The full description of the mode can be retrieved using the
read-resource-description operation like so:
http://localhost:9990/domain-api?operation=resource-description&recur...
http://localhost:9990/management?operation=resource-description&recur...
*POST requests*
You can also do post support for both JSON and DMR Encoded:
curl -d
'{"operation":"read-resource","address":[],"json.pretty":1}'
http://localhost:9990/domain-api http://localhost:9990/management
curl -H Content-Type:\ application/dmr-encoded -d
bwAAAAMACW9wZXJhdGlvbnMADXJlYWQtcmVzb3VyY2UAB2FkZHJlc3NsAAAAAAAHcmVjdXJzZVoB
http://localhost:9990/domain-api http://localhost:9990/management
--------------------------------------------------------------
Comment by going to Community
[
http://community.jboss.org/docs/DOC-17344]
Create a new document in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=102&am...]