use of com.emc.vipr.client.Task in project coprhd-controller by CoprHD.
the class BlockConsistencyGroups method consistencyGroupDetails.
public static void consistencyGroupDetails(String consistencyGroupId) {
ViPRCoreClient client = BourneUtil.getViprClient();
AffectedResources.BlockConsistencyGroupDetails blockConsistencyGroup = new AffectedResources.BlockConsistencyGroupDetails(uri(consistencyGroupId));
if (blockConsistencyGroup.blockConsistencyGroup == null) {
flash.error(MessagesUtils.get(UNKNOWN, consistencyGroupId));
ConsistencyGroups.list();
}
Tasks<BlockConsistencyGroupRestRep> tasksResponse = client.blockConsistencyGroups().getTasks(blockConsistencyGroup.blockConsistencyGroup.getId());
List<Task<BlockConsistencyGroupRestRep>> tasks = tasksResponse.getTasks();
renderArgs.put("tasks", tasks);
List<VolumeRestRep> volumes = blockConsistencyGroup.volumes;
Map<URI, String> virtualArrays = ResourceUtils.mapNames(client.varrays().list());
Map<URI, String> virtualPools = ResourceUtils.mapNames(client.blockVpools().list());
List<Volume> volumeDetails = Lists.newArrayList();
for (VolumeRestRep volume : volumes) {
volumeDetails.add(new Volume(volume, virtualArrays, virtualPools));
}
render(blockConsistencyGroup, volumeDetails);
}
use of com.emc.vipr.client.Task in project coprhd-controller by CoprHD.
the class BlockSnapshotSessions method snapshotSessionDetails.
public static void snapshotSessionDetails(String snapshotSessionId) {
ViPRCoreClient client = BourneUtil.getViprClient();
AffectedResources.BlockSnapshotSessionDetails blockSnapshotSession = new AffectedResources.BlockSnapshotSessionDetails(uri(snapshotSessionId));
if (blockSnapshotSession.blockSnapshotSession == null) {
flash.error(MessagesUtils.get(UNKNOWN, snapshotSessionId));
snapshotSessions(null);
}
if (blockSnapshotSession.volume != null) {
AffectedResources.VolumeDetails volume = new AffectedResources.VolumeDetails(blockSnapshotSession.volume.getId());
renderArgs.put("volume", volume);
}
List<Task<BlockSnapshotSessionRestRep>> tasks = null;
if (blockSnapshotSession.blockSnapshotSession != null) {
Tasks<BlockSnapshotSessionRestRep> tasksResponse = client.blockSnapshotSessions().getTasks(blockSnapshotSession.blockSnapshotSession.getId());
tasks = tasksResponse.getTasks();
}
render(blockSnapshotSession, tasks);
}
use of com.emc.vipr.client.Task in project coprhd-controller by CoprHD.
the class FileSystems method delete.
private static void delete(List<URI> ids, String deleteType) {
if (ids != null) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<Task<FileShareRestRep>> tasks = Lists.newArrayList();
for (URI id : ids) {
boolean forceDelete = false;
Task<FileShareRestRep> task = client.fileSystems().deactivate(id, new FileSystemDeleteParam(forceDelete, deleteType));
tasks.add(task);
}
if (!tasks.isEmpty()) {
flash.put("info", MessagesUtils.get("resources.filesystems.deactivate", tasks.size()));
}
}
fileSystems(null);
}
use of com.emc.vipr.client.Task in project coprhd-controller by CoprHD.
the class ObjectBuckets method delete.
private static void delete(List<URI> ids, String deleteType) {
if (ids != null) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<Task<BucketRestRep>> tasks = Lists.newArrayList();
for (URI id : ids) {
boolean forceDelete = false;
Task<BucketRestRep> task = client.objectBuckets().deactivate(id, new BucketDeleteParam(forceDelete, deleteType));
tasks.add(task);
}
if (!tasks.isEmpty()) {
flash.put("info", MessagesUtils.get("resources.buckets.deactivate", tasks.size()));
}
}
buckets(null);
}
use of com.emc.vipr.client.Task in project coprhd-controller by CoprHD.
the class BlockVolumes method deactivate.
/**
* Begins deactivating a block volume by ID.
* <p>
* API Call: <tt>POST /block/volumes/{id}/deactivate?type={deletionType}</tt>
*
* @param id
* the ID of the block volume to deactivate.
* @param deletionType
* {@code FULL} or {@code VIPR_ONLY}
* @return a task for monitoring the progress of the operation.
*
* @see com.emc.storageos.model.block.VolumeDeleteTypeEnum
*/
public Task<VolumeRestRep> deactivate(URI id, VolumeDeleteTypeEnum deletionType) {
URI uri = client.uriBuilder(getDeactivateUrl()).queryParam("type", deletionType).build(id);
TaskResourceRep task = client.postURI(TaskResourceRep.class, uri);
return new Task<>(client, task, resourceClass);
}
Aggregations