protected void executeDeleteObject(String uri) throws BigSwitchVnsApiException {
if (_host == null || _host.isEmpty()) {
throw new BigSwitchVnsApiException("Hostname is null or empty");
}
DeleteMethod dm = (DeleteMethod) createMethod("delete", uri, 80);
dm.setRequestHeader(CONTENT_TYPE, CONTENT_JSON);
dm.setRequestHeader(ACCEPT, CONTENT_JSON);
dm.setRequestHeader(HTTP_HEADER_INSTANCE_ID, CLOUDSTACK_INSTANCE_ID);
executeMethod(dm);
if (dm.getStatusCode() != HttpStatus.SC_OK) {
String errorMessage = responseToErrorMessage(dm);
dm.releaseConnection();
s_logger.error("Failed to delete object : " + errorMessage);
throw new BigSwitchVnsApiException("Failed to delete object : " + errorMessage);
}
dm.releaseConnection();
}