3 Replies Latest reply on Jun 4, 2015 8:07 AM by sanjeev.gour

    Update deployment scanner with management API

    sanjeev.gour

      I am trying to do the management api equivalent of the below CLI to read the deployment scanner and ultimately set the auto-deploy-zipped to true. But the read is not working for me in first place.

      CLI works just fine-

      [standalone@localhost:9999 /] /subsystem=deployment-scanner/scanner=default:read-resource

      {

          "outcome" => "success",

          "result" => {

              "auto-deploy-exploded" => false,

              "auto-deploy-xml" => true,

              "auto-deploy-zipped" => false,

              "deployment-timeout" => 600,

              "path" => "deployments",

              "relative-to" => "jboss.server.base.dir",

              "scan-enabled" => true,

              "scan-interval" => expression "${jboss.scan.interval:5000}"

          }

      }

       

      The code is this-

              ModelNode request = new ModelNode();

              request.get(ClientConstants.OP).set("read-resource");

              request.get("scanner").set("default");

              request.get(ClientConstants.OP_ADDR).add("subsystem", "deployment-scanner");

              ModelNode responce = client.execute(request);

       

      It gives me this-

       

      {

          "outcome" => "success",

          "result" => {"scanner" => {"default" => undefined}}

      }

       

      I am not sure what's wrong where.

       

      Thanks.

        • 1. Re: Update deployment scanner with management API
          ctomc

          Sanjeev Gour wrote:

           

          The code is this-

                  ModelNode request = new ModelNode();

                  request.get(ClientConstants.OP).set("read-resource");

                  request.get("scanner").set("default");

                  request.get(ClientConstants.OP_ADDR).add("subsystem", "deployment-scanner");

           

          Well, you have wrong address here

           

          you should have something like this

           

             ModelNode request = new ModelNode();

                  request.get(ClientConstants.OP).set("read-resource");

                 request.get(ClientConstants.OP_ADDR).add("subsystem", "deployment-scanner").add("scanner","default");

          • 2. Re: Update deployment scanner with management API
            sanjeev.gour

            It worked for me.

             

            Thank you Tomaz.

            • 3. Re: Update deployment scanner with management API
              sanjeev.gour

              A related question. A change to this property is ultimately reflected in the standalone.xml file, so if I enable the zip deployment at runtime, it is persisted on next restart remains enabled. I know when I want to enable it and but looking for an appropriate place for disabling it again after all the zip artifacts are deployed. I have some workarounds like I can disable it on server shutdown but just wanted to check if there is a better way.

               

              Thanks.