Search in sources :

Example 1 with Tasks

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);
}
Also used : WaitForTasks(com.emc.sa.service.vipr.tasks.WaitForTasks) Tasks(com.emc.vipr.client.Tasks) TaskList(com.emc.storageos.model.TaskList) ArrayList(java.util.ArrayList) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) URI(java.net.URI) VolumeGroupFullCopyRestoreParam(com.emc.storageos.model.application.VolumeGroupFullCopyRestoreParam)

Example 2 with Tasks

use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.

the class ResynchronizeSnapshotForApplication method doExecute.

@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
    VolumeGroupSnapshotOperationParam input = new VolumeGroupSnapshotOperationParam();
    input.setSnapshots(snapshots);
    input.setPartial(true);
    TaskList taskList = getClient().application().resynchronizeApplicationSnapshot(applicationId, input);
    return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
Also used : WaitForTasks(com.emc.sa.service.vipr.tasks.WaitForTasks) Tasks(com.emc.vipr.client.Tasks) TaskList(com.emc.storageos.model.TaskList) VolumeGroupSnapshotOperationParam(com.emc.storageos.model.application.VolumeGroupSnapshotOperationParam)

Example 3 with Tasks

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);
}
Also used : VolumeGroupVolumeList(com.emc.storageos.model.application.VolumeGroupUpdateParam.VolumeGroupVolumeList) WaitForTasks(com.emc.sa.service.vipr.tasks.WaitForTasks) Tasks(com.emc.vipr.client.Tasks) TaskList(com.emc.storageos.model.TaskList) VolumeGroupUpdateParam(com.emc.storageos.model.application.VolumeGroupUpdateParam)

Example 4 with Tasks

use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.

the class ResynchronizeApplicationFullCopy method doExecute.

@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
    VolumeGroupFullCopyResynchronizeParam input = new VolumeGroupFullCopyResynchronizeParam(true, volumeIds);
    TaskList taskList = getClient().application().resynchronizeApplicationFullCopy(applicationId, input);
    return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
Also used : WaitForTasks(com.emc.sa.service.vipr.tasks.WaitForTasks) Tasks(com.emc.vipr.client.Tasks) TaskList(com.emc.storageos.model.TaskList) VolumeGroupFullCopyResynchronizeParam(com.emc.storageos.model.application.VolumeGroupFullCopyResynchronizeParam)

Example 5 with Tasks

use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.

the class CreateSnapshotForApplication method doExecute.

@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
    VolumeGroupSnapshotCreateParam input = new VolumeGroupSnapshotCreateParam();
    input.setName(name);
    input.setVolumes(volumes);
    input.setPartial(true);
    input.setReadOnly(readOnly);
    TaskList taskList = getClient().application().createSnapshotOfApplication(applicationId, input);
    return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
Also used : WaitForTasks(com.emc.sa.service.vipr.tasks.WaitForTasks) Tasks(com.emc.vipr.client.Tasks) TaskList(com.emc.storageos.model.TaskList) VolumeGroupSnapshotCreateParam(com.emc.storageos.model.application.VolumeGroupSnapshotCreateParam)

Aggregations

Tasks (com.emc.vipr.client.Tasks)29 TaskList (com.emc.storageos.model.TaskList)27 WaitForTasks (com.emc.sa.service.vipr.tasks.WaitForTasks)24 VolumeGroupUpdateParam (com.emc.storageos.model.application.VolumeGroupUpdateParam)8 URI (java.net.URI)8 VolumeGroupSnapshotOperationParam (com.emc.storageos.model.application.VolumeGroupSnapshotOperationParam)4 VolumeGroupVolumeList (com.emc.storageos.model.application.VolumeGroupUpdateParam.VolumeGroupVolumeList)4 VolumeGroupFullCopyDetachParam (com.emc.storageos.model.application.VolumeGroupFullCopyDetachParam)2 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)2 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 VolumeGroupFullCopyCreateParam (com.emc.storageos.model.application.VolumeGroupFullCopyCreateParam)1 VolumeGroupFullCopyRestoreParam (com.emc.storageos.model.application.VolumeGroupFullCopyRestoreParam)1 VolumeGroupFullCopyResynchronizeParam (com.emc.storageos.model.application.VolumeGroupFullCopyResynchronizeParam)1 VolumeGroupSnapshotCreateParam (com.emc.storageos.model.application.VolumeGroupSnapshotCreateParam)1 VolumeGroupSnapshotSessionCreateParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionCreateParam)1 VolumeGroupSnapshotSessionDeactivateParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionDeactivateParam)1 VolumeGroupSnapshotSessionLinkTargetsParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionLinkTargetsParam)1 VolumeGroupSnapshotSessionRelinkTargetsParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionRelinkTargetsParam)1 VolumeGroupSnapshotSessionRestoreParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionRestoreParam)1 VolumeGroupSnapshotSessionUnlinkTargetsParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionUnlinkTargetsParam)1