use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class DetachApplicationFullCopy method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupFullCopyDetachParam input = new VolumeGroupFullCopyDetachParam(true, volumeIds);
TaskList taskList = getClient().application().detachApplicationFullCopy(applicationId, input);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class LinkSnapshotSessionForApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
TaskList taskList = null;
if (linkedTargets != null && !linkedTargets.isEmpty()) {
VolumeGroupSnapshotSessionRelinkTargetsParam relinkParam = new VolumeGroupSnapshotSessionRelinkTargetsParam();
relinkParam.setLinkedTargetIds(linkedTargets);
relinkParam.setPartial(true);
relinkParam.setSnapshotSessions(snapSessions);
taskList = getClient().application().relinkApplicationSnapshotSession(applicationId, relinkParam);
} else {
VolumeGroupSnapshotSessionLinkTargetsParam input = new VolumeGroupSnapshotSessionLinkTargetsParam();
input.setSnapshotSessions(snapSessions);
input.setPartial(true);
SnapshotSessionNewTargetsParam newLinkedTargets = new SnapshotSessionNewTargetsParam();
newLinkedTargets.setCopyMode(copyMode);
newLinkedTargets.setCount(count);
newLinkedTargets.setTargetName(targetName);
input.setNewLinkedTargets(newLinkedTargets);
taskList = getClient().application().linkApplicationSnapshotSession(applicationId, input);
}
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class RemoveApplicationFullCopy method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
NamedVolumesList allFullCopies = getClient().application().getFullCopiesByApplication(applicationId);
Set<URI> fullCopyIds = new HashSet<URI>();
for (NamedRelatedResourceRep fullCopy : allFullCopies.getVolumes()) {
fullCopyIds.add(fullCopy.getId());
}
List<URI> volList = Collections.singletonList(volumeId);
VolumeGroupFullCopyDetachParam input = new VolumeGroupFullCopyDetachParam(true, volList);
TaskList taskList = getClient().application().detachApplicationFullCopy(applicationId, input);
BlockStorageUtils.removeBlockResources(fullCopyIds, VolumeDeleteTypeEnum.FULL);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class RemoveVolumesFromApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupUpdateParam input = new VolumeGroupUpdateParam();
VolumeGroupVolumeList removeVolumesList = new VolumeGroupVolumeList();
removeVolumesList.setVolumes(volumeIds);
input.setRemoveVolumesList(removeVolumesList);
TaskList taskList = getClient().application().updateApplication(applicationId, input);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
use of com.emc.vipr.client.Tasks 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