use of com.emc.storageos.vnxe.models.VNXeFileInterface in project coprhd-controller by CoprHD.
the class VNXUnityFileStorageDeviceTest method setPort.
public void setPort(List<StorageHADomain> haDomainUri) {
VNXeApiClient apiclient = _unity.getVnxUnityClient(_device);
StorageHADomain haDomainTemp = null;
List<VNXeFileInterface> ports = apiclient.getFileInterfaces();
VNXeFileInterface port = ports.get(0);
String portNativeGuid = NativeGUIDGenerator.generateNativeGuid(_device, _device.getIpAddress(), NativeGUIDGenerator.PORT);
_port.setId(URIUtil.createId(StoragePort.class));
_port.setLabel(portNativeGuid);
_port.setTransportType("IP");
_port.setNativeGuid(portNativeGuid);
_port.setStorageDevice(_device.getId());
_port.setRegistrationStatus(RegistrationStatus.REGISTERED.toString());
_port.setPortName(_device.getSystemType());
_port.setPortNetworkId(_device.getIpAddress());
_port.setPortGroup(port.getNasServer().getId());
for (StorageHADomain hadomain : haDomainUri) {
if (port.getId().equalsIgnoreCase(hadomain.getSerialNumber())) {
haDomainTemp = hadomain;
break;
}
}
_port.setStorageHADomain(haDomainTemp.getId());
_dbClient.updateObject(haDomainTemp);
_dbClient.updateObject(_port);
}
Aggregations