use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method constructSnapshotWithSnapshotSessionOptions.
protected List<AssetOption> constructSnapshotWithSnapshotSessionOptions(List<BlockSnapshotRestRep> snapshots, List<BlockSnapshotSessionRestRep> snapshotSessions) {
List<AssetOption> options = Lists.newArrayList();
// Create a map of linked target URIs to snapshot session names for convenience when creating
// the option labels.
Map<URI, String> linkedSnapshotToSnapshotSessionMap = new HashMap<URI, String>();
for (BlockSnapshotSessionRestRep snapshotSession : snapshotSessions) {
for (RelatedResourceRep linkedTarget : snapshotSession.getLinkedTarget()) {
linkedSnapshotToSnapshotSessionMap.put(linkedTarget.getId(), snapshotSession.getName());
}
}
for (BlockSnapshotRestRep snapshot : snapshots) {
// Ignore RP Bookmarks for snapshot session options
boolean isRPSnapshot = (snapshot.getTechnologyType() != null && snapshot.getTechnologyType().equalsIgnoreCase(RECOVERPOINT_BOOKMARK_SNAPSHOT_TYPE_VALUE));
boolean validSnapshotOption = snapshot.getTechnologyType() == null || !isRPSnapshot;
if (validSnapshotOption) {
options.add(new AssetOption(snapshot.getId(), getBlockSnapshotLinkedLabel(snapshot, linkedSnapshotToSnapshotSessionMap)));
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method getRemoteSnapshotBlockVolumes.
@Asset("remoteSnapshotBlockVolume")
@AssetDependencies({ "project" })
public List<AssetOption> getRemoteSnapshotBlockVolumes(AssetOptionsContext context, URI project) {
final ViPRCoreClient client = api(context);
List<VolumeRestRep> volumes = listVolumes(client, project);
List<VolumeDetail> volumeDetails = getVolumeDetails(client, volumes);
Map<URI, VolumeRestRep> volumeNames = ResourceUtils.mapById(volumes);
List<AssetOption> options = Lists.newArrayList();
for (VolumeDetail detail : volumeDetails) {
if (isRemoteSnapshotSupported(detail.volume)) {
options.add(createVolumeOption(client, null, detail.volume, volumeNames));
}
}
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method getExportPathExistingPath.
@Asset("exportPathExistingPath")
public List<AssetOption> getExportPathExistingPath(AssetOptionsContext ctx) {
List<AssetOption> options = Lists.newArrayList();
options.add(new AssetOption(YES_VALUE, YES_VALUE));
options.add(new AssetOption(NO_VALUE, NO_VALUE));
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method getCurrentExportPortGroups.
@Asset("exportCurrentPortGroup")
@AssetDependencies({ "host", "exportPathExport", "exportPathStorageSystem", "exportPathVirtualArray" })
public List<AssetOption> getCurrentExportPortGroups(AssetOptionsContext ctx, URI hostOrClusterId, URI exportId, URI storageSystemId, URI varrayId) {
final ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
SimpleValueRep value = client.customConfigs().getCustomConfigTypeValue(VMAX_PORT_GROUP_ENABLED, VMAX);
if (value.getValue().equalsIgnoreCase("true")) {
StoragePortGroupRestRepList portGroups = client.varrays().getStoragePortGroups(varrayId, exportId, storageSystemId, null, null, false);
return createPortGroupOptions(portGroups.getStoragePortGroups());
}
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method getBlockVirtualPoolFilters.
@Asset("blockVirtualPoolFilter")
public List<AssetOption> getBlockVirtualPoolFilters(AssetOptionsContext ctx) {
List<AssetOption> options = createBaseResourceOptions(api(ctx).blockVpools().getAll());
options.add(0, new AssetOption("All", "All"));
return options;
}
Aggregations