4 Replies Latest reply on Jan 23, 2020 11:53 AM by walkerca

    Management API For Domain add-content, add Operations

    walkerca

      Hi,

       

      I'm automating a deployment.  I was able to deploy to a standalone instance using the pair of requests in the docs (add-content followed up with a deploy operation).  I'm having trouble getting this working with domain mode.  My /add-content returns "success", but I don't see the artifact in the Content Repository when I connect using the HAL Console.

       

      I've tried taking the BYTES_VALUE and putting it into a deploy request with server-groups specified, but I get

       

        WFLYCTL0030: No resource definition is registered for address...

       

      Is there a comprehensive listing of the API?  I see some examples and the general command format in the guide but nothing that would say the specific parameters for an add-content payload.

       

      Thanks,

      Carl

        • 1. Re: Management API For Domain add-content, add Operations
          ctomc
          1 of 1 people found this helpful
          • 2. Re: Management API For Domain add-content, add Operations
            walkerca

            Thanks Tomaz.  I don't see in the list of attributes where I would specify the server-groups.  When I use the "enabled" and "content" attributes from you link, I'm able to add a JAR to the content repository.  But unlike STANADLONE, the JAR isn't deployed anywhere. Is there a follow-up command I need to issue to go from Content Repository -> server-group ?

            • 3. Re: Management API For Domain add-content, add Operations
              walkerca

              Here's my request.  It's called after a previous /add-content returns the BYTES_VALUE.  Everything works if I remove the server-group field and deploy to STANDALONE.

              {

                  "content":[{"hash": {"BYTES_VALUE" : "Dp7LYVNS/qQhtArfdceQzGhEtLI="}}],

                  "address": [{"server-group":"main-server-group"},{"deployment":"bitbucket-demo-1.0.jar"}],

                  "operation":"add",

                  "enabled":"true"

              }

              This is the 500 error I get back when using the above request in DOMAIN mode

              {

                 "outcome" : "failed",

                 "failure-description" : {

                    "domain-failure-description" : "WFLYCTL0216: Management resource '[(\"deployment\" => \"bitbucket-demo-1.0.jar\")]' not found"

                 },

                 "rolled-back" : true

              }

              • 4. Re: Management API For Domain add-content, add Operations
                walkerca

                This post answers my question: failure to deploy using the http json management api?

                 

                You have to do three things to deploy to a domain's server-group

                 

                1. Add the content

                 

                POST to /add-content

                 

                2. Using the BYTES_VALUE from 1, deploy it globally

                 

                {

                    "content":[{"hash": {"BYTES_VALUE" : "Dp7LYVNS/qQhtArfdceQzGhEtLI="}}],

                    "address": [{"deployment":"bitbucket-demo-1.0.jar"}],

                    "operation":"add"

                }

                 

                3. Assign it to a server-group

                {

                    "address": [{"server-group": "main-server-group"}, {"deployment":bitbucket-demo-1.0.jar"}],

                    "operation":"add",

                    "enabled":"true"

                }