use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class BlockVolumes method deactivateContinuousCopies.
/**
* Begins deactivating a number of continuous copies for the given block volume.
* <p>
* API Call: <tt>POST /block/volumes/{id}/protection/continuous-copies/deactivate</tt>
*
* @param id
* the ID of the block volume.
* @param input
* the copy configurations.
* @param type
* {@code FULL} or {@code VIPR_ONLY}
*
* @return tasks for monitoring the progress of the operation.
*/
public Tasks<VolumeRestRep> deactivateContinuousCopies(URI id, CopiesParam input, VolumeDeleteTypeEnum type) {
URI uri = client.uriBuilder(getContinuousCopiesUrl() + "/deactivate").queryParam("type", type).build(id);
TaskList tasks = client.postURI(TaskList.class, input, uri);
return new Tasks<>(client, tasks.getTaskList(), resourceClass);
}
use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class AddHostsToMobilityGroup method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupUpdateParam input = new VolumeGroupUpdateParam();
input.setAddHostsList(hostIds);
TaskList taskList = getClient().application().updateApplication(mobilityGroupId, input);
return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
use of com.emc.vipr.client.Tasks 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;
}
use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class IngestExportedUnmanagedVolumes method executeChunks.
private Tasks<UnManagedVolumeRestRep> executeChunks(VolumeExportIngestParam ingest) {
Tasks<UnManagedVolumeRestRep> results = new Tasks<UnManagedVolumeRestRep>(getClient().auth().getClient(), null, UnManagedVolumeRestRep.class);
int i = 0;
Iterator<URI> ids = unmanagedVolumeIds.iterator();
while (ids.hasNext()) {
i++;
URI id = ids.next();
ingest.getUnManagedVolumes().add(id);
if (i == INGEST_CHUNK_SIZE || !ids.hasNext()) {
Tasks<UnManagedVolumeRestRep> currentChunk = ingestVolumes(ingest);
results.getTasks().addAll(currentChunk.getTasks());
processBatch(currentChunk, i);
ingest.getUnManagedVolumes().clear();
i = 0;
}
}
return results;
}
Aggregations