Search in sources :

Example 1 with ExportPathsAdjustmentPreviewRestRep

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");
}
Also used : InitiatorPortMapRestRep(com.emc.storageos.model.block.export.InitiatorPortMapRestRep) ExportPathsAdjustmentPreviewRestRep(com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep) URI(java.net.URI) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 2 with ExportPathsAdjustmentPreviewRestRep

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");
}
Also used : InitiatorPortMapRestRep(com.emc.storageos.model.block.export.InitiatorPortMapRestRep) ExportPathsAdjustmentPreviewRestRep(com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep) URI(java.net.URI) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 3 with ExportPathsAdjustmentPreviewRestRep

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);
    }
}
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)

Example 4 with ExportPathsAdjustmentPreviewRestRep

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;
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) AssetOption(com.emc.vipr.model.catalog.AssetOption) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ExportPathsAdjustmentPreviewRestRep(com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep) ArrayList(java.util.ArrayList) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) URI(java.net.URI) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 5 with ExportPathsAdjustmentPreviewRestRep

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;
}
Also used : AssetOption(com.emc.vipr.model.catalog.AssetOption) ExportPathsAdjustmentPreviewRestRep(com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep) URI(java.net.URI) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Aggregations

ExportPathsAdjustmentPreviewRestRep (com.emc.storageos.model.block.export.ExportPathsAdjustmentPreviewRestRep)6 URI (java.net.URI)6 Asset (com.emc.sa.asset.annotation.Asset)4 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)4 InitiatorPortMapRestRep (com.emc.storageos.model.block.export.InitiatorPortMapRestRep)4 ArrayList (java.util.ArrayList)3 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)2 AssetOption (com.emc.vipr.model.catalog.AssetOption)2 ExportPathsPreview (com.emc.sa.service.vipr.block.tasks.ExportPathsPreview)1 BulkList (com.emc.storageos.api.service.impl.response.BulkList)1 SearchedResRepList (com.emc.storageos.api.service.impl.response.SearchedResRepList)1 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)1 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)1 ExportPathParams (com.emc.storageos.db.client.model.ExportPathParams)1 Initiator (com.emc.storageos.db.client.model.Initiator)1 NamedURI (com.emc.storageos.db.client.model.NamedURI)1 StoragePort (com.emc.storageos.db.client.model.StoragePort)1 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)1 StringSet (com.emc.storageos.db.client.model.StringSet)1 StringSetMap (com.emc.storageos.db.client.model.StringSetMap)1