def set_compute_api version, start, attempts
      try = (Time.now - start)/SLEEPWAIT
      while try <= attempts
        begin
          @compute = @client.discovered_api('compute', version)
          @logger.debug("Google Compute API discovered")
          return
        rescue => e
          @logger.debug("Failed to discover Google Compute API")
          if try >= attempts
            raise e
          end
        end
        try += 1
      end
    end
def set_compute_api version, start, attempts
      try = (Time.now - start)/SLEEPWAIT
      while try <= attempts
        begin
          @compute = @client.discovered_api('compute', version)
          @logger.debug("Google Compute API discovered")
          return
        rescue => e
          @logger.debug("Failed to discover Google Compute API")
          if try >= attempts
            raise e
          end
        end
        try += 1
      end
    end
Discover the currently active Google Compute API

 @param [String] version The version of the Google Compute API to discover

 @param [Integer] start The time when we started code execution, it is
 compared to Time.now to determine how many further code execution
 attempts remain

 @param [Integer] attempts The total amount of attempts to execute that we
 are willing to allow

 @raise [Exception] Raised if we fail to discover the Google Compute API,
 either through errors or running out of attempts