def linuxServerWaitForSuccess(self, url, timeout=120): """ Description Wait for a success completion on the Linux API server. Paramters url: (str): The URL's ID of the operation to verify. timeout: (int): The timeout value. """ data = {'applicationType': 'ixnrest'} jsonHeader = {'content-type': 'application/json', 'x-api-key': self.apiKey} self.logInfo('linuxServerWaitForSuccess') for counter in range(1,timeout+1): response = self.get(url, data=data, silentMode=True) currentStatus = response.json()['message'] self.logInfo('\tCurrentStatus: {0}: {1}/{2} seconds'.format(currentStatus, counter, timeout), timestamp=False) if counter < timeout+1 and currentStatus != 'Operation successfully completed': time.sleep(1) if counter == timeout+1 and currentStatus != 'Operation successfully completed': return 1 if counter < timeout+1 and currentStatus == 'Operation successfully completed': return 0