use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockApplications method applicationVolumeJson.
public static void applicationVolumeJson(String id) {
List<VolumeApplication> volumeDetails = Lists.newArrayList();
List<NamedRelatedResourceRep> volumes = AppSupportUtil.getVolumesByApplication(id);
Map<URI, String> virtualArrays = ResourceUtils.mapNames(BourneUtil.getViprClient().varrays().list());
Map<URI, String> virtualPools = ResourceUtils.mapNames(BourneUtil.getViprClient().blockVpools().list());
for (NamedRelatedResourceRep volume : volumes) {
VolumeRestRep blockVolume = BourneUtil.getViprClient().blockVolumes().get((volume.getId()));
volumeDetails.add(new VolumeApplication(blockVolume, virtualArrays, virtualPools));
}
renderJSON(DataTablesSupport.createJSON(volumeDetails, params));
}
use of com.emc.storageos.model.block.VolumeRestRep 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.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class MobilityGroupMigrationService method mapVpoolVolumes.
/**
* Get map of virtual pool id to list of volumes in the virtual pool
*
* @return map of virtual pool to volumes
*/
private Map<URI, Set<URI>> mapVpoolVolumes() {
Set<URI> volumes = getVolumes();
Map<URI, Set<URI>> vpoolVolumes = Maps.newHashMap();
for (URI volume : volumes) {
VolumeRestRep vol = getClient().blockVolumes().get(volume);
if (!vpoolVolumes.containsKey(vol.getVirtualPool().getId())) {
vpoolVolumes.put(vol.getVirtualPool().getId(), new HashSet<URI>());
}
vpoolVolumes.get(vol.getVirtualPool().getId()).add(vol.getId());
}
return vpoolVolumes;
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class DeleteVmfsDatastoreAndVolumeService method precheck.
@Override
public void precheck() throws Exception {
super.precheck();
datastores = Maps.newHashMap();
acquireHostLock();
for (String datastoreName : datastoreNames) {
Datastore datastore = vmware.getDatastore(datacenter.getLabel(), datastoreName);
vmware.verifyDatastoreForRemoval(datastore);
List<VolumeRestRep> volumes = vmware.verifyVolumesBackingDatastore(host, hostId, datastore);
datastores.put(datastore, volumes);
}
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockSnapshotSessionsDataTable method fetch.
public static List<BlockSnapshotSession> fetch(URI projectId) {
if (projectId == null) {
return Collections.emptyList();
}
ViPRCoreClient client = getViprClient();
List<BlockSnapshotSessionRestRep> blockSnapshots = client.blockSnapshotSessions().findByProject(projectId);
Map<URI, VolumeRestRep> parentVolumes = getParentVolumes(blockSnapshots);
List<BlockSnapshotSession> results = Lists.newArrayList();
for (BlockSnapshotSessionRestRep blockSnapshot : blockSnapshots) {
BlockSnapshotSession snap = new BlockSnapshotSession(blockSnapshot);
// Get the parent volume of the snapshot
VolumeRestRep volume = parentVolumes.get(ResourceUtils.id(blockSnapshot.getParent()));
snap.volume = ResourceUtils.name(volume);
results.add(snap);
}
return results;
}
Aggregations