public NetworkDeviceResponse getApiResponse(Host device) {
NetworkDeviceResponse response;
HostVO host = (HostVO)device;
_hostDao.loadDetails(host);
if (host.getType() == Host.Type.ExternalDhcp) {
NwDeviceDhcpResponse r = new NwDeviceDhcpResponse();
r.setZoneId(host.getDataCenterId());
r.setPodId(host.getPodId());
r.setUrl(host.getPrivateIpAddress());
r.setType(host.getDetail("type"));
response = r;
} else if (host.getType() == Host.Type.PxeServer) {
String pxeType = host.getDetail("type");
if (pxeType.equalsIgnoreCase(PxeServerType.PING.getName())) {
PxePingResponse r = new PxePingResponse();
r.setZoneId(host.getDataCenterId());
r.setPodId(host.getPodId());
r.setUrl(host.getPrivateIpAddress());
r.setType(pxeType);
r.setStorageServerIp(host.getDetail("storageServer"));
r.setPingDir(host.getDetail("pingDir"));
r.setTftpDir(host.getDetail("tftpDir"));
response = r;
} else {
throw new CloudRuntimeException("Unsupported PXE server type:" + pxeType);
}
} else {