Search in sources :

Example 11 with Tasks

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

Example 12 with Tasks

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

Example 13 with Tasks

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

Example 14 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 15 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)

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