use of com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getResultingPaths.
@Asset("exportPathResultingPaths")
@AssetDependencies({ "host", "exportPathVirtualArray", "exportPathExport", "exportPathMinPathsOptions", "exportPathMaxPathsOptions", "exportPathPathsPerInitiatorOptions", "exportPathExistingPath", "exportPathStorageSystem", "exportPathPorts" })
public List<AssetOption> getResultingPaths(AssetOptionsContext ctx, URI hostOrClusterId, URI vArrayId, URI exportId, Integer minPaths, Integer maxPaths, Integer pathsPerInitiator, String useExisting, URI storageSystemId, String ports) {
List<URI> exportPathPorts = parseExportPathPorts(ports);
ExportPathsAdjustmentPreviewRestRep portPreview = generateExportPathPreview(ctx, hostOrClusterId, vArrayId, exportId, minPaths, maxPaths, pathsPerInitiator, useExisting, storageSystemId, exportPathPorts);
List<InitiatorPortMapRestRep> addedList = portPreview.getAdjustedPaths();
return buildPathOptions(ctx, addedList, "exportPathAdjustment.resultingPaths");
}
use of com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getRemovedPaths.
@Asset("exportPathRemovedPaths")
@AssetDependencies({ "host", "exportPathVirtualArray", "exportPathExport", "exportPathMinPathsOptions", "exportPathMaxPathsOptions", "exportPathPathsPerInitiatorOptions", "exportPathExistingPath", "exportPathStorageSystem", "exportPathPorts" })
public List<AssetOption> getRemovedPaths(AssetOptionsContext ctx, URI hostOrClusterId, URI vArrayId, URI exportId, Integer minPaths, Integer maxPaths, Integer pathsPerInitiator, String useExisting, URI storageSystemId, String ports) {
List<URI> exportPathPorts = parseExportPathPorts(ports);
ExportPathsAdjustmentPreviewRestRep portPreview = generateExportPathPreview(ctx, hostOrClusterId, vArrayId, exportId, minPaths, maxPaths, pathsPerInitiator, useExisting, storageSystemId, exportPathPorts);
List<InitiatorPortMapRestRep> removedList = portPreview.getRemovedPaths();
return buildPathOptions(ctx, removedList, "exportPathAdjustment.removedPaths");
}
use of com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep 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);
}
}
use of com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getAffectedExports.
@Asset("exportPathAffectedExports")
@AssetDependencies({ "host", "exportPathVirtualArray", "exportPathExport", "exportPathMinPathsOptions", "exportPathMaxPathsOptions", "exportPathPathsPerInitiatorOptions", "exportPathExistingPath", "exportPathStorageSystem", "exportPathPorts" })
public List<AssetOption> getAffectedExports(AssetOptionsContext ctx, URI hostOrClusterId, URI vArrayId, URI exportId, Integer minPaths, Integer maxPaths, Integer pathsPerInitiator, String useExisting, URI storageSystemId, String ports) {
ViPRCoreClient client = api(ctx);
// the asset option list
List<AssetOption> options = Lists.newArrayList();
List<URI> exportPathPorts = parseExportPathPorts(ports);
ExportPathsAdjustmentPreviewRestRep portPreview = generateExportPathPreview(ctx, hostOrClusterId, vArrayId, exportId, minPaths, maxPaths, pathsPerInitiator, useExisting, storageSystemId, exportPathPorts);
List<NamedRelatedResourceRep> affectedList = portPreview.getAffectedExportGroups();
List<URI> exportIds = new ArrayList<URI>();
for (NamedRelatedResourceRep affected : affectedList) {
exportIds.add(affected.getId());
}
List<ExportGroupRestRep> exports = client.blockExports().getByIds(exportIds);
for (ExportGroupRestRep export : exports) {
// TODO: need to optimize the way that we retrieve the project name.
String projectName = client.projects().get(export.getProject().getId()).getName();
String label = getMessage("exportPathAdjustment.affectedExports", projectName, export.getName());
options.add(new AssetOption(export.getName(), label));
}
return options;
}
use of com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getPreviewStorageSystem.
@Asset("exportPathPreviewStorageSystem")
@AssetDependencies({ "host", "exportPathVirtualArray", "exportPathExport", "exportPathMinPathsOptions", "exportPathMaxPathsOptions", "exportPathPathsPerInitiatorOptions", "exportPathExistingPath", "exportPathStorageSystem", "exportPathPorts" })
public List<AssetOption> getPreviewStorageSystem(AssetOptionsContext ctx, URI hostOrClusterId, URI vArrayId, URI exportId, Integer minPaths, Integer maxPaths, Integer pathsPerInitiator, String useExisting, URI storageSystemId, String ports) {
List<AssetOption> options = Lists.newArrayList();
List<URI> exportPathPorts = parseExportPathPorts(ports);
ExportPathsAdjustmentPreviewRestRep portPreview = generateExportPathPreview(ctx, hostOrClusterId, vArrayId, exportId, minPaths, maxPaths, pathsPerInitiator, useExisting, storageSystemId, exportPathPorts);
options.add(new AssetOption(portPreview.getStorageSystem(), portPreview.getStorageSystem()));
return options;
}
Aggregations