3 Replies Latest reply on Feb 17, 2017 3:05 AM by fredand44

    How to change a value of a attribute with CLI?

    fredand44

      Hello guys!

       

      I'm using JBoss 6.4 and I'm told to always use CLI to change any configuration in the standalone.xml.

      I must admit that I just can not get the hang of how to navigate inside the xml with CLI.

       

      What I need to do right know is to change the attribute value in the element inet-address:

          <interfaces>

              <interface name="public">

                  <inet-address value="${jboss.bind.address:127.0.0.1}"/>

              </interface>

      ...to...

          <interfaces>

              <interface name="public">

                  <inet-address value="172.27.42.125"/>

              </interface>

       

      I thought that a good start would be just to navigate to it and read it.

       

      cd interface=public

      :read-children-types

      {

          "outcome" => "success",

          "result" => []

      }

       

      ...to me this should print out inet-address, but no luck with that...

       

       

      :read-children-names(child-type=inet-address)

      {

          "outcome" => "failed",

          "failure-description" => "JBAS014793: No known child type named inet-address",

          "rolled-back" => true

      }

      ...and no luck with that.

       

      Do you guys see what I'm doing wrong?

       

      Best regards

      Fredrik

        • 1. Re: How to change a value of a attribute with CLI?
          fredand44

          I also tried to add the value:

           

          cd interface=public

          :add(inet-address=172.27.42.125)

          {

              "outcome" => "failed",

              "failure-description" => "JBAS014803: Duplicate resource [(\"interface\" => \"public\")]",

              "rolled-back" => true

          }

           

          To me the above would navigate to interface named "public" and then add a child element of type inet-address hopefully with the attribute "value" with value of the IP.

           

          But no, as you can see.

          • 2. Re: How to change a value of a attribute with CLI?
            fredand44

            Hello guys!

             

            I'm using JBoss 6.4 and I'm told to always use CLI to change any configuration in the standalone.xml.

            I must admit that I just can not get the hang of how to navigate inside the xml with CLI.

             

            What I need to do right know is to change the attribute value in the element inet-address:

                <interfaces>

                    <interface name="public">

                        <inet-address value="${jboss.bind.address:127.0.0.1}"/>

                    </interface>

            ...to...

                <interfaces>

                    <interface name="public">

                        <inet-address value="172.27.42.125"/>

                    </interface>

             

            I thought that a good start would be just to navigate to it and read it.

             

            cd interface=public

            :read-children-types

            {

                "outcome" => "success",

                "result" => []

            }

             

            ...to me this should print out inet-address, but no luck with that...

             

             

            :read-children-names(child-type=inet-address)

            {

                "outcome" => "failed",

                "failure-description" => "JBAS014793: No known child type named inet-address",

                "rolled-back" => true

            }

            ...and no luck with that.

             

            Do you guys see what I'm doing wrong?

             

            Best regards

            Fredrik

            • 3. Re: How to change a value of a attribute with CLI?
              fredand44

              Hello!

               

              It looks like I got hang of it now.

               

              I now realize that I can only navigate to <interface name="public">

              cd  interface=public

              ..but then I can not navigate further to the next child which is a bit inconsistent.

              <inet-address value="${jboss.bind.address:127.0.0.1}"/>

               

              But standing at interface=public I can change the value of the inet-address with:

              :write-attribute(name=inet-address, value=172.30.204.81)

              ..or directly from the root..

              /interface=public:write-attribute(name=inet-address, value=172.30.204.81)

               

              This is a bit confusing since the operation write-attribute actually seems to see a child element as an attribute to the parent element.

              I would say that <inet-address> is an element and an child element to <interface> in the XML, not an attribute of the element <interface> .

               

              What do you think guys?

               

              Best regards

              Fredrik