<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    HTTP (JSON-like) API
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/jason.greene">Jason Greene</a> in <i>JBoss AS 7 Development</i> - <a href="http://community.jboss.org/docs/DOC-17344">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><span>This is a digest of </span><a class="jive-link-external-small" href="http://lists.jboss.org/pipermail/jboss-as7-dev/2011-February/000491.html" target="_blank">http://lists.jboss.org/pipermail/jboss-as7-dev/2011-February/000491.html</a><span> for easier finding.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #349493;"><span style="color: #000000;">&#160;&#160;&#160; </span><span style="color: #009694;">&lt;</span>management<span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #349493;"><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;</span>security-realms<span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #5b00ff;"><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;</span><span style="color: #349493;">security-realm</span><span style="color: #000000;"> </span><span style="color: #a30096;">name</span><span style="color: #000000;">=</span><em>"ManagementRealm"</em><span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #009694;">&lt;</span><span style="color: #349493;">authentication</span><span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #5b00ff;"><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;</span><span style="color: #349493;">properties</span><span style="color: #000000;"> </span><span style="color: #a30096;">path</span><span style="color: #000000;">=</span><em>"mgmt-users.properties"</em><span style="color: #000000;"> </span><span style="color: #a30096;">relative-to</span><span style="color: #000000;">=</span><em>"jboss.server.config.dir"</em><span style="color: #000000;"> </span><span style="color: #a30096;">plain-text</span><span style="color: #000000;">=</span><em>"true"</em><span style="color: #009694;">/&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #009694;">&lt;/</span><span style="color: #349493;">authentication</span><span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #349493;"><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;/</span>security-realm<span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #349493;"><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;/</span>security-realms<span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #349493;"><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;</span>management-interfaces<span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #5b00ff;"><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;</span><span style="color: #349493;">native-interface</span><span style="color: #000000;"> </span><span style="color: #a30096;">interface</span><span style="color: #000000;">=</span><em>"management"</em><span style="color: #000000;"> </span><span style="color: #a30096;">port</span><span style="color: #000000;">=</span><em>"9999"</em><span style="color: #009694;">/&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #5b00ff;"><strong><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;</span><span style="color: #349493;">http-interface</span><span style="color: #000000;"> </span><span style="color: #a30096;">interface</span><span style="color: #000000;">=</span><em>"management"</em><span style="color: #000000;"> </span><span style="color: #a30096;">port</span><span style="color: #000000;">=</span><em>"9990"</em><span style="color: #009694;">/&gt;</span></strong></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #349493;"><span style="color: #000000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: #009694;">&lt;/</span>management-interfaces<span style="color: #009694;">&gt;</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; color: #349493;"><span style="color: #000000;">&#160;&#160;&#160; </span><span style="color: #009694;">&lt;/</span>management<span style="color: #009694;">&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 12pt;"><strong>GET requests</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The GET URL form is a mapping of operation addresses, with a few </p><p>supported read operations, and support for mapping top level values via </p><p>query parameters. The default operation is read-resource. So in </p><p>other words you can dump the whole management tree like so:</p><p><a class="jive-link-external-small" href="http://localhost:9990/management?recursive" target="_blank">http://localhost:9990/management?recursive</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To make the output of any GET operation easier to read you can append the "json.pretty" parameter to the end, e.g.:</p><p><span style="color: #009694;"><a class="jive-link-external-small" href="http://localhost:9990/management?operation=resource&amp;recursive&amp;json.pretty" target="_blank">http://localhost:9990/management?operation=resource&amp;recursive&amp;json.pretty</a></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The lack of additional /'s defaults to the root node.</p><p>The lack of an "operation" defaults to the read-resource operation.</p><p>The "recursive" is mapped to the recursive as a boolean, a lack of an </p><p>assignment defaults to "true"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The attributes of the http web connector can be retrieved with:</p><p><a class="jive-link-external-small" href="http://localhost:9990/management/subsystem/web/connector/http" target="_blank">http://localhost:9990/management/subsystem/web/connector/http</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>A single attribute can be retrieved by specifying the attribute </p><p>operation and the attribute name:</p><p><a class="jive-link-external-small" href="http://localhost:9990/management/subsystem/logging/console-handler/CONSOLE?operation=attribute&amp;name=autoflush" target="_blank">http://localhost:9990/management/subsystem/logging/console-handler/CONSOLE?operation=attribute&amp;name=autoflush</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The full description of the model can be retrieved using the </p><p>read-resource-description operation like so:</p><p><a class="jive-link-external-small" href="http://localhost:9990/management?operation=resource-description&amp;recursive&amp;operations" target="_blank">http://localhost:9990/management?operation=resource-description&amp;recursive&amp;operations</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 12pt;"><strong>POST requests</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>You can also do post support for both JSON and DMR Encoded:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>curl -H Content-Type:\ application/json -d '{"operation":"read-resource","address":[],"json.pretty":1}' </p><p><a class="jive-link-external-small" href="http://localhost:9990/domain-api">http://localhost:9990/management</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>curl -H Content-Type:\ application/dmr-encoded -d </p><p>bwAAAAMACW9wZXJhdGlvbnMADXJlYWQtcmVzb3VyY2UAB2FkZHJlc3NsAAAAAAAHcmVjdXJzZVoB </p><p> <a class="jive-link-external-small" href="http://localhost:9990/domain-api">http://localhost:9990/management</a></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/docs/DOC-17344">going to Community</a></p>

        <p style="margin: 0;">Create a new document in JBoss AS 7 Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>