use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class VolumeWWNUtilsTest method testPartial.
@Test
public void testPartial() throws Exception {
VolumeRestRep blockObject = new VolumeRestRep();
blockObject.setWwn("514abcdef0123456");
String actualWwn = "514abcdef0123456";
assertTrue(VolumeWWNUtils.wwnMatches(actualWwn, blockObject.getWwn()));
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class VolumeWWNUtilsTest method testPartialAtEnd.
@Test
public void testPartialAtEnd() throws Exception {
VolumeRestRep blockObject = new VolumeRestRep();
blockObject.setWwn("514abcdef0123456");
String actualWwn = "12345514abcdef0123456";
assertTrue(VolumeWWNUtils.wwnMatches(actualWwn, blockObject.getWwn()));
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class VolumeWWNUtilsTest method testMatchingWWNs.
@Test
public void testMatchingWWNs() throws Exception {
VolumeRestRep blockObject = new VolumeRestRep();
blockObject.setWwn("60060abcdef0123456789abcdef01234");
String actualWwn = "60060abcdef0123456789abcdef01234";
assertTrue(VolumeWWNUtils.wwnMatches(actualWwn, blockObject.getWwn()));
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method createVolumeOptions.
protected static List<AssetOption> createVolumeOptions(ViPRCoreClient client, URI project, URI hostId, Collection<? extends BlockObjectRestRep> blockObjects) {
Map<URI, VolumeRestRep> volumeNames = getProjectVolumeNames(client, project);
List<AssetOption> options = Lists.newArrayList();
for (BlockObjectRestRep blockObject : blockObjects) {
options.add(createVolumeOption(client, hostId, blockObject, volumeNames));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getVolumesWithFullCopies.
@Asset("volumeWithFullCopies")
@AssetDependencies({ "project", "blockVolumeOrConsistencyType" })
public List<AssetOption> getVolumesWithFullCopies(AssetOptionsContext ctx, URI project, String volumeOrConsistencyType) {
final ViPRCoreClient client = api(ctx);
if (isVolumeType(volumeOrConsistencyType)) {
List<VolumeRestRep> volumes = findVolumesByProject(client, project);
List<VolumeRestRep> filteredVols = new ArrayList<>();
for (VolumeRestRep vol : volumes) {
if (vol.getProtection() == null || vol.getProtection().getFullCopyRep() == null || vol.getProtection().getFullCopyRep().getFullCopyVolumes() == null || vol.getProtection().getFullCopyRep().getFullCopyVolumes().isEmpty() || !StringUtils.isEmpty(vol.getReplicationGroupInstance())) {
continue;
}
filteredVols.add(vol);
}
log.info("Got volumes with full copies: [{}]", filteredVols.size());
return createVolumeOptions(client, filteredVols);
} else {
List<BlockConsistencyGroupRestRep> consistencyGroups = api(ctx).blockConsistencyGroups().search().byProject(project).run();
return createBaseResourceOptions(consistencyGroups);
}
}
Aggregations