use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class RestoreSnapshotForApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupSnapshotOperationParam input = new VolumeGroupSnapshotOperationParam();
input.setSnapshots(snapshots);
input.setPartial(true);
TaskList taskList = getClient().application().restoreApplicationSnapshot(applicationId, 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 RestoreSnapshotSessionForApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupSnapshotSessionRestoreParam input = new VolumeGroupSnapshotSessionRestoreParam();
input.setSnapshotSessions(snapSessions);
input.setPartial(true);
TaskList taskList = getClient().application().restoreApplicationSnapshotSession(applicationId, 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 UnlinkSnapshotSessionForApplication method doExecute.
@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
VolumeGroupSnapshotSessionUnlinkTargetsParam input = new VolumeGroupSnapshotSessionUnlinkTargetsParam();
input.setSnapshotSessions(snapshotSessions);
input.setPartial(true);
List<SnapshotSessionUnlinkTargetParam> linkedTargets = Lists.newArrayList();
if (existingLinkedSnapshotIds != null) {
for (String linkedSnapshot : existingLinkedSnapshotIds) {
SnapshotSessionUnlinkTargetParam param = new SnapshotSessionUnlinkTargetParam();
param.setId(uri(linkedSnapshot));
if (deleteTarget != null) {
param.setDeleteTarget(deleteTarget);
}
linkedTargets.add(param);
}
}
input.setLinkedTargets(linkedTargets);
TaskList taskList = getClient().application().unlinkApplicationSnapshotSession(applicationId, 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 BlockSnapshotSessions method deactivate.
/**
* Begins deactivating a given block snapshot session by ID.
* <p>
* API Call: <tt>POST /block/snapshot-sessions/{id}/deactivate</tt>
*
* @param id
* the ID of the snapshot session to deactivate.
* @param type
* {@code FULL} or {@code VIPR_ONLY}
*
* @return a task for monitoring the progress of the operation.
*/
public Tasks<BlockSnapshotSessionRestRep> deactivate(URI id, VolumeDeleteTypeEnum type) {
URI uri = client.uriBuilder(getDeactivateUrl()).queryParam("type", type).build(id);
TaskList tasks = client.postURI(TaskList.class, uri);
return new Tasks<>(client, tasks.getTaskList(), resourceClass);
}
use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.
the class BlockSnapshots method deactivate.
/**
* Begins deactivating a given block snapshot by ID.
* <p>
* API Call: <tt>POST /block/snapshots/{id}/deactivate</tt>
*
* @param id
* the ID of the snapshot to deactivate.
*
* @param type
* {@code FULL} or {@code VIPR_ONLY}
*
* @return a task for monitoring the progress of the operation.
*/
public Tasks<BlockSnapshotRestRep> deactivate(URI id, VolumeDeleteTypeEnum type) {
URI uri = client.uriBuilder(getDeactivateUrl()).queryParam("type", type).build(id);
TaskList tasks = client.postURI(TaskList.class, uri);
return new Tasks<>(client, tasks.getTaskList(), resourceClass);
}
Aggregations