use of com.emc.storageos.model.block.SnapshotSessionUnlinkTargetParam in project coprhd-controller by CoprHD.
the class BlockSnapshotSessions method unlinkTarget.
public static void unlinkTarget(String snapshotId, String snapshotSessionId, Boolean deleteOption) {
ViPRCoreClient client = BourneUtil.getViprClient();
SnapshotSessionUnlinkTargetsParam unlinkTarget = new SnapshotSessionUnlinkTargetsParam();
List<SnapshotSessionUnlinkTargetParam> unlinkSessions = Lists.newArrayList();
SnapshotSessionUnlinkTargetParam unlink = new SnapshotSessionUnlinkTargetParam();
unlink.setDeleteTarget(deleteOption);
unlink.setId(uri(snapshotId));
unlinkSessions.add(unlink);
unlinkTarget.setLinkedTargets(unlinkSessions);
client.blockSnapshotSessions().unlinkTargets(uri(snapshotSessionId), unlinkTarget);
flash.put("info", MessagesUtils.get("resources.snapshot.session.unlink.success", snapshotId));
snapshotSessionDetails(snapshotSessionId);
}
use of com.emc.storageos.model.block.SnapshotSessionUnlinkTargetParam in project coprhd-controller by CoprHD.
the class BlockConsistencyGroupService method deactivateAndUnlinkTargetVolumesForSession.
/**
* This method is called when a linked BlockSnapshot for a BlockSnapshotSession is passed to
* {@link #deactivateConsistencyGroupSnapshot(URI, URI)} and we must instead unlink&delete it.
*
* @param session The BlockSnapshotSession.
* @param snapshot The BlockSnapshot.
* @return TaskList wrapping the single TaskResourceRep.
*/
private TaskList deactivateAndUnlinkTargetVolumesForSession(BlockSnapshotSession session, BlockSnapshot snapshot) {
SnapshotSessionUnlinkTargetParam unlink = new SnapshotSessionUnlinkTargetParam(snapshot.getId(), true);
SnapshotSessionUnlinkTargetsParam param = new SnapshotSessionUnlinkTargetsParam(newArrayList(unlink));
TaskResourceRep task = unlinkTargetVolumesFromSnapshotSession(session.getId(), param, OperationTypeEnum.DELETE_CONSISTENCY_GROUP_SNAPSHOT);
return new TaskList(newArrayList(task));
}
Aggregations