@Override(Experiment.Experiment)
    @logged("info")
    def do_send_command_to_device(self, command):
        """
        Callback run when the client sends a command to the experiment
        @param command Command sent by the client, as a string.
        """
        
        # Returns the URL to access the VM. The VM itself is not necessarily ready for access yet.
        if command == "get_configuration":
            return self.url + "     with password: " + self.session_id
            
        # Returns 1 if the client should be able to connect to the VM already, 
        # 0;<estimated_load_time> if it isn't ready yet,
        # 3;<error msg> if an error occurred
        elif command == "is_ready":
            if self.is_ready: return "1"    # 1:Ready
            if self.is_error: return "3;%s" % str(self.error)
            return "0;%s" % self.estimated_load_time
        
        elif command == "is_alive":
            if not self.is_ready: return "0"
            if self.vm.is_alive_vm(): return "1"
            return "0"
            
        return "cmd_not_supported"
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/experiments/vm/server.py/VMExperiment.do_send_command_to_device/original