Search in sources :

Example 21 with ExportGroupRestRep

use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.

the class GetMobilityGroupVolumesByHost method getHostExportedVolumes.

private Set<URI> getHostExportedVolumes() {
    Set<URI> volumes = Sets.newHashSet();
    for (NamedRelatedResourceRep host : hosts) {
        List<ExportGroupRestRep> exports = getClient().blockExports().findContainingHost(host.getId());
        volumes.addAll(BlockProviderUtils.getExportedResourceIds(exports, ResourceType.VOLUME));
    }
    return volumes;
}
Also used : ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) URI(java.net.URI)

Example 22 with ExportGroupRestRep

use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.

the class ViPRClientApp method createExport.

public URI createExport(URI volumeId, HostRestRep host, VirtualArrayRestRep virtualArray, ProjectRestRep project) {
    ExportCreateParam input = new ExportCreateParam();
    input.setName("SDSClientApp_Export");
    input.setType("Host");
    input.addHost(host.getId());
    input.setVarray(virtualArray.getId());
    input.addVolume(volumeId);
    input.setProject(project.getId());
    ExportGroupRestRep export = client.blockExports().create(input).get();
    System.out.println("Created Export Group: " + export.getId());
    return export.getId();
}
Also used : ExportCreateParam(com.emc.storageos.model.block.export.ExportCreateParam) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep)

Example 23 with ExportGroupRestRep

use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.

the class BlockStorageUtils method removeBlockResourcesFromExport.

public static void removeBlockResourcesFromExport(Collection<URI> resourceId, URI exportId) {
    Task<ExportGroupRestRep> task = execute(new RemoveBlockResourcesFromExport(exportId, resourceId));
    addAffectedResource(task);
    removeExportIfEmpty(exportId);
}
Also used : ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) RemoveBlockResourcesFromExport(com.emc.sa.service.vipr.block.tasks.RemoveBlockResourcesFromExport)

Example 24 with ExportGroupRestRep

use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.

the class BlockStorageUtils method adjustExportPaths.

public static URI adjustExportPaths(URI vArray, Integer minPaths, Integer maxPaths, Integer pathsPerInitiator, URI storageSystemId, URI id, List<InitiatorPathParam> addedPaths, List<InitiatorPathParam> removedPaths, boolean suspendWait) {
    Task<ExportGroupRestRep> task = execute(new AdjustExportPaths(vArray, minPaths, maxPaths, pathsPerInitiator, storageSystemId, id, addedPaths, removedPaths, suspendWait));
    URI exportId = task.getResourceId();
    addAffectedResource(exportId);
    return exportId;
}
Also used : ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) AdjustExportPaths(com.emc.sa.service.vipr.block.tasks.AdjustExportPaths) URI(java.net.URI)

Example 25 with ExportGroupRestRep

use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.

the class BlockStorageUtils method addHostToExport.

public static void addHostToExport(URI exportId, URI host, Integer minPaths, Integer maxPaths, Integer pathsPerInitiator, URI portGroup) {
    Task<ExportGroupRestRep> task = execute(new AddHostToExport(exportId, host, minPaths, maxPaths, pathsPerInitiator, portGroup));
    addRollback(new DeactivateBlockExport(exportId));
    addAffectedResource(task);
}
Also used : DeactivateBlockExport(com.emc.sa.service.vipr.block.tasks.DeactivateBlockExport) AddHostToExport(com.emc.sa.service.vipr.block.tasks.AddHostToExport) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep)

Aggregations

ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)59 URI (java.net.URI)36 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)24 Asset (com.emc.sa.asset.annotation.Asset)10 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)10 FlashException (controllers.util.FlashException)9 ExportUpdateParam (com.emc.storageos.model.block.export.ExportUpdateParam)8 AssetOption (com.emc.vipr.model.catalog.AssetOption)8 ArrayList (java.util.ArrayList)8 ExportBlockParam (com.emc.storageos.model.block.export.ExportBlockParam)7 DeactivateBlockExport (com.emc.sa.service.vipr.block.tasks.DeactivateBlockExport)5 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)5 BlockObjectRestRep (com.emc.storageos.model.block.BlockObjectRestRep)5 ITLRestRep (com.emc.storageos.model.block.export.ITLRestRep)5 HostRestRep (com.emc.storageos.model.host.HostRestRep)5 HashSet (java.util.HashSet)5 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)4 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)4 SimpleValueRep (com.emc.storageos.model.customconfig.SimpleValueRep)4 StoragePortGroupRestRepList (com.emc.storageos.model.portgroup.StoragePortGroupRestRepList)4