use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BaseAssetOptionsProvider method createOption.
protected AssetOption createOption(DataObject value) {
URI id = value.getId();
String label = value.getLabel();
return new AssetOption(id.toString(), label);
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BaseAssetOptionsProvider method createBaseResourceOptions.
protected List<AssetOption> createBaseResourceOptions(Collection<? extends DataObjectRestRep> values) {
List<AssetOption> options = Lists.newArrayList();
for (DataObjectRestRep value : values) {
options.add(createBaseResourceOption(value));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BaseHostProvider method createFileHostOptions.
protected List<AssetOption> createFileHostOptions(AssetOptionsContext ctx, Collection<HostRestRep> hosts) {
List<AssetOption> options = Lists.newArrayList();
for (HostRestRep value : hosts) {
options.add(createFileHostOption(ctx, value));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BaseHostProvider method createClusterOptions.
protected List<AssetOption> createClusterOptions(AssetOptionsContext ctx, Collection<ClusterRestRep> clusters) {
List<AssetOption> options = Lists.newArrayList();
for (ClusterRestRep value : clusters) {
options.add(createClusterOption(ctx, value));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.
the class BlockProvider method getLocalMirrorBlockVolumes.
@Asset("localMirrorBlockVolume")
@AssetDependencies({ "project" })
public List<AssetOption> getLocalMirrorBlockVolumes(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 = getProjectVolumeNames(client, project);
List<AssetOption> options = Lists.newArrayList();
for (VolumeDetail detail : volumeDetails) {
if (isLocalMirrorSupported(detail.vpool)) {
options.add(createVolumeOption(client, null, detail.volume, volumeNames));
}
}
return options;
}
Aggregations