Search in sources :

Example 6 with VNXeFileInterface

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);
}
Also used : VNXeFileInterface(com.emc.storageos.vnxe.models.VNXeFileInterface) VNXeApiClient(com.emc.storageos.vnxe.VNXeApiClient) StoragePort(com.emc.storageos.db.client.model.StoragePort) StorageHADomain(com.emc.storageos.db.client.model.StorageHADomain)

Aggregations

VNXeFileInterface (com.emc.storageos.vnxe.models.VNXeFileInterface)6 StoragePort (com.emc.storageos.db.client.model.StoragePort)5 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)4 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)4 URI (java.net.URI)4 VNXeApiClient (com.emc.storageos.vnxe.VNXeApiClient)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 StorageHADomain (com.emc.storageos.db.client.model.StorageHADomain)1 VirtualNAS (com.emc.storageos.db.client.model.VirtualNAS)1 VNXeException (com.emc.storageos.vnxe.VNXeException)1 Test (org.junit.Test)1