Search in sources :

Example 1 with VolumeGroupFullCopyDetachParam

use of com.emc.storageos.model.application.VolumeGroupFullCopyDetachParam 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 2 with VolumeGroupFullCopyDetachParam

use of com.emc.storageos.model.application.VolumeGroupFullCopyDetachParam 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)

Aggregations

WaitForTasks (com.emc.sa.service.vipr.tasks.WaitForTasks)2 TaskList (com.emc.storageos.model.TaskList)2 VolumeGroupFullCopyDetachParam (com.emc.storageos.model.application.VolumeGroupFullCopyDetachParam)2 Tasks (com.emc.vipr.client.Tasks)2 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 NamedVolumesList (com.emc.storageos.model.block.NamedVolumesList)1 URI (java.net.URI)1 HashSet (java.util.HashSet)1