Search in sources :

Example 1 with TaskList

use of com.emc.storageos.model.TaskList 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 TaskList

use of com.emc.storageos.model.TaskList 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 TaskList

use of com.emc.storageos.model.TaskList 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 TaskList

use of com.emc.storageos.model.TaskList 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 TaskList

use of com.emc.storageos.model.TaskList 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

TaskList (com.emc.storageos.model.TaskList)161 ArrayList (java.util.ArrayList)84 URI (java.net.URI)83 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)82 Volume (com.emc.storageos.db.client.model.Volume)67 Produces (javax.ws.rs.Produces)62 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)57 Operation (com.emc.storageos.db.client.model.Operation)55 POST (javax.ws.rs.POST)55 Path (javax.ws.rs.Path)54 Consumes (javax.ws.rs.Consumes)44 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)43 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)35 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)33 NamedURI (com.emc.storageos.db.client.model.NamedURI)28 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)27 NullColumnValueGetter.isNullURI (com.emc.storageos.db.client.util.NullColumnValueGetter.isNullURI)27 Tasks (com.emc.vipr.client.Tasks)27 List (java.util.List)26 WaitForTasks (com.emc.sa.service.vipr.tasks.WaitForTasks)23