1 Reply Latest reply on Dec 23, 2013 4:36 AM by an0nym0us

    invoking deploy via http-json api?

    dbschofield

      I want to run the equivalent of the cli native command via the http-json api.

       

      [standalone@localhost:9999 /] deploy /tmp/jee-app.ear

       

      Is this possible on jboss 7.2?

       

      Or do I have to use a composite operation to essentially implement what the deploy command does?

       

      {
          "operation" : "composite",
          "address" : [],
          "steps" : [
              {
                  "operation" : "add",
                  "address" : {"deployment" : "
      jee-app.ear"},
                  "content" : [{"url" : "file:/tmp/
      jee-app.ear"}]
              },
              {
                  "operation" : "deploy",
                  "address" : {"deployment" : "
      jee-app.ear"}
              }
          ]
      }

        • 1. Re: invoking deploy via http-json api?
          an0nym0us

          I know this is an old thread but it might help other people who are looking for the same thing.

           

          Have you found a solution to deploy or undeploy via http-json api? If not maybe you can try the following http calls to get the deployment details and deploy/undeploy.

           

          ** Standalone ***

          curl --digest -D - http://<username>:<password>@localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"read-resource","deployment":"xyz.war","json.pretty":1}'
          curl --digest -D - http://<username>:<password>@localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"deploy", "address":[{"deployment":"xyz.war"}],"json.pretty":1}'
          curl --digest -D - http://<username>:<password>@localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"undeploy", "address":[{"deployment":"xyz.war"}],"json.pretty":1}'
          

           

          *** Managed Domain ***

          curl --digest -D - http://<username>:<password>@localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"read-resource", "address":[{"host":"master"},{"server":"<server-name>"},{"deployment":"xyz.war"}],"json.pretty":1}'
          curl --digest -D - http://<username>:<password>@localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"deploy", "address":[{"host":"master"},{"server":"<server-name>"},{"deployment":"xyz.war"}],"json.pretty":1}'
          curl --digest -D - http://<username>:<password>@localhost:9990/management --header "Content-Type: application/json" -d '{"operation":"undeploy", "address":[{"host":"master"},{"server":"<server-name>"},{"deployment":"xyz.war"}],"json.pretty":1}'
          

           

          However, if you have a different solution can you share it with us?

           

          Note: Those http calls work on JBoss 7.1 and I believe it should work too on 7.2