glassfish
  1. glassfish
  2. GLASSFISH-17571

get-health action report needs to be fixed so that it is parseable.

    Details

      Description

      The action report from get-health needs to be fixed.
      As of now, this is what is returned:

      {"message":"ABC-1 not started\nABC-2 not started","command":"get-health AdminCommand","exit_code":"SUCCESS","extraProperties":{"methods":[

      {"name":"GET"}

      ,{}]}}

      This makes it impossible to parse to get information for each of the instance of the cluster.

      One suggestion can be providing the info in the properties field, like in list-clusters command:

      {"message":"clusterABC partially running\nclusterXYZ not running","command":"list-clusters AdminCommand","exit_code":"SUCCESS", "properties":

      {"clusterABC":"PARTIALLY_RUNNING","clusterXYZ":"NOT_RUNNING"}

      ," extraProperties":{"methods":[

      {"name":"GET"}

      ,{"messageParameters":{"id":

      {"acceptableValues":"","optional":"true","type":"string","defaultValue":"domain"}

      }}]}}

        Issue Links

          Activity

          Hide
          Joe Fialli added a comment - - edited

          Initially assigning to Bobby since he implemented this feature.

          Anissa:
          Since the bug is reported against 3.1.1, please provide feedback if you request that this be fixed for 3.1.2 or for 4.0 time frame. Do not want to fix for 3.1.2 unless there are plans to use the requested change.

          Show
          Joe Fialli added a comment - - edited Initially assigning to Bobby since he implemented this feature. Anissa: Since the bug is reported against 3.1.1, please provide feedback if you request that this be fixed for 3.1.2 or for 4.0 time frame. Do not want to fix for 3.1.2 unless there are plans to use the requested change.
          Hide
          Bobby Bissett added a comment -

          Also, Anissa: can you tell me what I do to see the action report output?

          Show
          Bobby Bissett added a comment - Also, Anissa: can you tell me what I do to see the action report output?
          Hide
          Anissa Lam added a comment -

          I am going through the exercise of CLI parity and realize we are not displaying the get-health info in GUI. And found the action report output cannot be consumed by clients through REST API.

          To see the action report, you can do the following in the browser, eg. for a cluster with name clusterABC:
          http://localhost:4848/management/domain/clusters/cluster/clusterABC/get-health.json

          and also try:
          http://localhost:4848/management/domain/clusters/list-clusters.json

          using chrome will see the display on screen. You can omit .json to see the html output.

          Show
          Anissa Lam added a comment - I am going through the exercise of CLI parity and realize we are not displaying the get-health info in GUI. And found the action report output cannot be consumed by clients through REST API. To see the action report, you can do the following in the browser, eg. for a cluster with name clusterABC: http://localhost:4848/management/domain/clusters/cluster/clusterABC/get-health.json and also try: http://localhost:4848/management/domain/clusters/list-clusters.json using chrome will see the display on screen. You can omit .json to see the html output.
          Hide
          Bobby Bissett added a comment -

          Anissa,

          I need more information from you on what you want done. I think you're suggesting I change the output message (which goes to the user) from something about the state of the instances to something about the cluster instead:

          --quote--
          One suggestion can be providing the info in the properties field, like in list-clusters command:

          {"message":"clusterABC partially running\nclusterXYZ not running","command":"list-clusters AdminCommand","exit_code":"SUCCESS", "properties":

          {"clusterABC":"PARTIALLY_RUNNING","clusterXYZ":"NOT_RUNNING"}

          ," extraProperties":{"methods":[

          {"name":"GET"}

          ,{"messageParameters":{"id":

          {"acceptableValues":"","optional":"true","type":"string","defaultValue":"domain"}

          }}]}}
          --end quote--

          The get-health command takes a cluster as an input, and is suppose to tell the user the state of every instance in that cluster. So I can't change "ABC-1 not started\nABC-2 not started" to "clusterABC partially running." That loses all the information that the command is supposed to give.

          I can use report.setExtraProperties() to give more info, but the info will still be the same:
          <instance name> <state> [since <time>]

          Am not sure why this can't be parsed. The output messages in LocalStrings.properties are:

          get.health.instance.state=

          {0} {1}
          get.health.instance.state.since={0}

          {1}

          since

          {2}

          The strings above are meant to match the output format that was used in 2.X. So I'm not sure what change you want me to make, and I still don't know how or what code is getting this info to parse it. Am assigning back to you for more info.

          Show
          Bobby Bissett added a comment - Anissa, I need more information from you on what you want done. I think you're suggesting I change the output message (which goes to the user) from something about the state of the instances to something about the cluster instead: -- quote -- One suggestion can be providing the info in the properties field, like in list-clusters command: {"message":"clusterABC partially running\nclusterXYZ not running","command":"list-clusters AdminCommand","exit_code":"SUCCESS", "properties": {"clusterABC":"PARTIALLY_RUNNING","clusterXYZ":"NOT_RUNNING"} ," extraProperties":{"methods":[ {"name":"GET"} ,{"messageParameters":{"id": {"acceptableValues":"","optional":"true","type":"string","defaultValue":"domain"} }}]}} -- end quote -- The get-health command takes a cluster as an input, and is suppose to tell the user the state of every instance in that cluster. So I can't change "ABC-1 not started\nABC-2 not started" to "clusterABC partially running." That loses all the information that the command is supposed to give. I can use report.setExtraProperties() to give more info, but the info will still be the same: <instance name> <state> [since <time>] Am not sure why this can't be parsed. The output messages in LocalStrings.properties are: get.health.instance.state= {0} {1} get.health.instance.state.since={0} {1} since {2} The strings above are meant to match the output format that was used in 2.X. So I'm not sure what change you want me to make, and I still don't know how or what code is getting this info to parse it. Am assigning back to you for more info.
          Hide
          Bobby Bissett added a comment -

          I didn't see your update to the issue until after I edited it. Weird.

          I think I know what you're looking for now, and will give something a try. Will add some output to the issue for you to ok or not.

          Show
          Bobby Bissett added a comment - I didn't see your update to the issue until after I edited it. Weird. I think I know what you're looking for now, and will give something a try. Will add some output to the issue for you to ok or not.
          Hide
          Bobby Bissett added a comment -

          Hi Annisa,

          This output look ok to you? Here's what the user sees, just for reference:

          hostname% ./asadmin get-health clus
          inst1 started since Thu Nov 03 14:14:49 EDT 2011
          inst2 not started
          inst3 stopped since Thu Nov 03 14:21:33 EDT 2011
          Command get-health executed successfully.

          Here's the JSON output from the server at http://localhost:4848/management/domain/clusters/cluster/clus/get-health.json

          {"message":"inst1 started since Thu Nov 03 14:14:49 EDT 2011\ninst2 not started\ninst3 stopped since Thu Nov 03 14:21:33 EDT 2011","command":"get-health AdminCommand","exit_code":"SUCCESS","properties":

          {"inst1":"started since Thu Nov 03 14:14:49 EDT 201","inst3":"stopped since Thu Nov 03 14:21:33 EDT 201","inst2":"not started"}

          ,"extraProperties":{"methods":[

          {"name":"GET"}

          ,{}]}}

          Those props in the action report look ok to you?

          Show
          Bobby Bissett added a comment - Hi Annisa, This output look ok to you? Here's what the user sees, just for reference: hostname% ./asadmin get-health clus inst1 started since Thu Nov 03 14:14:49 EDT 2011 inst2 not started inst3 stopped since Thu Nov 03 14:21:33 EDT 2011 Command get-health executed successfully. Here's the JSON output from the server at http://localhost:4848/management/domain/clusters/cluster/clus/get-health.json {"message":"inst1 started since Thu Nov 03 14:14:49 EDT 2011\ninst2 not started\ninst3 stopped since Thu Nov 03 14:21:33 EDT 2011","command":"get-health AdminCommand","exit_code":"SUCCESS","properties": {"inst1":"started since Thu Nov 03 14:14:49 EDT 201","inst3":"stopped since Thu Nov 03 14:21:33 EDT 201","inst2":"not started"} ,"extraProperties":{"methods":[ {"name":"GET"} ,{}]}} Those props in the action report look ok to you?
          Hide
          Anissa Lam added a comment -

          if I can see something like the following in the actionReport from get-health, then i can extract and parse that accordingly.
          "properties":

          {"ABC-1":"not started","ABC-2:"not-started"}

          ,"

          Show
          Anissa Lam added a comment - if I can see something like the following in the actionReport from get-health, then i can extract and parse that accordingly. "properties": {"ABC-1":"not started","ABC-2:"not-started"} ,"
          Hide
          Anissa Lam added a comment -

          Just like your previous experience, I didn't see your last comment about the suggested change until i add my comments. Something is not quite right in JIRA.
          Anyway, what you suggested

          {"message":"inst1 started since Thu Nov 03 14:14:49 EDT 2011\ninst2 not started\ninst3 stopped since Thu Nov 03 14:21:33 EDT 2011","command":"get-health AdminCommand","exit_code":"SUCCESS","properties":

          {"inst1":"started since Thu Nov 03 14:14:49 EDT 201","inst3":"stopped since Thu Nov 03 14:21:33 EDT 201","inst2":"not started"}

          ,"extraProperties":{"methods":[

          {"name":"GET"}

          ,{}]}}

          is exactly what I am looking for.
          thanks.

          Show
          Anissa Lam added a comment - Just like your previous experience, I didn't see your last comment about the suggested change until i add my comments. Something is not quite right in JIRA. Anyway, what you suggested {"message":"inst1 started since Thu Nov 03 14:14:49 EDT 2011\ninst2 not started\ninst3 stopped since Thu Nov 03 14:21:33 EDT 2011","command":"get-health AdminCommand","exit_code":"SUCCESS","properties": {"inst1":"started since Thu Nov 03 14:14:49 EDT 201","inst3":"stopped since Thu Nov 03 14:21:33 EDT 201","inst2":"not started"} ,"extraProperties":{"methods":[ {"name":"GET"} ,{}]}} is exactly what I am looking for. thanks.
          Hide
          Bobby Bissett added a comment -

          Fixed in revisions 50649 (3.1.2 branch) and 50653 (trunk).

          Show
          Bobby Bissett added a comment - Fixed in revisions 50649 (3.1.2 branch) and 50653 (trunk).

            People

            • Assignee:
              Bobby Bissett
              Reporter:
              Anissa Lam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: