use of com.emc.sa.asset.providers.BlockProvider.VolumeDetail in project coprhd-controller by CoprHD.
the class TestBlockProviderFilter method filter.
static void filter(ViPRCoreClient client, URI project) {
List<VolumeRestRep> volumes = listVolumes(client, project);
List<VolumeDetail> volumeDetails = getVolumeDetails(client, volumes);
Map<URI, VolumeRestRep> volumeNames = ResourceUtils.mapById(volumes);
List<AssetOption> options = Lists.newArrayList();
for (VolumeDetail detail : volumeDetails) {
boolean localSnapSupported = isLocalSnapshotSupported(detail.vpool);
boolean isRPTargetVolume = isRPTargetVolume(detail.volume);
boolean isRPSourceVolume = isRPSourceVolume(detail.volume);
boolean isInConsistencyGroup = isInConsistencyGroup(detail.volume);
if (isRPSourceVolume || (localSnapSupported && (!isInConsistencyGroup || isRPTargetVolume))) {
options.add(BlockProvider.createVolumeOption(client, null, detail.volume, volumeNames));
System.out.println("\t* " + detail.volume.getName());
} else {
System.out.println("\t" + detail.volume.getName());
}
String extra = String.format("[localSnapSupported: %s, isRPTargetVolume: %s, isRPSourceVolume: %s, isInConsistencyGroup: %s]", localSnapSupported, isRPTargetVolume, isRPSourceVolume, isInConsistencyGroup);
System.out.println(String.format("\t\tpersonality:[ %s ], filter:[ %s ]", getVolumePersonality(detail.volume), extra));
}
}
Aggregations