use of com.emc.vipr.client.exceptions.ServiceErrorException in project coprhd-controller by CoprHD.
the class ChangeBlockVolumeVirtualPoolNoWait method executeTask.
@Override
public Tasks<VolumeRestRep> executeTask() throws Exception {
Tasks<VolumeRestRep> result = new Tasks<VolumeRestRep>(getClient().auth().getClient(), null, VolumeRestRep.class);
// One request per virtual pool
for (URI vpool : volumeIds.keySet()) {
if (!vpool.equals(targetVirtualPoolId)) {
VolumeVirtualPoolChangeParam input = new VolumeVirtualPoolChangeParam();
input.setVolumes(Lists.newArrayList(volumeIds.get(vpool)));
input.setVirtualPool(targetVirtualPoolId);
try {
Tasks<VolumeRestRep> tasks = getClient().blockVolumes().changeVirtualPool(input);
for (Task<VolumeRestRep> task : tasks.getTasks()) {
addOrderIdTag(task.getTaskResource().getId());
}
result.getTasks().addAll(tasks.getTasks());
} catch (ServiceErrorException ex) {
logError(ex.getMessage());
}
}
}
return result;
}
Aggregations