use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockSnapshotsDataTable method fetch.
public static List<BlockSnapshot> fetch(URI projectId) {
if (projectId == null) {
return Collections.emptyList();
}
ViPRCoreClient client = getViprClient();
List<BlockSnapshotRestRep> blockSnapshots = client.blockSnapshots().findByProject(projectId);
Map<URI, VolumeRestRep> parentVolumes = getParentVolumes(blockSnapshots);
List<BlockSnapshot> results = Lists.newArrayList();
for (BlockSnapshotRestRep blockSnapshot : blockSnapshots) {
BlockSnapshot snap = new BlockSnapshot(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;
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockVolumesDataTable method fetch.
public static List<Volume> fetch(URI projectId, URI applicationId) {
if (projectId == null && applicationId == null) {
return Collections.EMPTY_LIST;
}
ViPRCoreClient client = getViprClient();
List<VolumeRestRep> volumes = Lists.newArrayList();
List<Volume> results = Lists.newArrayList();
Map<URI, String> virtualArrays = ResourceUtils.mapNames(client.varrays().list());
Map<URI, String> virtualPools = ResourceUtils.mapNames(client.blockVpools().list());
if (projectId != null) {
volumes = client.blockVolumes().findByProject(projectId);
for (VolumeRestRep volume : volumes) {
results.add(new Volume(volume, virtualArrays, virtualPools));
}
} else if (applicationId != null) {
List<VolumeRestRep> result = Lists.newArrayList();
List<NamedRelatedResourceRep> groups = AppSupportUtil.getVolumesByApplication(applicationId.toString());
List<NamedRelatedResourceRep> clones = AppSupportUtil.getFullCopiesByApplication(applicationId.toString());
for (NamedRelatedResourceRep volume : groups) {
result.add(BourneUtil.getViprClient().blockVolumes().get((volume.getId())));
}
for (NamedRelatedResourceRep clone : clones) {
result.add(BourneUtil.getViprClient().blockVolumes().get((clone.getId())));
}
for (VolumeRestRep volumeApplication : result) {
results.add(new Volume(volumeApplication, virtualArrays, virtualPools));
}
}
return results;
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class VolumesDataTable method fetch.
public static List<Volume> fetch(URI projectId) {
if (projectId == null) {
return Collections.EMPTY_LIST;
}
ViPRCoreClient client = getViprClient();
List<VolumeRestRep> volumes = client.blockVolumes().findByProject(projectId);
Map<URI, String> virtualArrays = ResourceUtils.mapNames(client.varrays().list());
Map<URI, String> virtualPools = ResourceUtils.mapNames(client.blockVpools().list());
List<Volume> results = Lists.newArrayList();
for (VolumeRestRep volume : volumes) {
results.add(new Volume(volume, virtualArrays, virtualPools));
}
return results;
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockVolumes method deleteContinuousCopy.
@FlashException(referrer = { "volume" })
public static void deleteContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().deactivateContinuousCopies(uri(volumeId), input, VolumeDeleteTypeEnum.FULL);
flash.put("info", MessagesUtils.get("resources.continuouscopy.deactivate"));
}
volume(volumeId, continuousCopyId);
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockVolumes method pauseContinuousCopy.
@FlashException(referrer = { "volume" })
public static void pauseContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().pauseContinuousCopies(uri(volumeId), input);
flash.put("info", MessagesUtils.get("resources.continuouscopy.pause"));
}
volume(volumeId, null);
}
Aggregations