Search in sources :

Example 6 with Tasks

use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.

the class BlockVolumes method deactivate.

/**
 * Begins deactivating multiple block volumes by their IDs.
 * <p>
 * API Call: <tt>POST /block/volumes/deactivate?type={deletionType}</tt>
 *
 * @param ids
 *            The IDs of the block volumes to deactivate.
 * @param deletionType
 *            {@code FULL} or {@code VIPR_ONLY}
 * @return tasks for monitoring the progress of the operations.
 *
 * @see com.emc.storageos.model.block.VolumeDeleteTypeEnum
 */
public Tasks<VolumeRestRep> deactivate(List<URI> ids, VolumeDeleteTypeEnum deletionType) {
    URI uri = client.uriBuilder(baseUrl + "/deactivate").queryParam("type", deletionType).build();
    TaskList tasks = client.postURI(TaskList.class, new BulkDeleteParam(ids), uri);
    return new Tasks<>(client, tasks.getTaskList(), resourceClass);
}
Also used : Tasks(com.emc.vipr.client.Tasks) BulkDeleteParam(com.emc.storageos.model.block.BulkDeleteParam) TaskList(com.emc.storageos.model.TaskList) URI(java.net.URI)

Example 7 with Tasks

use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.

the class AddVolumesToApplication method doExecute.

@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
    VolumeGroupUpdateParam input = new VolumeGroupUpdateParam();
    VolumeGroupVolumeList addVolumesList = new VolumeGroupVolumeList();
    addVolumesList.setVolumes(volumeIds);
    if (replicationGroup != null && !replicationGroup.isEmpty()) {
        addVolumesList.setReplicationGroupName(replicationGroup);
    }
    input.setAddVolumesList(addVolumesList);
    TaskList taskList = getClient().application().updateApplication(applicationId, input);
    return new Tasks<TaskResourceRep>(getClient().auth().getClient(), taskList.getTaskList(), TaskResourceRep.class);
}
Also used : VolumeGroupVolumeList(com.emc.storageos.model.application.VolumeGroupUpdateParam.VolumeGroupVolumeList) 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 8 with Tasks

use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.

the class CreateSnapshotForApplication method doExecute.

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

Example 9 with Tasks

use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.

the class CreateVplexVolumeFromAppSnapshot method doExecute.

@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
    VolumeGroupSnapshotOperationParam input = new VolumeGroupSnapshotOperationParam();
    input.setCopySetName(copySetName);
    input.setSubGroups(new ArrayList<String>(subGroups));
    TaskList taskList = getClient().application().exposeApplicationSnapshot(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) VolumeGroupSnapshotOperationParam(com.emc.storageos.model.application.VolumeGroupSnapshotOperationParam)

Example 10 with Tasks

use of com.emc.vipr.client.Tasks in project coprhd-controller by CoprHD.

the class DeleteSnapshotSessionForApplication method doExecute.

@Override
protected Tasks<TaskResourceRep> doExecute() throws Exception {
    VolumeGroupSnapshotSessionDeactivateParam input = new VolumeGroupSnapshotSessionDeactivateParam();
    input.setPartial(true);
    input.setSnapshotSessions(snapshotSessions);
    TaskList taskList = getClient().application().deactivateApplicationSnapshotSession(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) VolumeGroupSnapshotSessionDeactivateParam(com.emc.storageos.model.application.VolumeGroupSnapshotSessionDeactivateParam) TaskList(com.emc.storageos.model.TaskList)

Aggregations

Tasks (com.emc.vipr.client.Tasks)29 TaskList (com.emc.storageos.model.TaskList)27 WaitForTasks (com.emc.sa.service.vipr.tasks.WaitForTasks)24 VolumeGroupUpdateParam (com.emc.storageos.model.application.VolumeGroupUpdateParam)8 URI (java.net.URI)8 VolumeGroupSnapshotOperationParam (com.emc.storageos.model.application.VolumeGroupSnapshotOperationParam)4 VolumeGroupVolumeList (com.emc.storageos.model.application.VolumeGroupUpdateParam.VolumeGroupVolumeList)4 VolumeGroupFullCopyDetachParam (com.emc.storageos.model.application.VolumeGroupFullCopyDetachParam)2 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)2 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 VolumeGroupFullCopyCreateParam (com.emc.storageos.model.application.VolumeGroupFullCopyCreateParam)1 VolumeGroupFullCopyRestoreParam (com.emc.storageos.model.application.VolumeGroupFullCopyRestoreParam)1 VolumeGroupFullCopyResynchronizeParam (com.emc.storageos.model.application.VolumeGroupFullCopyResynchronizeParam)1 VolumeGroupSnapshotCreateParam (com.emc.storageos.model.application.VolumeGroupSnapshotCreateParam)1 VolumeGroupSnapshotSessionCreateParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionCreateParam)1 VolumeGroupSnapshotSessionDeactivateParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionDeactivateParam)1 VolumeGroupSnapshotSessionLinkTargetsParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionLinkTargetsParam)1 VolumeGroupSnapshotSessionRelinkTargetsParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionRelinkTargetsParam)1 VolumeGroupSnapshotSessionRestoreParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionRestoreParam)1 VolumeGroupSnapshotSessionUnlinkTargetsParam (com.emc.storageos.model.application.VolumeGroupSnapshotSessionUnlinkTargetsParam)1