use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getSnapshotOptionsForProject.
private List<AssetOption> getSnapshotOptionsForProject(AssetOptionsContext ctx, URI project, ResourceFilter<BlockSnapshotRestRep> filter) {
ViPRCoreClient client = api(ctx);
List<BlockSnapshotRestRep> snapshots = client.blockSnapshots().findByProject(project, filter);
return constructSnapshotOptions(client, project, snapshots);
}
use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getVolumeRPSnapshotOptionsForProject.
private List<AssetOption> getVolumeRPSnapshotOptionsForProject(AssetOptionsContext ctx, URI project) {
final ViPRCoreClient client = api(ctx);
List<BlockSnapshotRestRep> snapshots = findSnapshotsByProject(client, project);
List<BlockSnapshotRestRep> filteredSnap = new ArrayList<>();
for (BlockSnapshotRestRep snapshot : snapshots) {
if (isSnapshotRPBookmark(snapshot)) {
filteredSnap.add(snapshot);
}
}
return constructSnapshotOptions(client, project, filteredSnap);
}
use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getSnapshotOptionsForProject.
private List<AssetOption> getSnapshotOptionsForProject(AssetOptionsContext ctx, URI project) {
ViPRCoreClient client = api(ctx);
List<BlockSnapshotRestRep> snapshots = client.blockSnapshots().findByProject(project);
return constructSnapshotOptions(client, project, snapshots);
}
use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getExportedBlockSnapshotsByVolume.
@Asset("exportedBlockSnapshot")
@AssetDependencies({ "project" })
public List<AssetOption> getExportedBlockSnapshotsByVolume(AssetOptionsContext ctx, URI project) {
debug("getting exported blockSnapshots (project=%s)", project);
final ViPRCoreClient client = api(ctx);
List<URI> snapshotIds = Lists.newArrayList();
for (ExportGroupRestRep export : client.blockExports().findByProject(project)) {
for (ExportBlockParam resource : export.getVolumes()) {
if (ResourceType.isType(ResourceType.BLOCK_SNAPSHOT, resource.getId())) {
snapshotIds.add(resource.getId());
}
}
}
List<BlockSnapshotRestRep> snapshots = client.blockSnapshots().getByIds(snapshotIds);
return createVolumeWithVarrayOptions(client, snapshots);
}
use of com.emc.storageos.model.block.BlockSnapshotRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getExportPathStorageSystem.
@SuppressWarnings("incomplete-switch")
@Asset("exportPathStorageSystem")
@AssetDependencies({ "exportPathExport" })
public List<AssetOption> getExportPathStorageSystem(AssetOptionsContext ctx, URI exportId) {
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
List<URI> storageSystemIds = new ArrayList<URI>();
ExportGroupRestRep export = client.blockExports().get(exportId);
List<ExportBlockParam> volumes = export.getVolumes();
for (ExportBlockParam volume : volumes) {
URI resourceId = volume.getId();
ResourceType volumeType = ResourceType.fromResourceId(resourceId.toString());
switch(volumeType) {
case VOLUME:
VolumeRestRep v = client.blockVolumes().get(resourceId);
if (v != null) {
storageSystemIds.add(v.getStorageController());
}
break;
case BLOCK_SNAPSHOT:
BlockSnapshotRestRep s = client.blockSnapshots().get(resourceId);
if (s != null) {
storageSystemIds.add(s.getStorageController());
}
break;
}
}
List<StorageSystemRestRep> storageSystems = client.storageSystems().getByIds(storageSystemIds);
for (StorageSystemRestRep storageSystem : storageSystems) {
String systemType = storageSystem.getSystemType();
if (Type.vmax.name().equalsIgnoreCase(systemType) || Type.vplex.name().equalsIgnoreCase(systemType)) {
options.add(new AssetOption(storageSystem.getId(), storageSystem.getName()));
}
}
return options;
}
Aggregations