use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockVolumes method resumeContinuousCopy.
@FlashException(referrer = { "volume" })
public static void resumeContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().resumeContinuousCopies(uri(volumeId), input);
flash.put("info", MessagesUtils.get("resources.continuouscopy.resume"));
}
volume(volumeId, null);
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockVolumes method volumeSnapshotSessions.
public static void volumeSnapshotSessions(String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
VolumeRestRep volume = client.blockVolumes().get(uri(volumeId));
List<BlockSnapshotSessionRestRep> snapshotSessions = Lists.newArrayList();
if (volume.getConsistencyGroup() != null) {
URI consistencygroup = volume.getConsistencyGroup().getId();
List<NamedRelatedResourceRep> cgSessions = client.blockConsistencyGroups().getSnapshotSessions(consistencygroup);
snapshotSessions = client.blockSnapshotSessions().getByRefs(cgSessions);
} else {
List<NamedRelatedResourceRep> refs = client.blockSnapshotSessions().listByVolume(uri(volumeId));
snapshotSessions = client.blockSnapshotSessions().getByRefs(refs);
}
render(snapshotSessions, volumeId);
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockVolumes method volumeDetails.
public static void volumeDetails(String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
String consistencygroup = "";
VolumeRestRep volume = client.blockVolumes().get(uri(volumeId));
if (volume == null) {
error(MessagesUtils.get(UNKNOWN, volumeId));
}
if (volume.getConsistencyGroup() != null) {
consistencygroup = client.blockConsistencyGroups().get(volume.getConsistencyGroup().getId()).getName();
}
render(consistencygroup);
}
use of com.emc.storageos.model.block.VolumeRestRep 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));
}
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class TestBlockStorageUtils method prepare.
static List<URI> prepare(ViPRCoreClient client) throws URISyntaxException {
List<URI> returnList = new ArrayList<>();
ProjectRestRep project = client.projects().get(new URI("urn:storageos:Project:3e1ef32b-3091-4a83-9fac-4a2a3bc30413:global"));
for (BlockSnapshotRestRep r : client.blockSnapshots().findByProject(project)) {
returnList.add(r.getId());
}
for (VolumeRestRep r : client.blockVolumes().findByProject(project)) {
returnList.add(r.getId());
}
return returnList;
}
Aggregations