def get_instance_state_run_command(opts)
      value = RightScale::InstanceState.value
      result = case value
               when 'booting'
                 "booting#{InstanceState.reboot? ? ':reboot' : ''}"
               when 'operational', 'stranded'
                 value
               when 'decommissioning', 'decommissioned'
                 decom_reason = "unknown"
                 decom_reason = InstanceState.decommission_type if ShutdownRequest::LEVELS.include?(InstanceState.decommission_type)
                 "shutting-down:#{decom_reason}"
               end
      CommandIO.instance.reply(opts[:conn], JSON.dump({ :result => result }) )
    rescue Exception => e
      CommandIO.instance.reply(opts[:conn], JSON.dump({ :error => e.message }) )
    end
def get_instance_state_run_command(opts)
      value = RightScale::InstanceState.value
      result = case value
               when 'booting'
                 "booting#{InstanceState.reboot? ? ':reboot' : ''}"
               when 'operational', 'stranded'
                 value
               when 'decommissioning', 'decommissioned'
                 decom_reason = "unknown"
                 decom_reason = InstanceState.decommission_type if ShutdownRequest::LEVELS.include?(InstanceState.decommission_type)
                 "shutting-down:#{decom_reason}"
               end
      CommandIO.instance.reply(opts[:conn], JSON.dump({ :result => result }) )
    rescue Exception => e
      CommandIO.instance.reply(opts[:conn], JSON.dump({ :error => e.message }) )
    end
Get Instance State value for Run type

 === Parameters
 opts[:conn](EM::Connection):: Connection used to send reply

 === Return
 true:: Always return true