use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockSnapshotSessions method snapshotSessionLinkTarget.
public static void snapshotSessionLinkTarget(String snapshotSessionId) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<RelatedResourceRep> targets = client.blockSnapshotSessions().get(uri(snapshotSessionId)).getLinkedTarget();
List<BlockSnapshotRestRep> snapshots = client.blockSnapshots().getByRefs(targets);
render(snapshots, snapshotSessionId);
}
use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockSnapshots method snapshotDetails.
public static void snapshotDetails(String snapshotId) {
ViPRCoreClient client = BourneUtil.getViprClient();
AffectedResources.BlockSnapshotDetails blockSnapshot = new AffectedResources.BlockSnapshotDetails(uri(snapshotId));
if (blockSnapshot.blockSnapshot == null) {
flash.error(MessagesUtils.get(UNKNOWN, snapshotId));
snapshots(null);
}
AffectedResources.VolumeDetails volume = new AffectedResources.VolumeDetails(blockSnapshot.volume.getId());
List<Task<BlockSnapshotRestRep>> tasks = null;
if (blockSnapshot.blockSnapshot != null) {
Tasks<BlockSnapshotRestRep> tasksResponse = client.blockSnapshots().getTasks(blockSnapshot.blockSnapshot.getId());
tasks = tasksResponse.getTasks();
}
render(blockSnapshot, volume, tasks);
}
use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockVolumes method volumeSnapshots.
public static void volumeSnapshots(String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<NamedRelatedResourceRep> refs = client.blockSnapshots().listByVolume(uri(volumeId));
List<BlockSnapshotRestRep> snapshots = client.blockSnapshots().getByRefs(refs);
render(snapshots);
}
use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockExportGroupSnapshotsDataTable method fetch.
public static List<ExportBlockSnapshot> fetch(URI exportGroupId) {
if (exportGroupId == null) {
return Collections.emptyList();
}
ViPRCoreClient client = BourneUtil.getViprClient();
ExportGroupRestRep exportGroup = client.blockExports().get(exportGroupId);
List<ExportBlockSnapshot> snapshots = Lists.newArrayList();
for (ExportBlockParam exportBlockParam : exportGroup.getVolumes()) {
if (ResourceType.isType(BLOCK_SNAPSHOT, exportBlockParam.getId())) {
BlockSnapshotRestRep snapshot = client.blockSnapshots().get(exportBlockParam.getId());
VolumeRestRep volume = client.blockVolumes().get(snapshot.getParent().getId());
snapshots.add(new ExportBlockSnapshot(snapshot, volume.getName()));
}
}
return snapshots;
}
use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class CreateVplexVolumeFromSnapshotService method execute.
@Override
public void execute() throws Exception {
for (URI snapshotId : uris(snapshotIds)) {
Task<BlockSnapshotRestRep> task = execute(new CreateVplexVolumeFromSnapshot(snapshotId));
URI volume = task.getResourceId();
addAffectedResource(volume);
}
}
Aggregations