Search in sources :

Example 91 with TaskList

use of com.emc.storageos.model.TaskList in project coprhd-controller by CoprHD.

the class CreateSnapshotSessionForApplication method doExecute.

@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
    VolumeGroupSnapshotSessionCreateParam input = new VolumeGroupSnapshotSessionCreateParam();
    input.setName(name);
    input.setVolumes(volumes);
    input.setPartial(true);
    TaskList taskList = getClient().application().createSnapshotSessionOfApplication(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) VolumeGroupSnapshotSessionCreateParam(com.emc.storageos.model.application.VolumeGroupSnapshotSessionCreateParam)

Example 92 with TaskList

use of com.emc.storageos.model.TaskList in project coprhd-controller by CoprHD.

the class CreateCloneOfApplication method doExecute.

@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
    VolumeGroupFullCopyCreateParam input = new VolumeGroupFullCopyCreateParam();
    input.setName(name);
    input.setCreateInactive(false);
    input.setPartial(true);
    input.setVolumes(volumeIds);
    TaskList taskList = getClient().application().createFullCopyOfApplication(applicationId, input);
    return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
Also used : VolumeGroupFullCopyCreateParam(com.emc.storageos.model.application.VolumeGroupFullCopyCreateParam) WaitForTasks(com.emc.sa.service.vipr.tasks.WaitForTasks) Tasks(com.emc.vipr.client.Tasks) TaskList(com.emc.storageos.model.TaskList)

Example 93 with TaskList

use of com.emc.storageos.model.TaskList 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);
}
Also used : 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 94 with TaskList

use of com.emc.storageos.model.TaskList 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);
}
Also used : Tasks(com.emc.vipr.client.Tasks) TaskList(com.emc.storageos.model.TaskList) URI(java.net.URI)

Example 95 with TaskList

use of com.emc.storageos.model.TaskList 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);
}
Also used : Tasks(com.emc.vipr.client.Tasks) TaskList(com.emc.storageos.model.TaskList) URI(java.net.URI)

Aggregations

TaskList (com.emc.storageos.model.TaskList)161 ArrayList (java.util.ArrayList)84 URI (java.net.URI)83 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)82 Volume (com.emc.storageos.db.client.model.Volume)67 Produces (javax.ws.rs.Produces)62 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)57 Operation (com.emc.storageos.db.client.model.Operation)55 POST (javax.ws.rs.POST)55 Path (javax.ws.rs.Path)54 Consumes (javax.ws.rs.Consumes)44 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)43 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)35 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)33 NamedURI (com.emc.storageos.db.client.model.NamedURI)28 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)27 NullColumnValueGetter.isNullURI (com.emc.storageos.db.client.util.NullColumnValueGetter.isNullURI)27 Tasks (com.emc.vipr.client.Tasks)27 List (java.util.List)26 WaitForTasks (com.emc.sa.service.vipr.tasks.WaitForTasks)23