use of com.emc.storageos.recoverpoint.requests.CreateBookmarkRequestParams in project coprhd-controller by CoprHD.
the class RecoverPointClientIntegrationTest method recreateCGAndBookmark.
public void recreateCGAndBookmark() throws RecoverPointException {
CreateBookmarkRequestParams params = new CreateBookmarkRequestParams();
Bookmarkname = "BourneBookmark_";
Random randomnumber = new Random();
Bookmarkname += Math.abs(randomnumber.nextInt());
params.setBookmark(Bookmarkname);
Set<String> WWNSetToBookmark = new HashSet<String>();
WWNSetToBookmark.add(BourneRPTestCRRLUN1WWN);
WWNSetToBookmark.add(BourneRPTestCRRLUN2WWN);
params.setVolumeWWNSet(WWNSetToBookmark);
recreateCG();
rpClient.createBookmarks(params);
}
use of com.emc.storageos.recoverpoint.requests.CreateBookmarkRequestParams in project coprhd-controller by CoprHD.
the class RPDeviceController method createBookmarkStep.
/**
* This method creates a RP bookmark
*
* @param snapshotList
* List of snapshot
* @param system
* Protection Sytem
* @param snapshotName
* snapshot name
* @param volumeWWNs
* WWNs of the volumes whose snap is requested
* @param rpBookmarkOnly
* if true, an RP bookmark is taken or a local array snap is performed.
* @param token
* step Id corresponding to this step.
* @return true if successful, false otherwise.
*/
public boolean createBookmarkStep(List<URI> snapshotList, ProtectionSystem system, String snapshotName, Set<String> volumeWWNs, boolean rpBookmarkOnly, String token) {
RecoverPointClient rp = RPHelper.getRecoverPointClient(system);
CreateBookmarkRequestParams request = new CreateBookmarkRequestParams();
request.setVolumeWWNSet(volumeWWNs);
request.setBookmark(snapshotName);
try {
// Create the bookmark on the RP System
CreateBookmarkResponse response = rp.createBookmarks(request);
if (response == null) {
throw DeviceControllerExceptions.recoverpoint.failedToCreateBookmark();
}
if (snapshotList != null && !snapshotList.isEmpty()) {
// RP Bookmark-only flow.
if (rpBookmarkOnly) {
// This will update the blocksnapshot object based on the return of the EM call
// The construct method will set the task completer on each snapshot
constructSnapshotObjectFromBookmark(response, system, snapshotList, snapshotName, token);
} else {
// image access later on.
for (URI snapshotURI : snapshotList) {
BlockSnapshot snapshot = _dbClient.queryObject(BlockSnapshot.class, snapshotURI);
snapshot.setEmName(snapshotName);
_dbClient.updateObject(snapshot);
}
}
}
WorkflowStepCompleter.stepSucceded(token);
} catch (RecoverPointException e) {
_log.error("create bookmark step failed with a RecoverPoint exception: ", e);
WorkflowStepCompleter.stepFailed(token, e);
return false;
} catch (Exception e) {
_log.error("create bookmark step failed with an unchecked exception: ", e);
WorkflowStepCompleter.stepFailed(token, DeviceControllerException.errors.jobFailed(e));
return false;
}
return true;
}
Aggregations