1 Reply Latest reply on Mar 14, 2014 10:14 AM by neo.infinite

    HTTP (JSON-like) API - domain mode

    neo.infinite Newbie

      I have a jboss cluster set up in domain mode.

      I want to use the jboss management rest api to fetch information about the hosts from the domain controller:



      URL : http://myhost:9990/management

      Content Type: application/json

      Content : {"operation":"read-attribute","address":[{"host":"myhost09"},{"server":"server-node-A"}],"name":"server-state"}




      I get back :

      Status : 500 Internal Server Error


      {"outcome" : "failed", "result" : null, "failure-description" : "JBAS014883: No resource definition is registered for address [\n(\"host\" => \"myhost09\"),\n(\"server\" => \"server-node-A\")\n]", "rolled-back" : true}



      where in host.xml on the host machine reads :

      <host name="myhost09" xmlns="urn:jboss:domain:1.4">


              <server name="server-node-A" group="my-core" auto-start="false">
                  <jvm name="clear-default-config" debug-enabled="false">
                      <heap size="512m" max-size="1024m"/>
                          <option value="-Djgroups.bind_addr="/>
                  <socket-bindings socket-binding-group="ha-sockets" port-offset="0"/>



      So I cant understand what am I missing here. Could anyone help here?

        • 1. Re: HTTP (JSON-like) API - domain mode
          neo.infinite Newbie

          I found a strange observation. When I tried to do the same thing via the console using curl, I saw a new registry for management realm (in bold)

          and it gave me result successfully. Once this worked, even the calls from the (firefox) poster as described above are now working fine.


          curl --digest -L -D - http://user:pwd@localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"read-attribute","address":[{"host":"myhost09"},{"server":"server-node-A"}],"name":"server-state"}'
          HTTP/1.1 401 Unauthorized
          Content-length: 0
          Www-authenticate: Digest realm="ManagementRealm",nonce="454825e7664ddd1fb62e70f4a78e3b56"
          Date: Thu, 06 Mar 2014 15:57:04 GMT


          HTTP/1.1 200 OK
          Transfer-encoding: chunked
          Content-type: application/json
          Date: Thu, 06 Mar 2014 15:57:04 GMT


          {"outcome" : "success", "result" : "running"}