1 Reply Latest reply on Apr 10, 2015 2:36 PM by jayshaughnessy

    Change the availability from "Disabled" to "Unknown" ?

    jujup

      I'm writing a front UI for RHQ. I'm using the REST API. I can change the status from UP/DOWN to DISABLED to put my application in "maintenance mode". Curl command :

      curl http://localhost:7080/rest/resource/11731/availability -u

      rhqadmin:rhqadmin -d

      '{"since":1427874300000,"type":"DISABLED","until":null,"resourceId":11731}'

      -X PUT -i -H "Content-Type: application/json"

       

      But when it is disabled, I cannot put my ressource to UNKNOWN (or any other status), the status stay "DISABLED". There is no error in my JON server.

      curl http://stheno:7080/rest/resource/11731/availability -u

      rhqadmin:rhqadmin -d

      '{"since":1427874300000,"type":"UNKNOWN","until":null,"resourceId":11731}'

      -X PUT -i -H "Content-Type: application/json"

       

      Any idea to do this ?

        • 1. Re: Change the availability from "Disabled" to "Unknown" ?
          jayshaughnessy

          Once a resource is set DISABLED it will ignore further changes to availability until the resource is again enabled.  I don't think there is a way to set a resource enabled via REST at this time.

           

          Basically, I don't think you should try and set a resource DISABLED via availability.  DISABLED is a special availability that reflects the state of a disabled resource.  It should be done via enable/disable resource support and i don't think that is supported by REST at this time.  You may want to create a bugzilla asking for that feature.  Or, submissions are always welcome if you feel up to the task.