Search in sources :

Example 11 with VNXeHost

use of com.emc.storageos.vnxe.models.VNXeHost in project coprhd-controller by CoprHD.

the class VNXeApiClient method getHostLUNIds.

/**
 * Get host LUN Ids
 *
 * @param hostId
 * @return host LUN Ids
 */
public Set<String> getHostLUNIds(String hostId) {
    Set<String> lunIds = new HashSet<>();
    VNXeHost host = getHostById(hostId);
    if (host != null) {
        List<VNXeBase> hostLunIds = host.getHostLUNs();
        if (hostLunIds != null && !hostLunIds.isEmpty()) {
            for (VNXeBase hostLunId : hostLunIds) {
                HostLun hostLun = getHostLun(hostLunId.getId());
                VNXeBase vnxelunId = null;
                if (hostLun.getType() == HostLUNTypeEnum.LUN_SNAP.getValue()) {
                    vnxelunId = hostLun.getSnap();
                } else {
                    vnxelunId = hostLun.getLun();
                }
                lunIds.add(vnxelunId.getId());
            }
        }
    }
    return lunIds;
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) HostLun(com.emc.storageos.vnxe.models.HostLun) VNXeHost(com.emc.storageos.vnxe.models.VNXeHost) HashSet(java.util.HashSet)

Example 12 with VNXeHost

use of com.emc.storageos.vnxe.models.VNXeHost in project coprhd-controller by CoprHD.

the class DeleteHostRequest method deleteHost.

public VNXeCommandResult deleteHost() throws VNXeException {
    logger.info("deleting host: {}", hostId);
    HostRequest hostRequest = new HostRequest(_client, hostId);
    VNXeHost host = hostRequest.get();
    if (host == null) {
        logger.info("Could not find host: ", hostId);
        return null;
    }
    return deleteHostInitiatorSync();
}
Also used : VNXeHost(com.emc.storageos.vnxe.models.VNXeHost)

Aggregations

VNXeHost (com.emc.storageos.vnxe.models.VNXeHost)12 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)8 VNXeApiClient (com.emc.storageos.vnxe.VNXeApiClient)6 HashMap (java.util.HashMap)6 HashSet (java.util.HashSet)6 HostLun (com.emc.storageos.vnxe.models.HostLun)5 Initiator (com.emc.storageos.db.client.model.Initiator)4 VNXeHostInitiator (com.emc.storageos.vnxe.models.VNXeHostInitiator)4 ArrayList (java.util.ArrayList)4 StringMap (com.emc.storageos.db.client.model.StringMap)3 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)3 VNXeException (com.emc.storageos.vnxe.VNXeException)3 URI (java.net.URI)3 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)2 StringSetMap (com.emc.storageos.db.client.model.StringSetMap)2 ExportRule (com.emc.storageos.model.file.ExportRule)2 VNXeLun (com.emc.storageos.vnxe.models.VNXeLun)2 VNXeNfsShare (com.emc.storageos.vnxe.models.VNXeNfsShare)2 List (java.util.List)2 Map (java.util.Map)2