Search in sources :

Example 1 with ExportPathsPreview

use of com.emc.sa.service.vipr.block.tasks.ExportPathsPreview in project coprhd-controller by CoprHD.

the class ExportPathAdjustmentService method runExportPathsPreview.

private void runExportPathsPreview() {
    ExportPathsAdjustmentPreviewRestRep previewRestRep = execute(new ExportPathsPreview(host, virtualArray, exportId, minPaths, maxPaths, pathsPerInitiator, storageSystem, ports));
    List<InitiatorPortMapRestRep> affectedPaths = previewRestRep.getAdjustedPaths();
    List<InitiatorPortMapRestRep> removedPaths = previewRestRep.getRemovedPaths();
    // build the affected path
    for (InitiatorPortMapRestRep ipm : affectedPaths) {
        List<URI> portList = new ArrayList<URI>();
        for (NamedRelatedResourceRep port : ipm.getStoragePorts()) {
            portList.add(port.getId());
        }
        resultingPathsMap.put(ipm.getInitiator().getId(), portList);
    }
    // build the removed path
    for (InitiatorPortMapRestRep ipm : removedPaths) {
        List<URI> portList = new ArrayList<URI>();
        for (NamedRelatedResourceRep port : ipm.getStoragePorts()) {
            portList.add(port.getId());
        }
        removedPathsMap.put(ipm.getInitiator().getId(), portList);
    }
}
Also used : InitiatorPortMapRestRep(com.emc.storageos.model.block.export.InitiatorPortMapRestRep) ExportPathsAdjustmentPreviewRestRep(com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep) ArrayList(java.util.ArrayList) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) URI(java.net.URI) ExportPathsPreview(com.emc.sa.service.vipr.block.tasks.ExportPathsPreview)

Aggregations

ExportPathsPreview (com.emc.sa.service.vipr.block.tasks.ExportPathsPreview)1 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 ExportPathsAdjustmentPreviewRestRep (com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep)1 InitiatorPortMapRestRep (com.emc.storageos.model.block.export.InitiatorPortMapRestRep)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1