use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method unlinkTargetSnapshot.
public static void unlinkTargetSnapshot(String sessionId, String volumeId, Boolean deleteOption) {
ViPRCoreClient client = BourneUtil.getViprClient();
SnapshotSessionUnlinkTargetsParam sessionTargets = new SnapshotSessionUnlinkTargetsParam();
List<SnapshotSessionUnlinkTargetParam> targetLists = Lists.newArrayList();
List<RelatedResourceRep> targets = client.blockSnapshotSessions().get(uri(sessionId)).getLinkedTarget();
List<BlockSnapshotRestRep> snapshots = client.blockSnapshots().getByRefs(targets);
for (BlockSnapshotRestRep snap : snapshots) {
SnapshotSessionUnlinkTargetParam targetList = new SnapshotSessionUnlinkTargetParam();
targetList.setId(snap.getId());
targetList.setDeleteTarget(deleteOption);
targetLists.add(targetList);
}
if (!targetLists.isEmpty()) {
sessionTargets.setLinkedTargets(targetLists);
Task<BlockSnapshotSessionRestRep> tasks = client.blockSnapshotSessions().unlinkTargets(uri(sessionId), sessionTargets);
flash.put("info", MessagesUtils.get("resources.snapshot.session.unlink.success", sessionId));
} else {
flash.error(MessagesUtils.get(NOTARGET, sessionId));
}
volume(volumeId, null);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method pauseMigration.
@FlashException(referrer = { "volume" })
public static void pauseMigration(String volumeId, String migrationId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(migrationId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
client.blockMigrations().pause(uri(migrationId));
flash.put("info", MessagesUtils.get("resources.migrations.pause"));
}
volume(volumeId, null);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method pauseContinuousCopy.
@FlashException(referrer = { "volume" })
public static void pauseContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().pauseContinuousCopies(uri(volumeId), input);
flash.put("info", MessagesUtils.get("resources.continuouscopy.pause"));
}
volume(volumeId, null);
}
use of com.emc.vipr.client.ViPRCoreClient 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.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method cancelMigration.
@FlashException(referrer = { "volume" })
public static void cancelMigration(String volumeId, String migrationId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(migrationId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
client.blockMigrations().cancel(uri(migrationId));
flash.put("info", MessagesUtils.get("resources.migrations.cancel"));
}
volume(volumeId, null);
}
Aggregations