Search in sources :

Example 1 with GetBlockSnapshot

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

the class BlockStorageUtils method getReplicationGroupSnapshots.

public static Table<URI, String, BlockSnapshotRestRep> getReplicationGroupSnapshots(List<NamedRelatedResourceRep> volumeUris) {
    Table<URI, String, BlockSnapshotRestRep> storageRgToVolumes = HashBasedTable.create();
    for (NamedRelatedResourceRep volumeUri : volumeUris) {
        BlockSnapshotRestRep snapshot = execute(new GetBlockSnapshot(volumeUri.getId()));
        VolumeRestRep volume = execute(new GetBlockVolume(snapshot.getParent().getId()));
        String rgName = volume.getReplicationGroupInstance();
        URI storage = volume.getStorageController();
        if (!storageRgToVolumes.contains(storage, rgName)) {
            storageRgToVolumes.put(storage, rgName, snapshot);
        }
    }
    return storageRgToVolumes;
}
Also used : GetBlockVolume(com.emc.sa.service.vipr.block.tasks.GetBlockVolume) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) GetBlockSnapshot(com.emc.sa.service.vipr.block.tasks.GetBlockSnapshot) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) URI(java.net.URI)

Aggregations

GetBlockSnapshot (com.emc.sa.service.vipr.block.tasks.GetBlockSnapshot)1 GetBlockVolume (com.emc.sa.service.vipr.block.tasks.GetBlockVolume)1 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)1 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)1 URI (java.net.URI)1