use of com.emc.storageos.model.application.VolumeGroupFullCopyRestoreParam in project coprhd-controller by CoprHD.
the class RestoreApplicationFullCopy method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
List<URI> volumeIds = new ArrayList<URI>();
List<VolumeRestRep> allCopyVols = getClient().blockVolumes().getByRefs(getClient().application().getFullCopiesByApplication(applicationId).getVolumes());
List<VolumeRestRep> volsForCopy = filterByCopyName(allCopyVols);
if (volsForCopy != null && !volsForCopy.isEmpty()) {
for (String subGroup : applicationSubGroup) {
URI volInSubGroup = findVolumeInSubGroup(volsForCopy, subGroup);
if (volInSubGroup != null) {
volumeIds.add(volInSubGroup);
}
}
}
if (volumeIds.isEmpty()) {
ExecutionUtils.fail("failTask.RestoreApplicationFullCopyService.volumeId.precheck", new Object[] {});
}
VolumeGroupFullCopyRestoreParam input = new VolumeGroupFullCopyRestoreParam(true, volumeIds);
TaskList taskList = getClient().application().restoreApplicationFullCopy(applicationId, input);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
Aggregations