def delete(self, restApi, data={}, headers=None, silentMode=False): """ Description A HTTP DELETE function to delete the session. For Linux API server only. Parameters restApi: The REST API URL. data: The data payload for the URL. headers: The header to use for the URL. """ if headers != None: self.jsonHeader = headers if silentMode == False: self.logInfo('\n\tDELETE: {0}\n\tDATA: {1}\n\tHEADERS: {2}'.format(restApi, data, self.jsonHeader)) try: response = requests.delete(restApi, data=json.dumps(data), headers=self.jsonHeader, verify=self.verifySsl) self.logInfo('\tSTATUS CODE: %s' % response.status_code, timestamp=False) if not str(response.status_code).startswith('2'): raise IxLoadRestApiException('http DELETE error: {0}\n'.format(response.text)) return response except requests.exceptions.RequestException as errMsg: raise IxLoadRestApiException('http DELETE error: {0}\n'.format(errMsg)) # VERIFY OPERATION START